diff options
Diffstat (limited to 'plugin/maps.vim')
-rw-r--r-- | plugin/maps.vim | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/plugin/maps.vim b/plugin/maps.vim new file mode 100644 index 0000000..b61e994 --- /dev/null +++ b/plugin/maps.vim | |||
@@ -0,0 +1,58 @@ | |||
1 | mapclear | ||
2 | |||
3 | let mapleader=' ' | ||
4 | |||
5 | " clipboard | ||
6 | map <leader>cc :w !xclip -sel c<CR> | ||
7 | |||
8 | " normal | ||
9 | nnoremap <Leader>o : only<cr> | ||
10 | nnoremap - : b#<cr> | ||
11 | nnoremap <Leader>b : Buffers<cr> | ||
12 | nnoremap <Leader>n : bnext<cr> | ||
13 | nnoremap <Leader>p : bprev<cr> | ||
14 | nnoremap <Leader>z : FZF<cr> | ||
15 | nnoremap <Leader>l : Lines<cr> | ||
16 | nnoremap <Leader>e : Explore<cr> | ||
17 | nnoremap <Leader>t : call GetTabber()<cr> | ||
18 | nnoremap <Leader><ESC> : nohlsearch<cr> | ||
19 | nnoremap <C-l> :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l> | ||
20 | nnoremap H H:exec 'norm! '. &scrolloff . 'k'<cr> | ||
21 | nnoremap L L:exec 'norm! '. &scrolloff . 'j'<cr> | ||
22 | nnoremap <expr> gb '`[' . strpart(getregtype(), 0, 1) . '`]' | ||
23 | |||
24 | |||
25 | nnoremap <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' | ||
26 | \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" | ||
27 | \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR> | ||
28 | |||
29 | nnoremap <Leader>s <Plug>(leap-forward-to) | ||
30 | nnoremap <Leader>S <Plug>(leap-backward-to) | ||
31 | |||
32 | cmap w!! %!sudo -S tee > /dev/null % | ||
33 | |||
34 | " visual | ||
35 | vnoremap > >gv | ||
36 | vnoremap < <gv | ||
37 | vnoremap <silent> * :<C-U> | ||
38 | \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR> | ||
39 | \gvy/<C-R>=&ic?'\c':'\C'<CR><C-R><C-R>=substitute( | ||
40 | \escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR> | ||
41 | \gVzv:call setreg('"', old_reg, old_regtype)<CR> | ||
42 | vnoremap <silent> # :<C-U> | ||
43 | \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR> | ||
44 | \gvy?<C-R>=&ic?'\c':'\C'<CR><C-R><C-R>=substitute( | ||
45 | \escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR> | ||
46 | \gVzv:call setreg('"', old_reg, old_regtype)<CR> | ||
47 | |||
48 | " operator-pending | ||
49 | onoremap ax a` | ||
50 | onoremap ix i` | ||
51 | |||
52 | " visual block | ||
53 | xnoremap + g<C-a> | ||
54 | xnoremap - g<C-x> | ||
55 | |||
56 | " completions | ||
57 | inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | ||
58 | inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" | ||