From ec67aaa4606e2c8f982e624eb309a0d89abda902 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 6 Oct 2021 02:28:19 +0300 Subject: nvim: cleanup --- .config/nvim/init.vim | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to '.config/nvim') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index c673870..ad9f90a 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -166,8 +166,6 @@ call plug#end() " Remove any trailing whitespace that is in the file autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif -" Close vim if the only window left open is NERDTree -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " Close vim if the only window left open is a quickfix window autocmd WinEnter * if winnr("$") == 1 && &buftype == "quickfix" | q | endif " winnr("$") how many windows left? @@ -179,6 +177,7 @@ autocmd VimResized * :wincmd = " Set spell for prose autocmd FileType markdown,tex setlocal spell +" Dispatch.vim plugin to use cargo run for rust projects autocmd FileType rust let b:dispatch = 'cargo run' " these files are formatted not with textwidth but into sentences @@ -260,17 +259,18 @@ set tabstop=8 set spell spelllang=en_gb set nospell -" Cool tab completion stuff -set wildmode=list:longest,full +" Tab completion, zsh style +set wildmode=full set wildignore=*.o,*.obj,*.class,*.aux,*.lof,*.log,*.lot,*.fls,*.toc,*.fmt,*.fot,*.cb,*.cb2,.*.lb,.dvi,*.xdv,*.bbl,*.bcf,*.blg,*-blx.aux,*-blx.bib,*.run.xml,*.fdb_latexmk,*.synctex,*.synctex(busy),*.synctex.gz,*.synctex.gz(busy),*.pdfsync -let g:NERDTreeRespectWildIgnore = 1 + +" Put one space while joining (not two) set nojoinspaces " Keep n lines above/below cursor while scrolling set scrolloff=4 " line numbers set number -" fold manually, when i place markers +" fold manually, when I place markers set foldmethod=marker " set terminal title set title @@ -358,12 +358,6 @@ nnoremap S :%s//g " use esc in :term as well tnoremap -" move between windows in :term -tnoremap h -tnoremap j -tnoremap k -tnoremap l - " call CreatePaper on word below cursor nnoremap np gewi[[/papers/Ea]]bb:call CreatePaper(expand('')) @@ -382,8 +376,6 @@ map Y y$ " Open the TagBar Plugin nnoremap :TagbarToggle -" Open NERDTree -nnoremap :NERDTreeToggle " Fix whole buffer via ALE nmap (ale_fix) @@ -405,12 +397,6 @@ nnoremap j gj inoremap gka inoremap gja -" quicker window movement -nnoremap j -nnoremap k -nnoremap h -nnoremap l - " Disable highlight when is pressed nnoremap :noh " Space used to toggle folds, now it's x (because x is d) -- cgit v1.2.3-70-g09d2