-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathkeymaps.vim
66 lines (52 loc) · 1.58 KB
/
keymaps.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
" Make Y yank the rest of the line (like with C and D)
nnoremap Y y$
" Word substitution on insert mode
imap <C-w> <C-o>dw
" NERDTree!
nmap <silent> <C-e> :NERDTreeToggle<CR>
" BufferExplorer
nmap <silent> <C-b> :BufExplorer<CR>
" Key mapping for tab navigation
nmap <Tab> gt
nmap <S-Tab> gT
" Clearing search results
nmap <silent> <C-l> :nohl<CR>
" Tabularize shortcuts
nmap <Leader>th :Tabularize /=><CR>
vmap <Leader>th :Tabularize /=><CR>
nmap <Leader>t= :Tabularize /=<CR>
vmap <Leader>t= :Tabularize /=<CR>
nmap <Leader>t: :Tabularize /:\zs<CR>
vmap <Leader>t: :Tabularize /:\zs<CR>
nmap <Leader>t, :Tabularize /,\zs<CR>
vmap <Leader>t, :Tabularize /,\zs<CR>
" Fugitive
nmap <silent> <F6> :Gstatus<CR>
" Whitespaces
nnoremap <silent> <F3> :call RemoveTraillingSpaces()<CR>
map <silent> <F4> mmgg=G'm
imap <silent> <F4> <Esc> mmgg=G'm
" Spell
map <silent> <F7> :set spell!<CR>
imap <silent> <F7> <Esc> :set spell!<CR>
nnoremap <leader>q :copen<CR>
nnoremap <leader>l :lopen<CR>
" Mapping selecting mappings
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
noremap <Leader>s :update<CR>
nnoremap <leader>j :Buffers<cr>
nnoremap <leader><C-p> :Files<cr>
nnoremap <leader><C-a> :GFiles?<cr>
nnoremap <C-p> :GFiles<cr>
nnoremap <leader>t :Tags<cr>
nnoremap <leader>T :BTags<cr>
noremap <Leader>w :tabnew<cr>
vmap <Leader>y "+y
nmap <Leader>p "+p