From 78c9d951691871db14ae6b30c100ed3599af8198 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 16 Feb 2020 13:02:41 +0100 Subject: Vim cleanup --- vim/.vimrc | 143 +++++++++++++++++-------------------------------------------- 1 file changed, 39 insertions(+), 104 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index ffebaa1..0ed97d2 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -30,7 +30,7 @@ set shellslash " Plugin 'agude/vim-eldar' " Plugin 'ntk148v/vim-horizon' " Plugin 'rakr/vim-colors-rakr' - Plugin 'rakr/vim-one' + " Plugin 'rakr/vim-one' Plugin 'morhetz/gruvbox' " Plugin 'ntk148v/vim-horizon' @@ -43,29 +43,21 @@ set shellslash " Plugin 'tpope/vim-fugitive' " File support - Plugin 'cespare/vim-toml' + " Plugin 'cespare/vim-toml' " Plugin 'vim-scripts/TagHighlight' Plugin 'lervag/vimtex' - Plugin 'LnL7/vim-nix' + " Plugin 'LnL7/vim-nix' " Plugin 'rust-lang/rust.vim' " Plugin 'racer-rust/vim-racer' " Snippets are separated from the engine. Add this if you want them: - Plugin 'honza/vim-snippets' + " Plugin 'honza/vim-snippets' call vundle#end() " required filetype plugin indent on " required " Completion - " let g:LanguageClient_serverCommands = { - " \ 'rust': ['/usr/bin/rustup', 'run', 'stable', 'rls' ], - " \ 'c': ['/usr/bin/cquery', '--log-file=/tmp/cq.log', '--init={"cacheDirectory":"/tmp/cquery/"}' ] - " \ } - " - " let g:LanguageClient_useVirtualText = 0 - " let g:LanguageClient_diagnosticsEnable = 0 - " let g:deoplete#enable_at_startup = 1 let g:go_def_mode='gopls' let g:go_info_mode='gopls' " let g:rustfmt_autosave = 1 @@ -77,64 +69,56 @@ set shellslash set completeopt=menuone -syntax enable -set number -set relativenumber +" General vim settings + syntax enable + set number + set relativenumber -set tabstop=4 -set shiftwidth=4 -set softtabstop=4 -set noexpandtab + set tabstop=4 + set shiftwidth=4 + set softtabstop=4 + set noexpandtab -" Check if file has changed -au FocusGained,BufEnter * :checktime + " Remove statusline + set laststatus=0 -let g:tex_flavor='latex' + " Check if file has changed + au FocusGained,BufEnter * :checktime -if has('nvim') - set inccommand=split -endif + if has('nvim') + set inccommand=split + endif -" Required for operations modifying multiple buffers like rename. -set hidden + set hidden -" Snippits - " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. - " let g:UltiSnipsExpandTrigger="" - " let g:UltiSnipsJumpForwardTrigger="" - " let g:UltiSnipsJumpBackwardTrigger="" +" Latex stuff + let g:tex_flavor='latex' - " If you want :UltiSnipsEdit to split your window. - " let g:UltiSnipsEditSplit="vertical" + let g:vimtex_quickfix_blgparser = {'disable': 1} + let g:vimtex_quickfix_open_on_warning = 0 + let g:vimtex_compiler_latexmk = { + \ 'backend' : 'nvim', + \ 'background' : 0, + \ 'build_dir' : '', + \ 'callback' : 1, + \ 'continuous' : 0, + \ 'executable' : 'latexmk', + \ 'hooks' : [], + \ 'options' : [ + \ '-file-line-error', + \ '-synctex=1', + \ ], + \} " File finding + " Fuzzy like menu set path+=** set wildmenu let g:netrw_liststyle=2 let g:netrw_banner = 0 -" autocmd BufEnter * call ncm2#enable_for_buffer() -" let g:ncm2#auto_popup = 0 - " Keymapping - nnoremap :b - - nnoremap ,, :copen - - cnoreabbrev ln lnext - cnoreabbrev lp lprev - cnoreabbrev cn cnext - cnoreabbrev cp cprev - - nmap QuickNext - nmap QuickPrev - " nnoremap :LspHover - - let g:UltiSnipsExpandTrigger="" - let g:UltiSnipsJumpForwardTrigger="" - let g:UltiSnipsJumpBackwardTrigger="" - " When moving more lines make it a jump. If couns i 2 it will run m'2j, " thus storing it on the jumplist and then jumping nnoremap j (v:count > 1 ? "m'" . v:count : '' ) . 'j' @@ -146,37 +130,11 @@ set hidden map mm :make V=1 map mf :make flash V=1 - " Example on filetype specific - " autocmd FileType tex map o :w !detex \| wc -w - autocmd FileType asciidoc nnoremap c :!asciidoctor % - - " Start interactive EasyAlign in visual mode (e.g. vipga) - xmap ga (EasyAlign) - - " Start interactive EasyAlign for a motion/text object (e.g. gaip) - nmap ga (EasyAlign) - - " Split stuff https://janneinosaka.blogspot.com/2014/10/automatically-resize-vim-splits.html - function Splitresize() - let hmax = max([winwidth(0), float2nr(&columns*0.66), 90]) - let vmax = max([winheight(0), float2nr(&lines*0.66), 25]) - exe "vertical resize" . (min([hmax, 140])) - exe "resize" . (min([vmax, 60])) - endfunction - " move between splits without the ctrl-w prefix - - nnoremap :call Splitresize() - nnoremap :call Splitresize() - nnoremap :call Splitresize() - nnoremap :call Splitresize() - - - " Enforcing filetypes autocmd BufRead,BufNewFile *.ino set filetype=c autocmd BufRead,BufNewFile *.asc set filetype=asciidoc -" Highlightning +" Highlightning And colors set termguicolors " let g:one_allow_italics = 1 let g:gruvbox_italic = 1 @@ -186,26 +144,3 @@ set hidden " Spell check set spelllang=en autocmd FileType tex set spell - -" Latex support - let g:vimtex_quickfix_blgparser = {'disable': 1} - let g:vimtex_quickfix_open_on_warning = 0 - let g:vimtex_compiler_latexmk = { - \ 'backend' : 'nvim', - \ 'background' : 0, - \ 'build_dir' : '', - \ 'callback' : 1, - \ 'continuous' : 0, - \ 'executable' : 'latexmk', - \ 'hooks' : [], - \ 'options' : [ - \ '-file-line-error', - \ '-synctex=1', - \ ], - \} - -" Terrible oneliner for debugging color highlightning -map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' -\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" -\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" - -- cgit v1.2.3