diff options
author | Yigit Sever | 2020-10-29 17:17:46 +0300 |
---|---|---|
committer | Yigit Sever | 2020-10-29 17:17:46 +0300 |
commit | 1679d1e03ca979c896938bdcb37cc0f28048ceb3 (patch) | |
tree | d07d1c4cfad65fc890186fd032193bb2b6521d08 | |
parent | 23ebe8253b7baebd66f3d59e73773452809f2432 (diff) | |
download | dotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.tar.gz dotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.tar.bz2 dotfiles-1679d1e03ca979c896938bdcb37cc0f28048ceb3.zip |
steal some nifty things from lukesmith
-rwxr-xr-x | .config/nvim/init.vim | 24 |
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' | |||
56 | Plug 'vim-airline/vim-airline-themes' | 56 | Plug 'vim-airline/vim-airline-themes' |
57 | " undo tree visualizer | 57 | " undo tree visualizer |
58 | Plug 'mbbill/undotree' | 58 | Plug 'mbbill/undotree' |
59 | " preview colours in source code | ||
60 | Plug 'ap/vim-css-color' | ||
59 | 61 | ||
60 | " }}} heresy " | 62 | " }}} heresy " |
61 | 63 | ||
@@ -164,8 +166,18 @@ autocmd FileType markdown,tex setlocal spell | |||
164 | 166 | ||
165 | autocmd FileType rust let b:dispatch = 'cargo run' | 167 | autocmd FileType rust let b:dispatch = 'cargo run' |
166 | 168 | ||
169 | " these files are formatted not with textwidth but into sentences | ||
167 | autocmd FileType vimwiki,latex,tex setlocal formatprg=/home/yigit/.local/bin/sentences | 170 | autocmd 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. | ||
173 | autocmd VimLeave *.tex !texclear % | ||
174 | |||
175 | " enable Goyo by default for mutt writing | ||
176 | autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 | ||
177 | autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | ||
178 | autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR> | ||
179 | autocmd 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 | ||
323 | cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! | ||
324 | |||
325 | " Replace ex mode with gq | ||
326 | map Q gq | ||
327 | |||
328 | " Replace all is aliased to S. | ||
329 | nnoremap S :%s//g<Left><Left> | ||
330 | |||
310 | " use esc in :term as well | 331 | " use esc in :term as well |
311 | tnoremap <Esc> <C-\><C-n> | 332 | tnoremap <Esc> <C-\><C-n> |
312 | 333 | ||
@@ -408,6 +429,9 @@ nmap <c-p> <plug>(YoinkPostPasteSwapForward) | |||
408 | nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> | 429 | nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR> |
409 | inoremap <Leader>fn <C-R>=expand("%:t:r")<CR> | 430 | inoremap <Leader>fn <C-R>=expand("%:t:r")<CR> |
410 | nnoremap <Leader>fn :put! =expand('%:t:r')<CR> | 431 | nnoremap <Leader>fn :put! =expand('%:t:r')<CR> |
432 | |||
433 | " press \g and start writing prose | ||
434 | map <leader>g :Goyo<CR> | ||
411 | "}}} | 435 | "}}} |
412 | 436 | ||
413 | "{{{Tagbar | 437 | "{{{Tagbar |