-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys.vim
135 lines (98 loc) · 2.22 KB
/
keys.vim
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
" copy and paste between system clipboard
if has('unnamedplus')
set clipboard+=unnamedplus
else
set clipboard+=unnamed " share windows clipboard
endif
" speed-up input
nnoremap ; :
if exists(':tnoremap')
" quick run and exit terminal
" exit to the Normal mode by <Esc><Esc>
tnoremap <Esc> <C-\><C-n>
endif
" new terminal in the current pane
nnoremap \t :e term://zsh<CR>i
" new terminal in a vertical split pane
nnoremap \tv <C-w>v<C-w>l :e term://zsh<CR>i
" new terminal in a horizontal split pane
nnoremap \ts <C-w>s<C-w>j :e term://zsh<CR>i
" quick navigation between splits
if exists(':tnoremap')
tnoremap <C-H> <C-\><C-n><C-W>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l
tnoremap <C-q> <C-\><C-n><C-w>c
tnoremap œ <C-\><C-n>:bd!<CR>:<backspace>
endif
" remap window navigation
nnoremap <C-H> <C-w>h
nnoremap <C-J> <C-w>j
nnoremap <C-K> <C-w>k
nnoremap <C-L> <C-w>l
" remap tab navigation
map <S-L> gt
map <S-H> gT
" remap buffer navigation
nmap ∆ :bp!<CR>:<backspace>
nmap ˚ :bn!<CR>:<backspace>
nmap љ :bn!<CR>:<backspace>
nmap œ :bd<CR>:<backspace>
nmap ∑ :Bclose<CR>:<backspace>
" remap split behavior
nnoremap <C-w>v <C-w>v<C-w>l
nnoremap <C-w>s <C-w>s<C-w>j
nnoremap \wo <C-w>o
nnoremap \wv <C-w>v<C-w>l
nnoremap \ws <C-w>s<C-w>j
nnoremap \wq :bd<CR>:<backspace>
nnoremap \ww :Bclose<CR>:<backspace>
" unsets search highlight by hitting return
nnoremap <silent> <Esc><Esc> :noh<CR> :call clearmatches()<CR>
" search selection text by //
vnoremap // y/<C-R>"<CR>
" scroll the viewport faster
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
set scrolloff=3
" shifting in visual mode
vnoremap < <gv
vnoremap > >gv
" improve naviation on wrapped lines
noremap j gj
noremap k gk
noremap о gj
noremap л gk
" yanks from cursor to the end of line
nnoremap Y y$
vnoremap Y y$
" delete symbols and strings
nnoremap x "_x
vnoremap x "_x
noremap X "_dd
vnoremap X "_dd
" fast horizontal scrolling
map zl zL
map zh zH
" Fix pressed Shift
cab W! w!
cab Q! q!
cab Wq wq
cab Wa wa
cab wQ wq
cab WQ wq
cab W w
cab Q q
" Fix russian layout
cab ц w
cab й q
cab Ц! w!
cab Й! q!
cab цй wq
cab Цй wq
cab Цф wa
cab цЙ wq
cab ЦЙ wq
cab Ц w
cab Й q