From ed01c26068ea406b21f82ae0998efc5d0f0698f2 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Thu, 9 Aug 2007 22:01:58 +0200 Subject: [PATCH] Add inputrc, bash_profile and modify profile to use these. Kills the annoying bell, and handles keys better. (Might even help with Johannes' problem with RXVT) Signed-off-by: Marius Storm-Olsen --- etc/bash_profile | 7 +++++++ etc/inputrc | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ etc/profile | 19 +++++++++++++----- 3 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 etc/bash_profile create mode 100644 etc/inputrc diff --git a/etc/bash_profile b/etc/bash_profile new file mode 100644 index 00000000..e0a1841d --- /dev/null +++ b/etc/bash_profile @@ -0,0 +1,7 @@ +# Some good standards, which are not used if the user +# creates his/her own .bashrc/.bash_profile + +eval `dircolors -b` +alias less='less -r' +alias ls='ls -F --color' +alias ll='ls -l' \ No newline at end of file diff --git a/etc/inputrc b/etc/inputrc new file mode 100644 index 00000000..ab06f3ac --- /dev/null +++ b/etc/inputrc @@ -0,0 +1,61 @@ +# none, visible or audible +set bell-style visible + +# Ask before displaying >40 items +# Since $WINDIR $PATH var can be in $PATH, this could list +# all window executables in C:\WINDOWS +set completion-query-items 40 + +# Ignore case for the command-line-completion functionality +# on: default on a Windows style console +# off: default on a *nix style console +set completion-ignore-case on + +# disable/enable 8bit input +set meta-flag on +set input-meta on +set output-meta off +set convert-meta on + +# visible-stats +# Append a mark according to the file type in a listing +set visible-stats off +set mark-directories on + +# Show all instead of beeping first +set show-all-if-ambiguous off + +# MSYSTEM is emacs based +$if mode=emacs + # Common to Console & RXVT + "\C-?": backward-kill-line # Ctrl-BackSpace + "\e[2~": paste-from-clipboard # "Ins. Key" + "\e[5~": beginning-of-history # Page up + "\e[6~": end-of-history # Page down + + $if term=msys # RXVT + "\e[7~": beginning-of-line # Home Key + "\e[8~": end-of-line # End Key + "\e[11~": display-shell-version # F1 + "\e[15~": re-read-init-file # F5 + "\e[12~": "Function Key 2" + "\e[13~": "Function Key 3" + "\e[14~": "Function Key 4" + "\e[17~": "Function Key 6" + "\e[18~": "Function Key 7" + "\e[19~": "Function Key 8" + "\e[20~": "Function Key 9" + "\e[21~": "Function Key 10" + $else + # Eh, normal Console is not really cygwin anymore, is it? Using 'else' instead. -mstormo + # $if term=cygwin # Console + "\e[1~": beginning-of-line # Home Key + "\e[4~": end-of-line # End Key + "\e[17~": "Function Key 6" + "\e[18~": "Function Key 7" + "\e[19~": "Function Key 8" + "\e[20~": "Function Key 9" + "\e[21~": "Function Key 10" + "\e[23~": "Function Key 11" + $endif +$endif diff --git a/etc/profile b/etc/profile index 755ad4d8..5a7bd34f 100644 --- a/etc/profile +++ b/etc/profile @@ -1,7 +1,7 @@ # Copyright (C) 2001, 2002 Earnie Boyd # This file is part of the Minimal SYStem. # http://www.mingw.org/msys.shtml -# +# # File: profile # Description: Shell environment initialization script # Last Revised: 2002.05.04 @@ -44,6 +44,12 @@ if [ "x$HISTFILE" == "x/.bash_history" ]; then HISTFILE=$HOME/.bash_history fi +if [ -e ~/.inputrc ]; then + export INPUTRC=~/.inputrc +else + export INPUTRC=/etc/inputrc +fi + export HOME LOGNAME MSYSTEM HISTFILE for i in /etc/profile.d/*.sh ; do @@ -59,12 +65,15 @@ $ ' alias clear=clsb -cd "$HOME" - -test -e .bash_profile && . .bash_profile +if [ -e ~/.bashrc ]; then + . ~/.bashrc +elif [ -e ~/.bash_profile ]; then + . ~/.bash_profile +elif [ -e /etc/bash_profile ]; then + . /etc/bash_profile +fi # Git specific stuff - test -e /bin/git.exe || { echo "Setting up git" -- 2.11.4.GIT