From 4e7e36d62c903aba60253cda80adcaca0762b17f Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Tue, 18 Jul 2017 19:23:45 -0700 Subject: [PATCH] better go highlighting --- dotfiles/config/nvim/init.vim | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dotfiles/config/nvim/init.vim b/dotfiles/config/nvim/init.vim index 291631b..435626b 100644 --- a/dotfiles/config/nvim/init.vim +++ b/dotfiles/config/nvim/init.vim @@ -59,6 +59,9 @@ Plug 'slim-template/vim-slim' Plug 'fatih/vim-go' Plug 'isRuslan/vim-es6' +" SBT integration for vim +Plug 'ktvoelker/sbt-vim' + " Org Mode Plug 'jceb/vim-orgmode' @@ -152,6 +155,23 @@ let g:rust_recommended_style=0 " Explicitly provide vim-go the gofmt command let g:go_fmt_command = "gofmt" +" Enable more highlighting in vim-go +let g:go_highlight_types = 1 +let g:go_highlight_fields = 1 +let g:go_highlight_functions = 1 +let g:go_highlight_methods = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_extra_types = 1 + +" Make tabs display as 4 spaces for Go files (makes them easier to read) +autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 + +" Go linting on write. This takes advantage of :GoMetaLinter in vim-go and requires golint to be installed +autocmd BufWritePost,FileWritePost *.go execute 'GoMetaLinter' | cwindow + +" If GoMetaLinter runs for longer than 5 seconds, time it out +let g:go_metalinter_deadline = "5s" + " Hotkeys " Note noremap is a normal mode non-recursive mapping " nnoremap and nmap make the bind only work in normal mode @@ -199,8 +219,6 @@ endif let g:syntastic_javascript_checkers = ['eslint'] let g:syntastic_javascript_jsxhint_exec = 'eslint' -" Go linting on write. This takes advantage of :GoMetaLinter in vim-go and requires golint to be installed -autocmd BufWritePost,FileWritePost *.go execute 'GoMetaLinter' | cwindow " Color customizations colorscheme zenburn