Revisão | 5b3593364c3368d5087afaea1763119f844c7d1b (tree) |
---|---|
Hora | 2023-01-12 19:10:38 |
Autor | badcoff33 <none@none> |
Commiter | badcoff33 |
lots of remapping
@@ -120,9 +120,7 @@ command! ShowChanges vert new | set bt=nofile | r ++edit # | 0d_ | diffthis | wi | ||
120 | 120 | " Switching modes |
121 | 121 | inoremap <Ins> <Esc> |
122 | 122 | inoremap <k0> <Esc> |
123 | -inoremap <C-Space> <Esc> | |
124 | -noremap! <A-Space> <Esc>: | |
125 | -xnoremap <A-Space> : | |
123 | +inoremap <A-Space> <Esc> | |
126 | 124 | |
127 | 125 | " Consistent cursor movement |
128 | 126 | noremap! <A-Left> <Home> |
@@ -130,14 +128,14 @@ noremap! <A-Right> <End> | ||
130 | 128 | xnoremap <A-Left> 0 |
131 | 129 | xnoremap <A-Right> $ |
132 | 130 | |
133 | -" Use the minus key for something useful | |
134 | -nnoremap - : | |
135 | - | |
136 | 131 | " Replace current inner word with one key press |
137 | 132 | nnoremap <BS> ciw |
138 | - | |
133 | +" Delete word before cursor | |
134 | +inoremap <A-BS> <C-w> | |
139 | 135 | " Yank more consistent to D and dd commands |
140 | 136 | nnoremap Y y$ |
137 | +" Yank word under cursor | |
138 | +nnoremap <C-Insert> yiw | |
141 | 139 | |
142 | 140 | " Resizing window |
143 | 141 | let GrowWin = { -> "3wincmd + | 5wincmd >" } |
@@ -145,9 +143,6 @@ let ShrinkWin = { -> winnr("j")==winnr() ? "5wincmd <" : "3wincmd - | 5wincmd <" | ||
145 | 143 | nnoremap <A-+> :<C-r>=GrowWin()<CR><CR> |
146 | 144 | nnoremap <A--> :<C-r>=ShrinkWin()<CR><CR> |
147 | 145 | |
148 | -" Yank word under cursor | |
149 | -nnoremap <C-Insert> yiw | |
150 | - | |
151 | 146 | " increment/decrement numbers blockwise |
152 | 147 | vnoremap <C-x> <C-x>gv |
153 | 148 | vnoremap <C-a> <C-a>gv |
@@ -170,13 +165,10 @@ vnoremap <A-e> :move '<-2<CR>==gv=gv | ||
170 | 165 | nnoremap <A-o> :bprevious<CR> |
171 | 166 | nnoremap <A-i> :bnext<CR> |
172 | 167 | |
173 | -nnoremap <silent> + <cmd>FF<CR> | |
174 | -nnoremap <silent> - <cmd>FR<CR> | |
175 | - | |
176 | 168 | " command line abbreviations |
177 | 169 | let FilePath = { -> expand("%:h") == "" ? "" : expand("%:h") .. g:slash } |
178 | 170 | cnoremap <expr> <A-.> (FilePath() == ".") ? "." : FilePath() |
179 | -cnoremap <expr> <A-,> $USERPROFILE .. g:slash .. 'vimfiles' .. g:slash | |
171 | +cnoremap <expr> <A-,> $HOME .. g:slash .. 'vimfiles' .. g:slash | |
180 | 172 | cnoreabbrev <expr> vimgrep (getcmdtype() ==# ':' && getcmdline() =~# '^vimgrep') ? 'silent vimgrep' : 'vimgrep' |
181 | 173 | cnoreabbrev <expr> grep (getcmdtype() ==# ':' && getcmdline() =~# '^grep') ? 'silent grep' : 'grep' |
182 | 174 | cnoreabbrev <expr> make (getcmdtype() ==# ':' && getcmdline() =~# '^make') ? 'silent make' : 'make' |
@@ -248,16 +240,14 @@ nnoremap <Leader>s :%s/<C-r><C-w>//gI<Left><Left><Left> | ||
248 | 240 | vnoremap <Leader>s :s///gI<Left><Left><Left><Left> |
249 | 241 | |
250 | 242 | " commands |
251 | -nnoremap <Leader>e :edit<Space> | |
252 | 243 | nnoremap <Leader>, :edit <C-r>=$HOME .. g:slash .. 'vimfiles' .. g:slash<CR> |
253 | 244 | nnoremap <Leader>. :edit <C-r>=(FilePath() == ".") ? "." : FilePath()<CR> |
245 | +nnoremap <Leader>t <cmd>tab split<CR> | |
246 | +nnoremap <Leader>e :edit<Space> | |
254 | 247 | nnoremap <Leader>f :find * |
255 | 248 | nnoremap <Leader>b :buffer<Space> |
256 | -nnoremap <Leader>t :tjump / | |
257 | -nnoremap <Leader>x :Lexplore<Space> | |
258 | -nnoremap <Leader><Tab> <cmd>tabnew<CR> | |
259 | 249 | |
260 | -" quickfix | |
250 | +" Toggle the quickfix window | |
261 | 251 | function! s:ToggleQuickfix() |
262 | 252 | let is_open = v:false |
263 | 253 | windo if &buftype== "quickfix" | let is_open = v:true | endif |
@@ -279,13 +269,12 @@ function! s:ToggleQuickfix() | ||
279 | 269 | endif |
280 | 270 | endif |
281 | 271 | endfunction |
282 | -nnoremap @ <cmd>call <SID>ToggleQuickfix()<CR> | |
283 | -nnoremap <Leader>g <cmd>cfirst<CR> | |
284 | -nnoremap <Leader>G <cmd>clast<CR> | |
272 | +nnoremap <A-Space> <cmd>call <SID>ToggleQuickfix()<CR> | |
273 | +nnoremap <A-g> <cmd>clast<CR> | |
285 | 274 | |
286 | 275 | let g:ft2glob = { 'c':'*.[ch]$', 'vim':'*.vim', 'py':'*.py$', 'cmake':'*cmake*' } |
287 | 276 | let LsFilter = { ft -> has_key(g:ft2glob, ft) ? g:ft2glob[ft] : '*.*'} |
288 | -nnoremap <expr> <Leader>v ':silent vimgrep /'..expand("<cword>")..'/ '..expand("%:h")..g:slash..LsFilter(&ft) | |
277 | +nnoremap <expr> <Leader>g ':silent vimgrep /'..expand("<cword>")..'/ '..expand("%:h")..g:slash..LsFilter(&ft) | |
289 | 278 | |
290 | 279 | command! -nargs=0 IC :set ignorecase nosmartcase |
291 | 280 | command! -nargs=0 CS :set noignorecase nosmartcase |