summaryrefslogtreecommitdiffstats
path: root/.config/nvim/init.vim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.vim')
-rwxr-xr-x.config/nvim/init.vim26
1 files changed, 6 insertions, 20 deletions
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()
166" Remove any trailing whitespace that is in the file 166" Remove any trailing whitespace that is in the file
167autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif 167autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
168 168
169" Close vim if the only window left open is NERDTree
170autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
171" Close vim if the only window left open is a quickfix window 169" Close vim if the only window left open is a quickfix window
172autocmd WinEnter * if winnr("$") == 1 && &buftype == "quickfix" | q | endif 170autocmd WinEnter * if winnr("$") == 1 && &buftype == "quickfix" | q | endif
173" winnr("$") how many windows left? 171" winnr("$") how many windows left?
@@ -179,6 +177,7 @@ autocmd VimResized * :wincmd =
179" Set spell for prose 177" Set spell for prose
180autocmd FileType markdown,tex setlocal spell 178autocmd FileType markdown,tex setlocal spell
181 179
180" Dispatch.vim plugin to use cargo run for rust projects
182autocmd FileType rust let b:dispatch = 'cargo run' 181autocmd FileType rust let b:dispatch = 'cargo run'
183 182
184" these files are formatted not with textwidth but into sentences 183" these files are formatted not with textwidth but into sentences
@@ -260,17 +259,18 @@ set tabstop=8
260set spell spelllang=en_gb 259set spell spelllang=en_gb
261set nospell 260set nospell
262 261
263" Cool tab completion stuff 262" Tab completion, zsh style
264set wildmode=list:longest,full 263set wildmode=full
265set 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 264set 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
266let g:NERDTreeRespectWildIgnore = 1 265
266" Put one space while joining (not two)
267set nojoinspaces 267set nojoinspaces
268 268
269" Keep n lines above/below cursor while scrolling 269" Keep n lines above/below cursor while scrolling
270set scrolloff=4 270set scrolloff=4
271" line numbers 271" line numbers
272set number 272set number
273" fold manually, when i place markers 273" fold manually, when I place markers
274set foldmethod=marker 274set foldmethod=marker
275" set terminal title 275" set terminal title
276set title 276set title
@@ -358,12 +358,6 @@ nnoremap S :%s//g<Left><Left>
358" use esc in :term as well 358" use esc in :term as well
359tnoremap <Esc> <C-\><C-n> 359tnoremap <Esc> <C-\><C-n>
360 360
361" move between windows in :term
362tnoremap <C-h> <C-\><C-n><C-w>h
363tnoremap <C-j> <C-\><C-n><C-w>j
364tnoremap <C-k> <C-\><C-n><C-w>k
365tnoremap <C-l> <C-\><C-n><C-w>l
366
367" call CreatePaper on word below cursor 361" call CreatePaper on word below cursor
368nnoremap <leader>np gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand('<cword>'))<CR> 362nnoremap <leader>np gewi[[/papers/<ESC>Ea]]<ESC>bb:call CreatePaper(expand('<cword>'))<CR>
369 363
@@ -382,8 +376,6 @@ map Y y$
382 376
383" Open the TagBar Plugin <F3> 377" Open the TagBar Plugin <F3>
384nnoremap <silent> <F3> :TagbarToggle<CR> 378nnoremap <silent> <F3> :TagbarToggle<CR>
385" Open NERDTree <F4>
386nnoremap <silent> <F4> :NERDTreeToggle<CR>
387" Fix whole buffer via ALE 379" Fix whole buffer via ALE
388nmap <F9> <Plug>(ale_fix) 380nmap <F9> <Plug>(ale_fix)
389 381
@@ -405,12 +397,6 @@ nnoremap <silent> j gj
405inoremap <silent> <Up> <Esc>gka 397inoremap <silent> <Up> <Esc>gka
406inoremap <silent> <Down> <Esc>gja 398inoremap <silent> <Down> <Esc>gja
407 399
408" quicker window movement
409nnoremap <C-j> <C-w>j
410nnoremap <C-k> <C-w>k
411nnoremap <C-h> <C-w>h
412nnoremap <C-l> <C-w>l
413
414" Disable highlight when <leader><cr> is pressed 400" Disable highlight when <leader><cr> is pressed
415nnoremap <silent> <leader><cr> :noh<cr> 401nnoremap <silent> <leader><cr> :noh<cr>
416" Space used to toggle folds, now it's x (because x is d) 402" Space used to toggle folds, now it's x (because x is d)