Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
Created July 21, 2016 17:13
Show Gist options
  • Save gilbertw1/20aa14bf2f56da699bb39752ccf21b66 to your computer and use it in GitHub Desktop.
Save gilbertw1/20aa14bf2f56da699bb39752ccf21b66 to your computer and use it in GitHub Desktop.
zsh vim mode settings
# Enable VIM Mode
bindkey -v
# Remove Mode Change Delay
export KEYTIMEOUT=1
# Add Some Emacs Keybindings
bindkey '^p' up-history
bindkey '^n' down-history
bindkey '^w' backward-kill-word
bindkey '^f' autosuggest-accept
bindkey '^u' backward-kill-line
bindkey '^a' beginning-of-line
bindkey '^e' end-of-line
# Fix ESC-/ Chord (Perform Search)
vi-search-fix() {
zle vi-cmd-mode
zle .vi-history-search-backward
}
autoload vi-search-fix
zle -N vi-search-fix
bindkey -M viins '\e/' vi-search-fix
# Fix Backspace
bindkey "^?" backward-delete-char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment