diff options
author | Timmy Keller <tjk@tjkeller.xyz> | 2021-07-07 15:21:45 -0500 |
---|---|---|
committer | Timmy Keller <tjk@tjkeller.xyz> | 2021-07-07 15:21:45 -0500 |
commit | 3764b268dbeaa95a8d4b2da8d4433eab75ad8478 (patch) | |
tree | 7c0db4481dfa7c4369f3db355056703cbe442072 /zsh/keybindrc | |
download | dotconfig-3764b268dbeaa95a8d4b2da8d4433eab75ad8478.tar.xz dotconfig-3764b268dbeaa95a8d4b2da8d4433eab75ad8478.zip |
dotfiles
Diffstat (limited to 'zsh/keybindrc')
-rwxr-xr-x | zsh/keybindrc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/zsh/keybindrc b/zsh/keybindrc new file mode 100755 index 0000000..56d8a6c --- /dev/null +++ b/zsh/keybindrc @@ -0,0 +1,47 @@ +#!/bin/zsh + +# Vi mode + requirements for ALL keybindings to work correctly +bindkey -v +export KEYTIMEOUT=1 + +# Keybinding functions + #function name #function #description +autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer + +# Unbind some default keybindings +bindkey -r "^U" "^V" "^W" "^G" "^J" "^Q" "^R" "^[[200~" + +# Keybindings + #key #command #description +bindkey "^E" edit-command-line # Ctrl-e to edit line in Vim buffer +bindkey "^D" kill-whole-line # Ctrl-d to delete line +bindkey "^X" clear-screen # Ctrl-x to clear screen +bindkey "^[[H" beginning-of-line # Home Key +bindkey "^[[4~" end-of-line # End Key +bindkey "^[[P" delete-char # Delete Key +bindkey "^[[4h" overwrite-mode # Insert Key +bindkey "^[[1;5D" emacs-backward-word # Ctrl-Right to go back one word +bindkey "^[[1;5C" emacs-forward-word # Ctrl-Left to go forward one word +bindkey "^[[1;3D" emacs-backward-word # Alt-Right to go back one word +bindkey "^[[1;3C" emacs-forward-word # Alt-Left to go forward one word +bindkey "^[[5~" emacs-backward-word # PgUp to go back one word +bindkey "^[[6~" emacs-forward-word # PgDn to go forward one word +bindkey "^H" backward-delete-word # Ctrl-Backspace to delete entire word behind cursor +bindkey "^[[M" delete-word # Ctrl-Delete to delete currect word in front of the cursor + +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files. + +# Use Vim keys in tab complete menu +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -v '^?' backward-delete-char + +# Ignore ctrl-d to exit shell +setopt ignore_eof |