summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorYigit Sever2020-10-29 17:17:46 +0300
committerYigit Sever2020-10-29 17:17:46 +0300
commit1679d1e03ca979c896938bdcb37cc0f28048ceb3 (patch)
treed07d1c4cfad65fc890186fd032193bb2b6521d08 /.config/nvim
parent23ebe8253b7baebd66f3d59e73773452809f2432 (diff)
downloaddotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.tar.gz
dotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.tar.bz2
dotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.zip
steal some nifty things from lukesmith
Diffstat (limited to '.config/nvim')
-rwxr-xr-x.config/nvim/init.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 40824b0..6ce39e4 100755
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -56,6 +56,8 @@ Plug 'vim-airline/vim-airline'
56Plug 'vim-airline/vim-airline-themes' 56Plug 'vim-airline/vim-airline-themes'
57" undo tree visualizer 57" undo tree visualizer
58Plug 'mbbill/undotree' 58Plug 'mbbill/undotree'
59" preview colours in source code
60Plug 'ap/vim-css-color'
59 61
60" }}} heresy " 62" }}} heresy "
61 63
@@ -164,8 +166,18 @@ autocmd FileType markdown,tex setlocal spell
164 166
165autocmd FileType rust let b:dispatch = 'cargo run' 167autocmd FileType rust let b:dispatch = 'cargo run'
166 168
169" these files are formatted not with textwidth but into sentences
167autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences 170autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences
168 171
172" runs a script that cleans out tex build files whenever I close out of a .tex file.
173autocmd VimLeave *.tex !texclear %
174
175" enable Goyo by default for mutt writing
176autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
177autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
178autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
179autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
180
169" TODO: this will get supported on nvim 0.5.0 181" TODO: this will get supported on nvim 0.5.0
170" TODO: this too https://www.reddit.com/r/neovim/comments/gxcbui/in_built_lsp_is_amazing/ 182" TODO: this too https://www.reddit.com/r/neovim/comments/gxcbui/in_built_lsp_is_amazing/
171" augroup highlight_yank 183" augroup highlight_yank
@@ -307,6 +319,15 @@ let g:moonflyUndercurls = 0
307 319
308"{{{ Mappings 320"{{{ Mappings
309 321
322" Save file as sudo on files that require root permission
323cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
324
325" Replace ex mode with gq
326map Q gq
327
328" Replace all is aliased to S.
329nnoremap S :%s//g<Left><Left>
330
310" use esc in :term as well 331" use esc in :term as well
311tnoremap <Esc> <C-\><C-n> 332tnoremap <Esc> <C-\><C-n>
312 333
@@ -408,6 +429,9 @@ nmap <c-p> <plug>(YoinkPostPasteSwapForward)
408nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> 429nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
409inoremap <Leader>fn <C-R>=expand("%:t:r")<CR> 430inoremap <Leader>fn <C-R>=expand("%:t:r")<CR>
410nnoremap <Leader>fn :put! =expand('%:t:r')<CR> 431nnoremap <Leader>fn :put! =expand('%:t:r')<CR>
432
433" press \g and start writing prose
434map <leader>g :Goyo<CR>
411"}}} 435"}}}
412 436
413"{{{Tagbar 437"{{{Tagbar