summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vim/pack/downloads/opt/snippets/snippets.vim3
-rw-r--r--vimrc29
2 files changed, 21 insertions, 11 deletions
diff --git a/vim/pack/downloads/opt/snippets/snippets.vim b/vim/pack/downloads/opt/snippets/snippets.vim
index d4c6e4e..24d2ce3 100644
--- a/vim/pack/downloads/opt/snippets/snippets.vim
+++ b/vim/pack/downloads/opt/snippets/snippets.vim
@@ -4,6 +4,9 @@ autocmd FileType go
autocmd FileType go
\ :iabbrev <buffer> hand@ <Backspace><Esc>^ifunc <Esc>A(c *gin.Context) {
+
+autocmd FileType go
+ \ :iabbrev <buffer> test@ <Backspace><Esc>^ifunc <Esc>A(t *testing.T) {
autocmd FileType go
\ :iabbrev <buffer> fat@ log.Fatal(" %v", err)<Esc>F%i<Left>
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