~yerinalexey/dotfiles

ref: 8577e9749fa7fe80273e2b41122b441e994500e3 dotfiles/zsh/bindings.zsh -rw-r--r-- 945 bytes
8577e974Alexey Yerin qb: remove unused styles 5 months ago
                                                                                
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Key bindings and Vi mode

# Key bindings
## Word boundaries
WORDCHARS='*?[]~&!#$%^(){}<>'

## Enable vi mode
bindkey -v

## Fix backspace and delete
bindkey '^?' backward-delete-char
bindkey '^[[3~' delete-char

## S-Tab cycles backwards in completion menu
bindkey '^[[Z' reverse-menu-complete

## Bring C-u and C-w back!
bindkey '^U' kill-whole-line
bindkey '^W' backward-kill-word

## Allow using A-. to insert last word from previous command
bindkey '^[.' insert-last-word

## History navigation
bindkey '^[[A' up-line-or-search
bindkey '^K'   up-line-or-search

bindkey '^[[B' down-line-or-search
bindkey '^J'   down-line-or-search

## Clear scrollback
bindkey '^L' clear-screen

## Search shell history
function _accept_search_vi {
	zle accept-search
	zle vi-cmd-mode
}

zle -N _accept_search_vi

bindkey -M isearch '^[' _accept_search_vi
bindkey '^R' history-incremental-search-backward

# Vi mode
## Instantly react on ESC
KEYTIMEOUT=5