diff options
author | Yigit Sever | 2021-04-04 16:30:21 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-04 16:34:03 +0300 |
commit | 1ec805a894967a12ebde3feba26fdc8151935e80 (patch) | |
tree | c77b6124a71a7fefd40e2538752e3fc5e94dbd5f /.config/nvim | |
parent | 492beee94b196ddb887088848cb28fb1d79d5697 (diff) | |
download | dotfiles-1ec805a894967a12ebde3feba26fdc8151935e80.tar.gz dotfiles-1ec805a894967a12ebde3feba26fdc8151935e80.tar.bz2 dotfiles-1ec805a894967a12ebde3feba26fdc8151935e80.zip |
vimrc: format & style changes
Diffstat (limited to '.config/nvim')
-rwxr-xr-x | .config/nvim/init.vim | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d077acc..c4f54b8 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim | |||
@@ -249,6 +249,8 @@ let g:yoinkIncludeDeleteOperations = 1 | |||
249 | 249 | ||
250 | " Tab stuff | 250 | " Tab stuff |
251 | set autoindent | 251 | set autoindent |
252 | |||
253 | " :h tabstop, 2. point | ||
252 | " Use appropriate number of spaces to insert a <Tab> | 254 | " Use appropriate number of spaces to insert a <Tab> |
253 | set expandtab | 255 | set expandtab |
254 | set shiftwidth=4 | 256 | set shiftwidth=4 |
@@ -324,9 +326,12 @@ let g:moonflyUndercurls = 0 | |||
324 | " Save file as sudo on files that require root permission | 326 | " Save file as sudo on files that require root permission |
325 | cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! | 327 | cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! |
326 | 328 | ||
327 | " Replace ex mode with gq | 329 | " replace ex mode with gq |
328 | map Q gq | 330 | map Q gq |
329 | 331 | ||
332 | " set formatprg to sentences, for prose | ||
333 | map \fp :set formatprg=~/.local/bin/sentences<CR> | ||
334 | |||
330 | " Replace all is aliased to S. | 335 | " Replace all is aliased to S. |
331 | nnoremap S :%s//g<Left><Left> | 336 | nnoremap S :%s//g<Left><Left> |
332 | 337 | ||
@@ -342,6 +347,9 @@ tnoremap <C-l> <C-\><C-n><C-w>l | |||
342 | " call CreatePaper on word below cursor | 347 | " call CreatePaper on word below cursor |
343 | nnoremap <leader>np gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand('<cword>'))<CR> | 348 | nnoremap <leader>np gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand('<cword>'))<CR> |
344 | 349 | ||
350 | " link paper | ||
351 | nnoremap <leader>lp gewi[[/papers/<ESC>Ea]]<ESC> | ||
352 | |||
345 | " call CreateReference on word below cursor | 353 | " call CreateReference on word below cursor |
346 | nnoremap <leader>nr :call CreateReference(expand('<cword>'))<CR> | 354 | nnoremap <leader>nr :call CreateReference(expand('<cword>'))<CR> |
347 | 355 | ||
@@ -359,7 +367,7 @@ nnoremap <silent> <F4> :NERDTreeToggle<CR> | |||
359 | " Fix whole buffer via ALE | 367 | " Fix whole buffer via ALE |
360 | nmap <F9> <Plug>(ale_fix) | 368 | nmap <F9> <Plug>(ale_fix) |
361 | 369 | ||
362 | " these "Ctrl mappings" work well when Caps Lock is mapped to Ctrl | 370 | " vim-test bindings |
363 | nmap <silent> t<C-n> :TestNearest<CR> | 371 | nmap <silent> t<C-n> :TestNearest<CR> |
364 | nmap <silent> t<C-f> :TestFile<CR> | 372 | nmap <silent> t<C-f> :TestFile<CR> |
365 | nmap <silent> t<C-s> :TestSuite<CR> | 373 | nmap <silent> t<C-s> :TestSuite<CR> |
@@ -367,7 +375,7 @@ nmap <silent> t<C-l> :TestLast<CR> | |||
367 | nmap <silent> t<C-g> :TestVisit<CR> | 375 | nmap <silent> t<C-g> :TestVisit<CR> |
368 | 376 | ||
369 | " Edit vimrc \ev | 377 | " Edit vimrc \ev |
370 | nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> | 378 | nnoremap <silent> <leader>ev :tabnew<CR>:e ~/.config/nvim/init.vim<CR> |
371 | " jump to buffer | 379 | " jump to buffer |
372 | nnoremap <leader>b :ls<cr>:b<space> | 380 | nnoremap <leader>b :ls<cr>:b<space> |
373 | 381 | ||
@@ -384,14 +392,14 @@ nnoremap <C-h> <C-w>h | |||
384 | nnoremap <C-l> <C-w>l | 392 | nnoremap <C-l> <C-w>l |
385 | 393 | ||
386 | " Disable highlight when <leader><cr> is pressed | 394 | " Disable highlight when <leader><cr> is pressed |
387 | nnoremap <silent> <Leader><cr> :noh<cr> | 395 | nnoremap <silent> <leader><cr> :noh<cr> |
388 | " Space used to toggle folds, now it's x (because x is d) | 396 | " Space used to toggle folds, now it's x (because x is d) |
389 | nnoremap <space> "_x | 397 | nnoremap <space> "_x |
390 | 398 | ||
391 | " checkmarks on vimwiki | 399 | " checkmarks on vimwiki |
392 | nmap <Leader>v <Plug>VimwikiToggleListItem | 400 | nmap <leader>v <Plug>VimwikiToggleListItem |
393 | " add/increase header level | 401 | " add/increase header level |
394 | nmap <Leader>a <Plug>VimwikiAddHeaderLevel | 402 | nmap <leader>a <Plug>VimwikiAddHeaderLevel |
395 | 403 | ||
396 | " sneak using grave, s is for sandwich | 404 | " sneak using grave, s is for sandwich |
397 | nmap ` <Plug>Sneak_s | 405 | nmap ` <Plug>Sneak_s |
@@ -419,7 +427,7 @@ xmap <leader>s <plug>(SubversiveSubstituteRange) | |||
419 | nmap <leader>ss <plug>(SubversiveSubstituteWordRange) | 427 | nmap <leader>ss <plug>(SubversiveSubstituteWordRange) |
420 | 428 | ||
421 | " subvert over range | 429 | " subvert over range |
422 | nmap <leader><Leader>s <plug>(SubversiveSubvertRange) | 430 | nmap <leader><leader>s <plug>(SubversiveSubvertRange) |
423 | xmap <leader><leader>s <plug>(SubversiveSubvertRange) | 431 | xmap <leader><leader>s <plug>(SubversiveSubvertRange) |
424 | nmap <leader><leader>ss <plug>(SubversiveSubvertWordRange) | 432 | nmap <leader><leader>ss <plug>(SubversiveSubvertWordRange) |
425 | 433 | ||
@@ -429,8 +437,8 @@ nmap <c-p> <plug>(YoinkPostPasteSwapForward) | |||
429 | 437 | ||
430 | " change into pwd of current directory | 438 | " change into pwd of current directory |
431 | nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> | 439 | nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> |
432 | inoremap <silent> <Leader>fn <C-R>=expand("%:t:r")<CR> | 440 | inoremap <silent> <leader>fn <C-R>=expand("%:t:r")<CR> |
433 | nnoremap <silent> <Leader>fn :put! =expand('%:t:r')<CR> | 441 | nnoremap <silent> <leader>fn :put! =expand('%:t:r')<CR> |
434 | 442 | ||
435 | " press \g and start writing prose | 443 | " press \g and start writing prose |
436 | map <leader>g :Goyo<CR> | 444 | map <leader>g :Goyo<CR> |
@@ -556,6 +564,8 @@ let g:beacon_shrink = 0 | |||
556 | highlight Beacon guibg=red ctermbg=15 | 564 | highlight Beacon guibg=red ctermbg=15 |
557 | " }}} beacon " | 565 | " }}} beacon " |
558 | 566 | ||
567 | " thesaurus_query {{{ " | ||
559 | let g:tq_enabled_backends = ["mthesaur_txt"] | 568 | let g:tq_enabled_backends = ["mthesaur_txt"] |
560 | let g:tq_truncation_on_relavance = 0 | 569 | let g:tq_truncation_on_relavance = 0 |
570 | " }}} thesaurus_query " | ||
561 | 571 | ||