From 3ab230400f77116de07f29e2e8536b623cce77bf Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Sat, 13 Jul 2024 15:16:54 -0500 Subject: Vim updates --- vim/pack/downloads/opt/snippets/snippets.vim | 15 +++++++++---- vimrc | 33 +++++++++++++++------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/vim/pack/downloads/opt/snippets/snippets.vim b/vim/pack/downloads/opt/snippets/snippets.vim index 24d2ce3..92f0af7 100644 --- a/vim/pack/downloads/opt/snippets/snippets.vim +++ b/vim/pack/downloads/opt/snippets/snippets.vim @@ -1,17 +1,24 @@ autocmd FileType go - \ :iabbrev err@ if err != nil {} + \ :iabbrev err@ if err != nil {} autocmd FileType go - \ :iabbrev hand@ ^ifunc A(c *gin.Context) { + \ :iabbrev h@ ^ifunc A(c *gin.Context) {} autocmd FileType go - \ :iabbrev test@ ^ifunc A(t *testing.T) { + \ :iabbrev t@ ^ifunc A(t *testing.T) {} + +autocmd FileType go + \ :iabbrev f@ ^ifunc A() {}f(li autocmd FileType go \ :iabbrev fat@ log.Fatal(" %v", err)F%i -:autocmd FileType php,html.twig,html,javascript,typescript,vue,go +:autocmd FileType go + \ :iabbrev if@ if {}%i + + +:autocmd FileType php,html.twig,html,javascript,typescript,vue \ :iabbrev if@ if() {}%i diff --git a/vimrc b/vimrc index ad5fdf8..64ee7e2 100644 --- a/vimrc +++ b/vimrc @@ -1,13 +1,9 @@ packadd snippets -" -"" General + +" General set ignorecase -" -"" Tab completion -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -" -"" Indentation + +" Indentation set tabstop=8 set shiftround set nobackup @@ -16,21 +12,23 @@ set smartindent set cindent set nu +" Search +set incsearch +set matchpairs+=<:> + " Theme syntax on set background=light set termguicolors colorscheme quiet -set incsearch -set matchpairs+=<:> hi Normal guifg=black guibg=#FFFFEA -"hi Keyword ctermfg=black cterm=bold +""hi Keyword ctermfg=black cterm=bold hi SpellBad term=reverse term=underline guibg=#FFFFEA hi SpellCap term=reverse term=underline guibg=#FFFFEA hi SpellRare term=reverse term=underline guibg=#FFFFEA hi SpellLocal term=reverse term=underline guibg=#FFFFEA -" -" Cursor - switch between line and full + +"" Cursor - switch between line and full when going to insert mode let &t_SI = "\[6 q" let &t_SR = "\[4 q" let &t_EI = "\[2 q" @@ -131,7 +129,6 @@ autocmd Filetype go nnoremap t :!go test %:h/*.go au BufRead,BufNewFile *.tmpl set filetype=gohtml autocmd Filetype gohtml setlocal tabstop=2 -autocmd Filetype gohtml setlocal formatprg=djlint\ --profile=golang\ --reformat\ - " Nix @@ -168,6 +165,8 @@ noremap e :e! **/* noremap gd mB:LspGotoDefinition noremap ]d :LspDiagNext noremap [d :LspDiagPrev +noremap ]c :cnext +noremap [c :cprev noremap gs mB:LspDocumentSymbol noremap gr mB:LspGotoImpl noremap ca :LspCodeAction @@ -177,10 +176,14 @@ noremap k :LspDiagCurrent noremap K :LspHover nnoremap l :ls:b nnoremap = :LspFormat +"" Tab completion +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + " Spell au BufEnter *.org set spell -" + " Wildmenu set wildmenu set wildignore=_build/**,release/**,node_modules/** -- cgit v1.2.3