summaryrefslogtreecommitdiff
path: root/plugin/maps.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/maps.vim')
-rw-r--r--plugin/maps.vim58
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 @@
1mapclear
2
3let mapleader=' '
4
5" clipboard
6map <leader>cc :w !xclip -sel c<CR>
7
8" normal
9nnoremap <Leader>o : only<cr>
10nnoremap - : b#<cr>
11nnoremap <Leader>b : Buffers<cr>
12nnoremap <Leader>n : bnext<cr>
13nnoremap <Leader>p : bprev<cr>
14nnoremap <Leader>z : FZF<cr>
15nnoremap <Leader>l : Lines<cr>
16nnoremap <Leader>e : Explore<cr>
17nnoremap <Leader>t : call GetTabber()<cr>
18nnoremap <Leader><ESC> : nohlsearch<cr>
19nnoremap <C-l> :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
20nnoremap H H:exec 'norm! '. &scrolloff . 'k'<cr>
21nnoremap L L:exec 'norm! '. &scrolloff . 'j'<cr>
22nnoremap <expr> gb '`[' . strpart(getregtype(), 0, 1) . '`]'
23
24
25nnoremap <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
29nnoremap <Leader>s <Plug>(leap-forward-to)
30nnoremap <Leader>S <Plug>(leap-backward-to)
31
32cmap w!! %!sudo -S tee > /dev/null %
33
34" visual
35vnoremap > >gv
36vnoremap < <gv
37vnoremap <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>
42vnoremap <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
49onoremap ax a`
50onoremap ix i`
51
52" visual block
53xnoremap + g<C-a>
54xnoremap - g<C-x>
55
56" completions
57inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
58inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"