summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim')
-rw-r--r--vim/.config/nvim/UltiSnips/go.snippets14
-rw-r--r--vim/.vimrc26
2 files changed, 25 insertions, 15 deletions
diff --git a/vim/.config/nvim/UltiSnips/go.snippets b/vim/.config/nvim/UltiSnips/go.snippets
new file mode 100644
index 0000000..96a9fec
--- /dev/null
+++ b/vim/.config/nvim/UltiSnips/go.snippets
@@ -0,0 +1,14 @@
+snippet ec "if err no nil"
+if err != nil {
+ return $1err
+}
+$0
+endsnippet
+
+snippet eh "if err no nil write http"
+if err != nil {
+ ${1:http}.Error(w, err.Error(), http.Status${2:InternalServerError})
+ return
+}
+$0
+endsnippet
diff --git a/vim/.vimrc b/vim/.vimrc
index 3633673..ea2d92c 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -15,8 +15,7 @@ set shellslash
" Completion
Plugin 'prabirshrestha/async.vim'
Plugin 'prabirshrestha/vim-lsp'
- Plugin 'fatih/vim-go'
- Plugin 'ajh17/VimCompletesMe'
+ Plugin 'lifepillar/vim-mucomplete'
Plugin 'Shougo/echodoc.vim'
Plugin 'tpope/vim-surround'
@@ -42,34 +41,31 @@ set shellslash
" File support
" Plugin 'cespare/vim-toml'
- Plugin 'lervag/vimtex'
+ "Plugin 'lervag/vimtex'
" Plugin 'vimwiki/vimwiki'
- " Snippets are separated from the engine. Add this if you want them:
- " Plugin 'honza/vim-snippets'
+ " Snippits
+ Plugin 'SirVer/ultisnips'
+ Plugin 'honza/vim-snippets'
call vundle#end() " required
filetype plugin indent on " required
" Completion
- set completeopt=menuone
- " let g:go_def_mode='gopls'
- " let g:go_info_mode='gopls'
+ set completeopt+=menuone
+ set completeopt+=noselect
+
+ let g:UltiSnipsExpandTrigger = '<C-s>'
+ let g:mucomplete#chains = {}
+ let g:mucomplete#chains.default = [ 'ulti', 'path', 'omni', 'keyn' ]
if has('nvim')
let g:echodoc#enable_at_startup = 1
let g:echodoc#type = 'virtual'
endif
- autocmd FileType c let b:vcm_tab_complete = 'omni'
- autocmd FileType cpp let b:vcm_tab_complete = 'omni'
- autocmd FileType py let b:vcm_tab_complete = 'omni'
- autocmd FileType go let b:vcm_tab_complete = 'omni'
- autocmd FileType ruby let b:vcm_tab_complete = 'omni'
- autocmd FileType vim let b:vcm_tab_complete = 'vim'
-
" Lsp options
let g:lsp_signature_help_enabled = 0
let g:lsp_insert_text_enabled = 0