forked from viroulep/configFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zsh_zle
32 lines (27 loc) · 817 Bytes
/
.zsh_zle
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
30
31
#Use vim keybindings
bindkey -v
#Custom prompt for line-editing
function zle-line-init zle-keymap-select {
RPSTMP="${${KEYMAP/vicmd/${RPS1_CMD}}/(main|viins)/${RPS1_INS}}"
RPS1=$RPSTMP
zle reset-prompt
}
#Load custom line editing
zle -N zle-line-init
zle -N zle-keymap-select
#Ctrl+left/right is back !
bindkey ';5D' backward-word
bindkey ';5C' forward-word
bindkey '^H' backward-delete-char
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line
bindkey -v '^R' history-incremental-search-backward
bindkey -v '\b' backward-delete-char
bindkey -v '^?' backward-delete-char
bindkey -v "^[[3~" delete-char
bindkey -v "jj" vi-cmd-mode
bindkey -a 'gg' beginning-of-buffer-or-history
bindkey -a G end-of-buffer-or-history
bindkey -a u undo
bindkey -a '^R' redo
bindkey -a '\ ' vi-history-search-backward