From 0b89577b1e7c46986bed003033d677f2d1ebf9cb Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 15 Aug 2021 11:43:21 +0200 Subject: update --- .vimrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index f8fce87..68ae82a 100644 --- a/.vimrc +++ b/.vimrc @@ -1,5 +1,6 @@ " set background= -set t_te= t_ti= laststatus=2 +"set t_te= t_ti= laststatus=2 +set t_te= t_ti= ls=1 ruler syntax off filetype on @@ -7,23 +8,22 @@ filetype plugin on filetype plugin indent on let mapleader = "," +set rtp+=/opt/homebrew/opt/fzf let g:fzf_preview = 'cat {}' " vimki plugin -let g:vimki_lower = "a-zàçéèêếëîïñôöùûü" autocmd filetype vimki syntax on autocmd filetype vimki set autowrite -autocmd filetype vimki setlocal spell spelllang=fr +" autocmd filetype vimki setlocal spell spelllang=fr autocmd filetype vimki nmap z :FZF ~/Wiki -autocmd filetype vimki nnoremap = YpVr= -autocmd filetype vimki nnoremap - YpVr- - " vim-go plugin let g:go_def_mode = "gopls" let g:go_info_mode = "gopls" let g:go_list_type = "quickfix" -let g:go_fmt_command = "goimports" +" let g:go_fmt_command = "goimports" +let g:go_fmt_command = "gopls" +let g:go_gopls_gofumpt = 1 let g:go_metalinter_command = "golangci-lint" autocmd FileType go syntax on autocmd FileType go nmap b (go-build) -- cgit v1.2.3 From e589eff80a403bfe7831c040fe55a6bcf5ba038b Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 6 Dec 2021 15:02:31 +0100 Subject: update --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 68ae82a..1380fe8 100644 --- a/.vimrc +++ b/.vimrc @@ -8,7 +8,7 @@ filetype plugin on filetype plugin indent on let mapleader = "," -set rtp+=/opt/homebrew/opt/fzf +" set rtp+=/opt/homebrew/opt/fzf let g:fzf_preview = 'cat {}' " vimki plugin -- cgit v1.2.3 From 6258df971a00f175cd434e7874c6ba5616b50e60 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sat, 18 Dec 2021 11:37:10 +0100 Subject: update --- .vimrc | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 1380fe8..8972385 100644 --- a/.vimrc +++ b/.vimrc @@ -1,14 +1,14 @@ +" General vim defaults " set background= -"set t_te= t_ti= laststatus=2 set t_te= t_ti= ls=1 ruler - +set ai ts=4 sw=4 noet syntax off filetype on filetype plugin on filetype plugin indent on let mapleader = "," -" set rtp+=/opt/homebrew/opt/fzf +"set rtp+=/opt/homebrew/opt/fzf let g:fzf_preview = 'cat {}' " vimki plugin @@ -18,14 +18,17 @@ autocmd filetype vimki set autowrite autocmd filetype vimki nmap z :FZF ~/Wiki " vim-go plugin -let g:go_def_mode = "gopls" -let g:go_info_mode = "gopls" -let g:go_list_type = "quickfix" -" let g:go_fmt_command = "goimports" -let g:go_fmt_command = "gopls" -let g:go_gopls_gofumpt = 1 +"let g:go_def_mode = "gopls" +"let g:go_info_mode = "gopls" +"let g:go_list_type = "quickfix" +"let g:go_fmt_command = "gopls" +"let g:go_gopls_gofumpt = 1 + +let g:go_gopls_enabled = 0 +let g:go_def_mode = "godef" +let g:go_fmt_command = "goimports" let g:go_metalinter_command = "golangci-lint" -autocmd FileType go syntax on +"autocmd FileType go syntax on autocmd FileType go nmap b (go-build) autocmd FileType go nmap i (go-info) autocmd FileType go nmap r (go-run) @@ -35,21 +38,15 @@ autocmd FileType go nmap v (go-referrers) autocmd FileType go nmap n :cnext autocmd FileType go nmap p :cprevious autocmd FileType go nmap a :cclose -autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 +" autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 let g:netrw_browsex_viewer = "open" let g:netrw_gx = "" let g:netrw_banner = 0 -autocmd filetype javascript,html,json,yaml set ts=2 sts=2 sw=2 et +" python and yaml formatting: +autocmd filetype python,yaml set ts=2 sts=2 sw=2 et -" :set wm=2 linebreak -" :set term=ansi -":set modeline -":set modelines=5 -set autoindent -"set breakindent -" :set ts=2 sw=2 sts=2 et :set wrap :set linebreak :set nolist @@ -79,3 +76,4 @@ noremap n :bn noremap :bd noremap o :!open & noremap :tag +noremap :Files -- cgit v1.2.3 From 1e1a1087f799632c021af612eb3c919cf1143237 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 10 Feb 2022 15:27:15 +0100 Subject: vim: improve cscope mappings --- .vimrc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 8972385..8faef1d 100644 --- a/.vimrc +++ b/.vimrc @@ -77,3 +77,25 @@ noremap :bd noremap o :!open & noremap :tag noremap :Files + +""""""""""""" My cscope/vim key mappings + " + " The following maps all invoke one of the following cscope search types: + " + " 's' symbol: find all references to the token under cursor + " 'g' global: find global definition(s) of the token under cursor + " 'c' calls: find all calls to the function name under cursor + " 't' text: find all instances of the text under cursor + " 'e' egrep: egrep search for the word under cursor + " 'f' file: open the filename under cursor + " 'i' includes: find files that include the filename under cursor + " 'd' called: find functions that function under cursor calls + +noremap s :cs find s =expand("") +noremap g :cs find g =expand("") +noremap c :cs find c =expand("") +noremap t :cs find t =expand("") +noremap e :cs find e =expand("") +noremap i :cs find i =expand("") +noremap f :cs find f =expand("") +noremap d :cs find d =expand("") -- cgit v1.2.3 From c3779261fadc809c2785401dc42009c5d55cebba Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 10 Mar 2022 09:18:57 +0100 Subject: vim: improve cscope --- .vimrc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 8faef1d..1bc2263 100644 --- a/.vimrc +++ b/.vimrc @@ -91,11 +91,23 @@ noremap :Files " 'i' includes: find files that include the filename under cursor " 'd' called: find functions that function under cursor calls -noremap s :cs find s =expand("") -noremap g :cs find g =expand("") -noremap c :cs find c =expand("") -noremap t :cs find t =expand("") -noremap e :cs find e =expand("") -noremap i :cs find i =expand("") -noremap f :cs find f =expand("") -noremap d :cs find d =expand("") +if has("cscope") + set csto=0 + set cst + set nocsverb + if filereadable("cscope.out") + cs add cscope.out + elseif $CSCOPE_DB + cs add $CSCOPE_DB + endif + set csverb +endif + +nmap cs :cs find s =expand("") +nmap cg :cs find g =expand("") +nmap cc :cs find c =expand("") +nmap ct :cs find t =expand("") +nmap ce :cs find e =expand("") +nmap ci :cs find i =expand("") +nmap cf :cs find f =expand("") +nmap cd :cs find d =expand("") -- cgit v1.2.3 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 From 21d2bd0a3bebcec2cf6adab854d96196f59463ce Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 22 Aug 2022 15:04:00 +0200 Subject: update --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 858bc52..cf4a9e4 100644 --- a/.vimrc +++ b/.vimrc @@ -3,7 +3,7 @@ "set t_te= t_ti= set ls=1 ruler set ai ts=4 sw=4 noet -set mouse=a +"set mouse=a syntax off filetype on filetype plugin on -- cgit v1.2.3