Skip to content

Commit

Permalink
fix missing Bclose function and path to edit config
Browse files Browse the repository at this point in the history
  • Loading branch information
jseba committed Jul 4, 2021
1 parent 5ffeab5 commit 112a2d0
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions nvim/.config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,25 @@ augroup resume_edit
augroup END

" don't close window when deleting a buffer
command! Bclose call helpers#bufcloseit()
function! <SID>BufCloseIt()
let l:cbufnr = bufnr("%")
let l:abufnr = bufnr("#")

if buflisted(l:abufnr)
buffer #
else
bnext
endif

if bufnr("%") == l:cbufnr
new
endif

if buflisted(l:cbufnr)
execute("bdelete! ".l:cbufnr)
endif
endfunction
command! Bclose call <SID>BufCloseIt()

" disable paren matching in TeX, it's really slow
augroup tex_nomatchparen
Expand Down Expand Up @@ -184,7 +202,7 @@ nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:silent! noh<cr>`w
nnoremap vv ^vg_
" quick access to common files
nnoremap <Space>ve :edit $HOME/.vimrc<CR>
nnoremap <Space>ve :edit $MYVIMRC<CR>
" center search matches after jumping
nnoremap n nzzzv
Expand Down

0 comments on commit 112a2d0

Please sign in to comment.