minor updates
[dotfiles.git] / shell / .bashrc
index 9ea8e26..979ba98 100644 (file)
@@ -43,7 +43,7 @@ alias slrn="slrn -i \"${XDG_CONFIG_HOME:-$HOME/.config}/slrn/slrnrc\""
 
 alias ls='ls --color=auto'
 alias grep='grep --color=auto'
-alias vi='vim --servername VIM'
+alias vi='vim'
 alias shutdown="echo \"Are you sure? I\'m Ygdrassil\" && read && shutdown"
 
 if [ -f /etc/bash_completion ]
@@ -57,9 +57,14 @@ set_prompt(){
        [[ $last_c -ge 1 ]] && PS1="($last_c) $PS1"
        if [[ -n "$SCHROOT_CHROOT_NAME" ]]
        then
-               PS1="($SCHROOT_CHROOT_NAME)$PS1\w\$ "
+               PS1="($SCHROOT_CHROOT_NAME)$PS1"
+       fi
+       if [[ "$COLUMNS" -le 80 ]]
+       then
+               PS1="$PS1 $(echo "$PWD" | sed -e 's|'"$HOME"'|~|g' -e 's|\([^/][^/]\)[^\/]\{3,\}\/|\1..\/|g')"
        else
-               PS1="$PS1\w\$ "
+               PS1="$PS1\w"
        fi
+       PS1="$PS1\$ "
 }
 PROMPT_COMMAND='set_prompt'