summaryrefslogtreecommitdiffstats
path: root/vimrcs/keys.vim
blob: 232249c61cf4db93f59a7ca59d3995e82cb7b75c (plain) (blame)
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
已复制!
map - dd " map H 0 map <silent> J :<C-u>exe "normal! ".v:count1*10."j"<CR> map <silent> K :<C-u>exe "normal! ".v:count1*10."k"<CR> " map L $ " nmap <leader>c <c-w><c-o> "关闭除当前窗口的所有页面 nmap <c-s> :w !sudo tee %<cr>L<cr> " nmap <leader>p <c-x><c-f> "补全路径 nmap <C-tab> :tabn<CR> nmap <tab> :tabp<CR> " map <space>= <buffer><esc>:vertical resize +5<cr> " map <space>- <esc>:vertical resize -5<cr> " 光标在页面间切换 nnoremap <Leader>h <C-w><C-h> nnoremap <Leader>j <C-w><C-j> nnoremap <Leader>k <C-w><C-k> nnoremap <Leader>l <C-w><C-l> " 复制粘贴 vnoremap <C-y> "+y nnoremap <C-p> "+p " 按下Ctrl+`时,使用:terminal打开终端,显示在当前窗口的下边 " nnoremap <C-`> :terminal<CR> " 各类符号自动匹配 :inoremap ( ()<ESC>i :inoremap ) <c-r>=ClosePair(')')<CR> :inoremap [ []<ESC>i :inoremap ] <c-r>=ClosePair(']')<CR> :inoremap { {}<ESC>i :inoremap } <c-r>=ClosePair('}')<CR> function ClosePair(char) if getline('.')[col('.') - 1] == a:char return "\<Right>" else return a:char endif endfunction