diff options
author | Hendrik Jaeger <jaeger@gyselroth.com> | 2014-11-21 10:51:38 +0100 |
---|---|---|
committer | Hendrik Jaeger <jaeger@gyselroth.com> | 2014-11-21 10:51:38 +0100 |
commit | 44934b91a195f654e812a27282f1c173bc472025 (patch) | |
tree | 844f6acf2f277c66a64df5f38629c0582a5cfcde | |
parent | d121eb2f98e35ec2efcac978fbfd2495375e65aa (diff) |
Added vi-mode bindings and set default to vi-mode.
Minor cleanup.
modified: .zsh_functions
deleted: .zshcomprc
modified: .zshrc
-rw-r--r-- | .zsh_functions | 5 | ||||
-rw-r--r-- | .zshcomprc | 6 | ||||
-rw-r--r-- | .zshrc | 24 |
3 files changed, 27 insertions, 8 deletions
diff --git a/.zsh_functions b/.zsh_functions index abda777..1d7cc9a 100644 --- a/.zsh_functions +++ b/.zsh_functions @@ -56,3 +56,8 @@ function shufflevideos () { find $@ -type f -iregex ".*\.\(avi\|flv\|mkv\|mpeg\|mpg\|wmv\|wva\|mp4\|webm\|wva\|m4v\|ogm\|mp4\|mov\)" -exec mpv --shuffle $MPVOPTS \{\} + } +function zle-line-init zle-keymap-select { + RPS1="%B${${KEYMAP/vicmd/c}/(main|viins)/}%b" + RPS2=$RPS1 + zle reset-prompt +} diff --git a/.zshcomprc b/.zshcomprc deleted file mode 100644 index 9188550..0000000 --- a/.zshcomprc +++ /dev/null @@ -1,6 +0,0 @@ -# The following lines were added by compinstall -zstyle :compinstall filename '/home/henk/.zshcomprc' - -autoload -Uz compinit -compinit -# End of lines added by compinstall @@ -1,10 +1,15 @@ autoload -Uz vcs_info +autoload -U edit-command-line . ~/.zsh_comprc . ~/.zsh_functions . ~/.zsh_aliases . ~/.zsh_local +zle -N zle-line-init +zle -N zle-keymap-select +zle -N edit-command-line + HISTFILE=~/.zsh_history HISTSIZE=5000 SAVEHIST=3000 @@ -44,7 +49,22 @@ setopt AUTO_CONTINUE setopt NO_BG_NICE setopt LONG_LIST_JOBS -bindkey -e +bindkey -v + +# Use vim cli mode +bindkey '^P' up-history +bindkey '^N' down-history + +# backspace and ^h working even after +# returning from command mode +bindkey '^?' backward-delete-char +bindkey '^h' backward-delete-char + +# ctrl-w removed word backwards +bindkey '^w' backward-kill-word -#read -q "REPLY?Exec to fish? " && exec fish -i +# ctrl-r starts searching history backward +bindkey '^r' history-incremental-search-backward +# v in command mode starts editor for current line +bindkey -M vicmd v edit-command-line |