summaryrefslogtreecommitdiff
path: root/zsh/zscripts/keybindrc.zsh
blob: 5e6ee83083f0a8ec30d6b911e1db5b71805b1e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env zsh

# Vi mode + requirements for ALL keybindings to work correctly
bindkey -v # Select viins keymap
KEYTIMEOUT=1

# Keybindings
autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
bindkey '^E'	edit-command-line 	# Ctrl-e - edit line in Vim buffer

bindkey '^[[P'	delete-char 		# Delete Key
bindkey '^[[4~' end-of-line		# End Key
bindkey '^[[H'	beginning-of-line 	# Home Key
bindkey '^[[4h'	overwrite-mode		# Insert Key
bindkey '^D'	kill-whole-line 	# Ctrl-d - delete line
bindkey '^X'	clear-screen	 	# Ctrl-x - clear screen
bindkey '^H'	backward-delete-word	# Ctrl-Backspace - delete entire word behind cursor
bindkey '^[[M'	delete-word		# Ctrl-Delete - delete currect word in front of the cursor
# History completion
bindkey '\e[A'	history-search-backward	# Up arrow - seach history backwards
bindkey '\e[B'	history-search-forward	# Down arrow - seach history forwards
# Ctrl-vi keys emulate arrow keys
#bindkey '^L'	emacs-forward-word	# Ctrl-H - go forward one word
#bindkey '^J'	history-search-forward	# Ctrl-J - seach history backwards
#bindkey '^K'	history-search-backward	# Ctrl-K - seach history forwards
#bindkey '^H'	emacs-backward-word 	# Ctrl-L - go back one word

# Ignore ctrl-d to exit shell
setopt IGNORE_EOF