-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvimrc.map
More file actions
155 lines (130 loc) · 4.71 KB
/
vimrc.map
File metadata and controls
155 lines (130 loc) · 4.71 KB
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
let mapleader = "\<Space>"
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
nmap <Leader>p "+p
map <C-p> :FZF<CR>
map <C-b> :BLines<CR>
map <C-g> :GitFiles<CR>
map <Leader>t :BTags<CR>
map <Leader>a :Ag<CR>
let g:fzf_action = {
\ 'ctrl-j': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit'
\ }
" More accessible command line prompt
nmap , :
" Map C-s to save the file
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR>
map <C-n> :NERDTreeToggle<CR>
" bind K to grep word under cursor
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
" bind \ (backward slash) to grep shortcut
" command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :GrepperAg<SPACE>
map ç :ccl <CR>
map <F2> :Copen <CR>
" Delete the current file
nnoremap <C-Del> :call delete(expand('%'))<CR>
" vim-surround mappings
let g:surround_no_mappings = 1
nmap ds <Plug>Dsurround
nmap hs <Plug>Csurround
nmap ys <Plug>Ysurround
nmap yS <Plug>YSurround
nmap yss <Plug>Yssurround
nmap ySs <Plug>YSsurround
nmap ySS <Plug>YSsurround
xmap S <Plug>VSurround
xmap gS <Plug>VgSurround
if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-S>","i")
imap <C-S> <Plug>Isurround
endif
imap <C-G>s <Plug>Isurround
imap <C-G>S <Plug>ISurround
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprevious<CR>
" Kill the current buffer without closing the corresponding split
nnoremap <C-X> :BD<CR>
" More accessible (on bépo keyboard) Jump to Tag
nnoremap <C-J> <C-]>
" CtrlP Mappings
let g:ctrlp_prompt_mappings = {
\ 'PrtBS()': ['<bs>', '<c-]>'],
\ 'PrtDelete()': ['<del>'],
\ 'PrtDeleteWord()': ['<c-w>'],
\ 'PrtClear()': ['<c-u>'],
\ 'PrtSelectMove("j")': ['<c-t>', '<down>'],
\ 'PrtSelectMove("k")': ['<c-s>', '<up>'],
\ 'PrtSelectMove("t")': ['<Home>', '<kHome>'],
\ 'PrtSelectMove("b")': ['<End>', '<kEnd>'],
\ 'PrtSelectMove("u")': ['<PageUp>', '<kPageUp>'],
\ 'PrtSelectMove("d")': ['<PageDown>', '<kPageDown>'],
\ 'PrtHistory(-1)': ['<c-n>'],
\ 'PrtHistory(1)': ['<c-p>'],
\ 'AcceptSelection("e")': ['<cr>', '<2-LeftMouse>'],
\ 'AcceptSelection("h")': ['<c-x>', '<c-cr>'],
\ 'AcceptSelection("t")': ['<c-w>'],
\ 'AcceptSelection("v")': ['<c-v>', '<RightMouse>'],
\ 'ToggleFocus()': ['<s-tab>'],
\ 'ToggleRegex()': ['<c-r>'],
\ 'ToggleByFname()': ['<c-d>'],
\ 'ToggleType(1)': ['<c-f>', '<c-up>'],
\ 'ToggleType(-1)': ['<c-b>', '<c-down>'],
\ 'PrtExpandDir()': ['<tab>'],
\ 'PrtInsert("c")': ['<MiddleMouse>', '<insert>'],
\ 'PrtInsert()': ['<c-\>'],
\ 'PrtCurStart()': ['<c-a>'],
\ 'PrtCurEnd()': ['<c-e>'],
\ 'PrtCurLeft()': ['<c-h>', '<left>', '<c-^>'],
\ 'PrtCurRight()': ['<c-l>', '<right>'],
\ 'PrtClearCache()': ['<F5>'],
\ 'PrtDeleteEnt()': ['<F7>'],
\ 'CreateNewFile()': ['<c-y>'],
\ 'MarkToOpen()': ['<c-z>'],
\ 'OpenMulti()': ['<c-o>'],
\ 'PrtExit()': ['<esc>', '<c-c>', '<c-g>'],
\ }
nmap <leader>gf :execute 'edit ' . input('folder ? ') . '/' . expand('<cfile>')<cr>
" NERDTree Mapping
let g:NERDTreeMapJumpNextSibling = '<C-S>'
let g:NERDTreeMapJumpPrevSibling = '<C-T>'
let g:NERDTreeMapJumpFirstChild = 'S'
let g:NERDTreeMapJumpLastChild = 'T'
let g:NERDTreeMapOpenVSplit = 'v'
let g:NERDTreeMapOpenInTab = 'k'
nmap <Leader>n :NERDTreeFind<CR>
let g:AutoPairsShortcutToggle = 'C-E'
" always move cursor to the last line of yanked block
vmap y y`]
" EasyMotion mappings
map f <Plug>(easymotion-f)
map F <Plug>(easymotion-bd-f)
map <Leader>é <Plug>(easymotion-w)
map <Leader>É <Plug>(easymotion-bd-w)
map <Leader>l <Plug>(easymotion-bd-jk)
map <Leader>/ <Plug>(easymotion-sn)
omap <Leader>/ <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<c-space>"
let g:AutoPairsShortcutToggle = '<C-K>'
map <Leader>f :ClangFormat<CR>
" Neocomplete mappings
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
endfunction
inoremap <expr><C-t> pumvisible() ? "\<C-n>" : "\<C-t>"
inoremap <expr><C-s> pumvisible() ? "\<C-p>" : "\<C-s>"
"inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS>