-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFitKeyRaw.vim
242 lines (169 loc) · 5.82 KB
/
FitKeyRaw.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs {
""
" https://github.com/liuchengxu/space-vim/wiki/Loading-process
" https://github.com/liuchengxu/space-vim/blob/master/layers/LAYERS.md
""
""" Tail: Docs }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Orignal {
""
" https://github.com/liuchengxu/space-vim/blob/master/core/autoload/spacevim/map/leader.vim
" https://github.com/liuchengxu/space-vim/blob/master/core/autoload/spacevim/map/localleader.vim
" https://github.com/liuchengxu/space-vim/blob/master/layers/%2Bdistributions/better-defaults/keybindings.vim
""
""" Tail: Orignal }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Option {
""
" ## for close
"set confirm
" ## :help 'autoread'
"set autoread
" ## for only and tabonly
"set hidden
" ## add <Bslash> WhichKey Tips. (for \)
"nnoremap <silent> <Bslash> :<c-u>WhichKey '<Bslash>'<CR>
""
""" Tail: Option }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Quit {
""
" ## delete buffer
nnoremap <Bslash>q :q<CR>
nnoremap <Bslash>x :qa<CR>
nnoremap <Bslash>z :q!<CR>
nnoremap <Bslash>c :qa!<CR>
" ## quit
nnoremap ,q :bdelete<CR>
nnoremap ,x :%bdelete<CR>
nnoremap ,z :bdelete!<CR>
nnoremap ,c :%bdelete!<CR>
""
""" Tail: Quit }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Buffer {
""
" ## switch buffer
nnoremap <C-k> :bprevious<CR>
nnoremap <C-j> :bnext<CR>
"nnoremap <C-Up> :bprevious<CR>
"nnoremap <C-Down> :bnext<CR>
" https://github.com/liuchengxu/space-vim/blob/master/layers/%2Bdistributions/better-defaults/keybindings.vim
" ## list buffer
nnoremap ,b :ls<CR>
"nnoremap ,b :buffers<CR>
"nnoremap ,b :files<CR>
" ## save
"nnoremap ,s :w<CR>
nnoremap <S-Tab> :w<CR>
inoremap <S-Tab> <Esc>:w<CR>a
""
""" Tail: Buffer }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Window {
""
"" ## switch window
" ## use <Tab> or <C-i>
nnoremap <Tab> <C-w>w
nnoremap <BS> <C-w>W
" ## current window only
"nnoremap ,wa <C-w>o
nnoremap ,wa :only<CR>
" ## hide
nnoremap ,h :hide<CR>
" ## resize window
" :help window-resize
nnoremap <S-Down> <C-w>-
nnoremap <S-Up> <C-w>+
nnoremap <S-Left> <C-w><
nnoremap <S-Right> <C-w>>
""
""" Tail: Window }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: TabPage {
""
" ## <Space><Space> " for tabpage leader
" ## switch next or previous
" default gT for tabprevious
" default gt for tabnext
" default <C-PageUp> for tabprevious. but terminal switch tab
" default <C-PageDown> for tabnext. but terminal switch tab
nnoremap <Space><Space>p :tabprevious<CR>
nnoremap <Space><Space>n :tabnext<CR>
nnoremap <Space><Space>h :tabprevious<CR>
nnoremap <Space><Space>l :tabnext<CR>
"nnoremap <C-Left> :tabprevious<CR>
"nnoremap <C-Right> :tabnext<CR>
nnoremap <C-h> :tabprevious<CR>
nnoremap <C-l> :tabnext<CR>
" for orignal <C-l>
nnoremap ,u :redraw<CR>
" https://github.com/liuchengxu/space-vim/blob/master/layers/%2Bdistributions/better-defaults/keybindings.vim
" ## switch to first or last
nnoremap <Space><Space>j :tabfirst<CR>
nnoremap <Space><Space>k :tablast<CR>
" https://github.com/liuchengxu/space-vim/blob/master/core/autoload/spacevim/map/leader.vim#L12
" ## switch to 1~10
" nnoremap <Space><Space>1 1gt
" nnoremap <Space><Space>2 2gt
" nnoremap <Space><Space>3 3gt
" nnoremap <Space><Space>4 4gt
" nnoremap <Space><Space>5 5gt
" nnoremap <Space><Space>6 6gt
" nnoremap <Space><Space>7 7gt
" nnoremap <Space><Space>8 8gt
" nnoremap <Space><Space>9 9gt
" nnoremap <Space><Space>0 10gt
" ## move left or right
" tab move left
nnoremap <Space><Space>u :-tabmove<CR>
" tab move right
nnoremap <Space><Space>i :+tabmove<CR>
" tab move left
nnoremap <Space><Space>mh :-tabmove<CR>
" tab move right
nnoremap <Space><Space>ml :+tabmove<CR>
" ## move to first or last
nnoremap <Space><Space>mj :0tabmove<CR>
nnoremap <Space><Space>mk :$tabmove<CR>
" ## n tabmove
nnoremap <Space><Space>m0 :0tabmove<CR>
nnoremap <Space><Space>m1 :1tabmove<CR>
nnoremap <Space><Space>m2 :2tabmove<CR>
nnoremap <Space><Space>m3 :3tabmove<CR>
nnoremap <Space><Space>m4 :4tabmove<CR>
nnoremap <Space><Space>m5 :5tabmove<CR>
nnoremap <Space><Space>m6 :6tabmove<CR>
nnoremap <Space><Space>m7 :7tabmove<CR>
nnoremap <Space><Space>m8 :8tabmove<CR>
nnoremap <Space><Space>m9 :9tabmove<CR>
" ## open current window to new tabpage
nnoremap <Space><Space>s :tab split<CR>
" ## new tabpage or close
nnoremap <Space><Space>t :tabnew<CR>
nnoremap <Space><Space>e :tabedit<Space>
nnoremap <Space><Space>f :tabnew<CR>:edit<Space>
" space-vim default
"nnoremap <Space><Space>c :tabclose<CR>
" ## quit all
"nnoremap <Space><Space>qa :qa!<CR>
" ## close other tabpage
" use <Space><Space>wa to close other tabpage, then all buffer will hide, if set hidden.
nnoremap <Space><Space>wa :tabonly<CR>
" Note:
" use ,c to delete all buffer, then all tapage will close.
" use ,wa to close other window, then all buffer will hide, if set hidden.
" use ,h to hide current buffer, then current tapage will close.
" ## show help page on new tab
"nnoremap tb :tabnew<CR>:help<CR><C-w>w:quit!<CR><Esc>
nnoremap <Space><Space>b :tab help<CR>
""
""" Tail: TabPage }
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""