]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/commitdiff
Added vi-mode bindings and set default to vi-mode.
authorHendrik Jaeger <jaeger@gyselroth.com>
Fri, 21 Nov 2014 09:51:38 +0000 (10:51 +0100)
committerHendrik Jaeger <jaeger@gyselroth.com>
Fri, 21 Nov 2014 09:51:38 +0000 (10:51 +0100)
Minor cleanup.
    modified:   .zsh_functions
    deleted:    .zshcomprc
    modified:   .zshrc

.zsh_functions
.zshcomprc [deleted file]
.zshrc

index abda777147f44189446655f167e2cb3e87bf739c..1d7cc9ad3ddafc50e2645ea0b44cb95e20f2e493 100644 (file)
@@ -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 (file)
index 9188550..0000000
+++ /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
diff --git a/.zshrc b/.zshrc
index 57ff1526174025cf7b9de900b446f93a13368215..a575e6c68d460d903c6dc4dd388cba4d8ac9a85e 100644 (file)
--- a/.zshrc
+++ b/.zshrc
@@ -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