diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/zshfunctions | 11 | ||||
-rw-r--r-- | .zsh/zshrc | 23 |
2 files changed, 32 insertions, 2 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index 317dd96..3a10bd4 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -1,14 +1,23 @@ # Nice mappings to restart/... the services Start Stop Reload Restart () { + local SUDO + [[ $UID != 0 ]] && SUDO="sudo" $SUDO /etc/init.d/$1 ${0:l} } +# Quick find +f() +{ + echo "find . -iname \"*$1*\"" + find . -iname "*$1*" +} + # Change to the directory of a specific package _cdu () { - cd $(dirname $1) + cd ${1:h} } # unpacks a specific package @@ -100,9 +100,13 @@ zstyle ":completion:*:default" select-prompt "%SMatch %M %P%s" # show statusl zstyle ":completion::complete:*" rehash true # rehash always :) +# colors [[ -z $LS_COLORS ]] && eval $(dircolors) # needed for next line zstyle ":completion:*:default" list-colors ${(s.:.)LS_COLORS} # make filecompletions being colored +# do not show the current directory for e.g. cd ../<TAB> +zstyle ':completion:*:cd:*' ignore-parents parent pwd + # }}} # Prompt {{{ @@ -195,6 +199,14 @@ bindkey "^[-" copy-prev-word # delete previous word upto next whitespace bindkey "^ew" backward-kill-word + +# some 'insert x before' things +for word c in sudo s vim v AK a; do + eval "insert-$word() { LBUFFER=\"$word \$LBUFFER\" }" + zle -N insert-$word + bindkey "^[i$c" insert-$word +done + case $TERM in xterm*|aterm|rxvt) bindkey "^[OH" beginning-of-line @@ -214,8 +226,9 @@ esac HISTSIZE=10000 SAVEHIST=12000 HISTFILE=~/.zshhistory -setopt hist_no_store # no not store history related commands +setopt hist_no_store # do not store history related commands setopt inc_append_history # append incrementally instead of waiting until the shell exists +setopt share_history # share the history between sessions setopt hist_verify # for history related commands: reload the expanded version instead of executing it directly setopt hist_no_functions # do not store function definitions @@ -235,4 +248,12 @@ setopt auto_continue # disown implies 'bg' # }}} +# Rest {{{ +################################################# + +# load zmv +autoload -U zmv + +# }}} + # vim: fdm=marker |