aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2015-10-08 09:22:16 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2015-10-08 09:22:16 +0200
commitca8e70082e52048f807f63c18d32fd1a9dc3f8dc (patch)
treeb2432b8ce85a54834c5ebb43363a0e3b1c631b50
parent3bed9d79439022560df6d65f74b27e3235cd7bba (diff)
downloaddotfiles-ca8e70082e52048f807f63c18d32fd1a9dc3f8dc.tar.gz
dotfiles-ca8e70082e52048f807f63c18d32fd1a9dc3f8dc.zip
vim: call golint on save if the executable exists
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
-rw-r--r--vim/autocmd.vim2
-rw-r--r--vim/bundles.vim6
2 files changed, 5 insertions, 3 deletions
diff --git a/vim/autocmd.vim b/vim/autocmd.vim
index c2bab95..2e66045 100644
--- a/vim/autocmd.vim
+++ b/vim/autocmd.vim
@@ -1,4 +1,3 @@
-
" Indentation rules for different languages.
" Some rules regarding indentation on different languages.
@@ -20,4 +19,3 @@ autocmd BufWritePre * :%s/\s\+$//e
if filereadable(".lvimrc")
so .lvimrc
endif
-
diff --git a/vim/bundles.vim b/vim/bundles.vim
index a95ad48..05c9a78 100644
--- a/vim/bundles.vim
+++ b/vim/bundles.vim
@@ -1,4 +1,3 @@
-
" Vundle setup
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@@ -25,3 +24,8 @@ let g:ctrlp_match_window = 'max:40'
" Tell vim-go to use goimports on save.
let g:go_fmt_command = "goimports"
+" Execute go-lint on save.
+if isdirectory($GOPATH."/src/github.com/golang/lint/misc/vim")
+ set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
+ autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow
+endif