From cba68be4f36e9a1d34bc7a2d88ceda7a08ea0ddd Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Fri, 13 May 2022 13:47:14 +0200 Subject: update --- .vimrc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 8faef1d..9a12605 100644 --- a/.vimrc +++ b/.vimrc @@ -1,7 +1,9 @@ " General vim defaults " set background= -set t_te= t_ti= ls=1 ruler +"set t_te= t_ti= +set ls=1 ruler set ai ts=4 sw=4 noet +set mouse=a syntax off filetype on filetype plugin on @@ -40,7 +42,7 @@ autocmd FileType go nmap p :cprevious autocmd FileType go nmap a :cclose " autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 -let g:netrw_browsex_viewer = "open" +let g:netrw_browsex_viewer = "xdg-open" let g:netrw_gx = "" let g:netrw_banner = 0 @@ -74,7 +76,7 @@ hi SpellBad gui=undercurl noremap n :bn noremap :bd -noremap o :!open & +noremap o :!xdg-open & noremap :tag noremap :Files @@ -99,3 +101,20 @@ noremap e :cs find e =expand("") noremap i :cs find i =expand("") noremap f :cs find f =expand("") noremap d :cs find d =expand("") + + +function! CloseOnLast() + let cnt = 0 + for i in range(0, bufnr("$")) + if buflisted(i) + let cnt += 1 + endif + endfor + if cnt <= 1 + q + else + bd + endif +endfunction + +"noremap :call CloseOnLast() -- cgit v1.2.3