diff options
Diffstat (limited to '.zsh.before')
-rw-r--r-- | .zsh.before/aliases.zsh | 10 | ||||
-rw-r--r-- | .zsh.before/custom_prompt_path.zsh | 4 | ||||
-rw-r--r-- | .zsh.before/functions.zsh | 11 | ||||
-rw-r--r-- | .zsh.before/git.zsh | 4 | ||||
-rw-r--r-- | .zsh.before/key-bindings.zsh | 10 | ||||
-rw-r--r-- | .zsh.before/last-command.zsh | 7 | ||||
-rw-r--r-- | .zsh.before/noglob.zsh | 4 | ||||
-rw-r--r-- | .zsh.before/path.zsh | 19 | ||||
-rw-r--r-- | .zsh.before/rm.zsh | 2 | ||||
-rw-r--r-- | .zsh.before/vi-mode.zsh | 3 |
10 files changed, 74 insertions, 0 deletions
diff --git a/.zsh.before/aliases.zsh b/.zsh.before/aliases.zsh new file mode 100644 index 0000000..2fc2c1d --- /dev/null +++ b/.zsh.before/aliases.zsh @@ -0,0 +1,10 @@ +# Global aliases +alias -g ...='../..' +alias -g ....='../../..' +alias -g .....='../../../..' +alias -g C='| wc -l' +alias -g H='| head' +alias -g L="| less" +alias -g N="| /dev/null" +alias -g S='| sort' +alias -g G='| grep' # now you can do: ls foo G something diff --git a/.zsh.before/custom_prompt_path.zsh b/.zsh.before/custom_prompt_path.zsh new file mode 100644 index 0000000..18e68b9 --- /dev/null +++ b/.zsh.before/custom_prompt_path.zsh @@ -0,0 +1,4 @@ +#Load themes from yadr and from user's custom prompts (themes) in ~/.zsh.prompts +autoload promptinit +fpath=($HOME/.zsh.prompts $fpath) +promptinit diff --git a/.zsh.before/functions.zsh b/.zsh.before/functions.zsh new file mode 100644 index 0000000..4b2ef1a --- /dev/null +++ b/.zsh.before/functions.zsh @@ -0,0 +1,11 @@ +# Functions +# +# (f)ind by (n)ame +# usage: fn foo +# to find all files containing 'foo' in the name +function fn() { ls **/*$1* } + +if [ -e $HOME/bin/functions.sh ] +then + . $HOME/bin/functions.sh +fi diff --git a/.zsh.before/git.zsh b/.zsh.before/git.zsh new file mode 100644 index 0000000..c87ec5a --- /dev/null +++ b/.zsh.before/git.zsh @@ -0,0 +1,4 @@ +# Makes git auto completion faster favouring for local completions +__git_files () { + _wanted files expl 'local files' _files +} diff --git a/.zsh.before/key-bindings.zsh b/.zsh.before/key-bindings.zsh new file mode 100644 index 0000000..c1c7d8e --- /dev/null +++ b/.zsh.before/key-bindings.zsh @@ -0,0 +1,10 @@ +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets + +bindkey -v # Use vi key bindings +bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. + +# emacs style +bindkey '^a' beginning-of-line +bindkey '^e' end-of-line diff --git a/.zsh.before/last-command.zsh b/.zsh.before/last-command.zsh new file mode 100644 index 0000000..9f7486b --- /dev/null +++ b/.zsh.before/last-command.zsh @@ -0,0 +1,7 @@ +# Use Ctrl-x,Ctrl-l to get the output of the last command +zmodload -i zsh/parameter +insert-last-command-output() { +LBUFFER+="$(eval $history[$((HISTCMD-1))])" +} +zle -N insert-last-command-output +bindkey "^X^L" insert-last-command-output diff --git a/.zsh.before/noglob.zsh b/.zsh.before/noglob.zsh new file mode 100644 index 0000000..ede67c9 --- /dev/null +++ b/.zsh.before/noglob.zsh @@ -0,0 +1,4 @@ +# Don't try to glob with zsh so you can do +# stuff like ga *foo* and correctly have +# git add the right stuff +alias git='noglob git' diff --git a/.zsh.before/path.zsh b/.zsh.before/path.zsh new file mode 100644 index 0000000..f87ba45 --- /dev/null +++ b/.zsh.before/path.zsh @@ -0,0 +1,19 @@ +# Add $HOME/bin before /usr/local/sbin and /usr/local/bin in $PATH +# Also works if they are switched +autoload -U regexp-replace +if [[ "$PATH" != *dave/bin:/usr/local/sbin* ]];then + case "$PATH" in + */usr/local/bin:/usr/local/sbin*) + regexp-replace PATH '/usr/local/bin:/usr/local/sbin:' '$HOME/bin:/usr/local/sbin:/usr/local/bin:' + ;; + */usr/local/sbin:/usr/local/bin*) + regexp-replace PATH '/usr/local/sbin:/usr/local/bin:' '$HOME/bin:/usr/local/sbin:/usr/local/bin:' + ;; + esac +fi + +## RASPBERRY PI +if [[ "$HOST" == *pitheunlord* ]]; then + PATH=$PATH:"/opt/vc/bin:/opt/vc/sbin" +fi + diff --git a/.zsh.before/rm.zsh b/.zsh.before/rm.zsh new file mode 100644 index 0000000..26508a3 --- /dev/null +++ b/.zsh.before/rm.zsh @@ -0,0 +1,2 @@ +# Override rm -i alias which makes rm prompt for every action +alias rm='nocorrect rm' diff --git a/.zsh.before/vi-mode.zsh b/.zsh.before/vi-mode.zsh new file mode 100644 index 0000000..4ac7453 --- /dev/null +++ b/.zsh.before/vi-mode.zsh @@ -0,0 +1,3 @@ +set -o vi +export EDITOR=vim +export VISUAL=vim |