summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-07-12 09:55:09 -0500
committerMarc Coquand <marc@mccd.space>2024-07-12 09:55:09 -0500
commit8a0b9593bf671c60cd242874798bd9f43be9e1a3 (patch)
treee906a9bdb09ca59cb01498f16536848580003783 /vimrc
parent1ea5c2aed8d14f1c7b57f8c017fe7500a86f6859 (diff)
downloadopenbsd-8a0b9593bf671c60cd242874798bd9f43be9e1a3.tar.gz
openbsd-8a0b9593bf671c60cd242874798bd9f43be9e1a3.tar.bz2
openbsd-8a0b9593bf671c60cd242874798bd9f43be9e1a3.zip
vim updates
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc29
1 files changed, 18 insertions, 11 deletions
diff --git a/vimrc b/vimrc
index f127d51..ad5fdf8 100644
--- a/vimrc
+++ b/vimrc
@@ -1,15 +1,20 @@
packadd snippets
-
-" General
+"
+"" General
set ignorecase
-
-" Indentation
+"
+"" Tab completion
+inoremap <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+inoremap <expr> <S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
+"
+"" Indentation
set tabstop=8
set shiftround
set nobackup
set autoindent
set smartindent
set cindent
+set nu
" Theme
syntax on
@@ -24,7 +29,7 @@ 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
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
@@ -118,14 +123,17 @@ if exists('g:loaded_lsp')
\ }])
end
-autocmd FileType go setlocal omnifunc=lsp#complete
+filetype plugin on
autocmd Filetype go set makeprg=go\ build
-autocmd Filetype go autocmd BufWritePre <buffer> :LspFormat
+"autocmd Filetype go autocmd BufWritePre <buffer> :LspFormat
+" Auto test directory with <leader>t
+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
if exists('g:loaded_lsp')
call LspAddServer([#{
@@ -172,18 +180,17 @@ nnoremap <silent> <leader>= :LspFormat<Enter>
" Spell
au BufEnter *.org set spell
-
+"
" Wildmenu
set wildmenu
-set wildmode=longest:full,lastused
set wildignore=_build/**,release/**,node_modules/**
-set wildoptions+=fuzzy
+set wildoptions=fuzzy
" Grep
set grepprg=git\ grep\ -nH
-" Auto go to previous X
+" Auto add marks
augroup VIMRC
autocmd!
autocmd BufLeave *.css,*.scss normal! mC