Browse Source

better go highlighting

master
Taylor Bockman 7 years ago
parent
commit
4e7e36d62c
  1. 22
      dotfiles/config/nvim/init.vim

22
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

Loading…
Cancel
Save