summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-07-13 15:16:54 -0500
committerMarc Coquand <marc@mccd.space>2024-07-13 15:16:54 -0500
commit3ab230400f77116de07f29e2e8536b623cce77bf (patch)
treede6209ede527321877e11cfe46c722700e172839 /vim
parent8a0b9593bf671c60cd242874798bd9f43be9e1a3 (diff)
downloadopenbsd-3ab230400f77116de07f29e2e8536b623cce77bf.tar.gz
openbsd-3ab230400f77116de07f29e2e8536b623cce77bf.tar.bz2
openbsd-3ab230400f77116de07f29e2e8536b623cce77bf.zip
Vim updatesHEADmain
Diffstat (limited to '')
-rw-r--r--vim/pack/downloads/opt/snippets/snippets.vim15
-rw-r--r--vimrc33
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 <buffer> err@ if err != nil {}<Left><Enter><Left>
+ \ :iabbrev <buffer> err@ if err != nil {<CR><CR>}<Left><Up><Tab>
autocmd FileType go
- \ :iabbrev <buffer> hand@ <Backspace><Esc>^ifunc <Esc>A(c *gin.Context) {
+ \ :iabbrev <buffer> h@ <Backspace><Esc>^ifunc <Esc>A(c *gin.Context) {<CR><CR>}<Left><Up><Tab>
autocmd FileType go
- \ :iabbrev <buffer> test@ <Backspace><Esc>^ifunc <Esc>A(t *testing.T) {
+ \ :iabbrev <buffer> t@ <Backspace><Esc>^ifunc <Esc>A(t *testing.T) {<CR><CR>}<Left><Up><Tab>
+
+autocmd FileType go
+ \ :iabbrev <buffer> f@ <Backspace><Esc>^ifunc <Esc>A() {<CR><CR>}<Esc><Up><Up>f(li
autocmd FileType go
\ :iabbrev <buffer> fat@ log.Fatal(" %v", err)<Esc>F%i<Left>
-:autocmd FileType php,html.twig,html,javascript,typescript,vue,go
+:autocmd FileType go
+ \ :iabbrev <buffer> if@ if {<CR><CR>}<Esc>%<Left>i
+
+
+:autocmd FileType php,html.twig,html,javascript,typescript,vue
\ :iabbrev <buffer> if@ if() {<CR>}<Esc>%<Left><Left>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 <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
-inoremap <expr> <S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
-"
-"" 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 = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
@@ -131,7 +129,6 @@ autocmd Filetype go nnoremap <buffer> <leader>t :!go test %:h/*.go<Enter>
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 <leader>e :e! **/*
noremap <silent> gd mB:LspGotoDefinition<Enter>
noremap <silent> ]d :LspDiagNext<Enter>
noremap <silent> [d :LspDiagPrev<Enter>
+noremap <silent> ]c :cnext<Enter>
+noremap <silent> [c :cprev<Enter>
noremap <silent> gs mB:LspDocumentSymbol<Enter>
noremap <silent> gr mB:LspGotoImpl<Enter>
noremap <leader>ca :LspCodeAction<Enter>
@@ -177,10 +176,14 @@ noremap <silent> <leader>k :LspDiagCurrent<Enter>
noremap <silent> K :LspHover<Enter>
nnoremap <leader>l :ls<CR>:b<space>
nnoremap <silent> <leader>= :LspFormat<Enter>
+"" Tab completion
+inoremap <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+inoremap <expr> <S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
+
" Spell
au BufEnter *.org set spell
-"
+
" Wildmenu
set wildmenu
set wildignore=_build/**,release/**,node_modules/**