summaryrefslogtreecommitdiff
path: root/.zsh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 03:52:51 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-03-24 03:55:27 +0100
commitd72a7d09a53c3c10615337a1306efb050e88eba3 (patch)
tree9df10eb4a411a076ab30b5b0013c3752500b0c26 /.zsh
parent88b6f3d4f4a55ae046de0fb004671cc65db5a49d (diff)
downloaddotfiles-d72a7d09a53c3c10615337a1306efb050e88eba3.tar.gz
dotfiles-d72a7d09a53c3c10615337a1306efb050e88eba3.tar.bz2
dotfiles-d72a7d09a53c3c10615337a1306efb050e88eba3.zip
ZSH enhancements.
Diffstat (limited to '.zsh')
-rw-r--r--.zsh/zshfunctions11
-rw-r--r--.zsh/zshrc23
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
diff --git a/.zsh/zshrc b/.zsh/zshrc
index 898e638..9f36e7d 100644
--- a/.zsh/zshrc
+++ b/.zsh/zshrc
@@ -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