X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=541417a422ae2ff1c5040e1e58c70f74b8867034;hb=7ae7c0c571d5d950e4f6a349130a8f3401e09ea1;hp=10b3e9b18acbbfacdeee0f576bee1e9a3f6d538d;hpb=9a66d4531e7d0d015b38be0b38f1c379a45fd03f;p=dotfiles.git diff --git a/.shellrc b/.shellrc index 10b3e9b..541417a 100644 --- a/.shellrc +++ b/.shellrc @@ -15,6 +15,8 @@ esac # Stop if non-interactive shell [ -z "$PS1" ] && return +PS1="$OPS1$SHLVL " + if test -n "$BASH_VERSION"; then # append to the history file, don't overwrite it shopt -s histappend @@ -58,10 +60,6 @@ case "$HOME" in esac -OPS1="$OPS1\\$" -PS1="$OPS1 " - - if test -n "$BASH_VERSION"; then [ "`type -t ls`" = alias ] && unalias ls [ "`type -t ll`" = alias ] && unalias ll @@ -98,12 +96,6 @@ if test -n "$BASH_VERSION"; then fi fi - if [ -d "$HOME"/.bash_completion.d ]; then - for _compf in "$HOME"/.bash_completion.d/*; do - . $_compf - done - fi - for cmd in builtin cgmem_nice command dbus-launch exec \ killall man nice nohup pidof pidOf KillAll pgrep pkill psg pswg su sudo \ time whence whereis which xargs; do @@ -122,6 +114,12 @@ if test -n "$BASH_VERSION"; then ! has_completion $cmd && complete -o default -A hostname $cmd done + if [ -d "$HOME"/.bash_completion.d ]; then + for _compf in "$HOME"/.bash_completion.d/*; do + . $_compf + done + fi + delegate_completion() { local prog programs prog=$1 @@ -154,6 +152,11 @@ if test -n "$BASH_VERSION"; then fi complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser + if [ "`type -t short_curdir`" != function -a \ + -r "$HOME"/admin/prog/short_curdir ]; then + . "$HOME"/admin/prog/short_curdir + fi + #if type -p pip >/dev/null 2>&1; then # eval "`pip completion --bash`" # rm -rf /tmp/pip_build_"$USER" @@ -338,7 +341,11 @@ include() { mc() { if test -n "$BASH_VERSION"; then MC_SAVE_OPS1="$OPS1" - OPS1="\u@\h " + if [ "`type -t short_curdir`" = function ]; then + OPS1="\u@\h \`short_curdir\` \\$" + else + OPS1="\u@\h \W \\$" + fi fi if [ -n "$SLOWTERM" ]; then