Skip to content

Commit

Permalink
configure vim-go
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopernas committed Jul 20, 2022
1 parent d61f30b commit 3b441f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ install_all() {
git clone --depth=1 /~https://github.com/tpope/vim-fugitive.git ~/.vim/bundle/vim-fugitive.git
git clone --depth=1 /~https://github.com/tpope/vim-commentary.git ~/.vim/bundle/vim-commentary.git
git clone --depth=1 /~https://github.com/rust-lang/rust.vim.git ~/.vim/bundle/rust.vim
git clone --depth=1 /~https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go

# shellcheck disable=SC1090
source ~/.bash_profile
Expand Down
15 changes: 15 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,18 @@ let g:rustfmt_options = '--edition 2021'
let g:syntastic_rust_checkers = []
autocmd BufRead *.rs :setlocal tags=./.rusty-tags;/,$RUST_SRC_PATH/rusty-tags.vi
autocmd BufWritePost *.rs :silent! exec "!rusty-tags vi --output=.rusty-tags --quiet --start-dir=" . expand('%:p:h') . "&" | redraw!

" GO
au filetype go inoremap <buffer> <Nul> <C-x><C-o>
" Go syntax highlighting
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1

" Auto formatting and importing
let g:go_imports_autosave = 0
let g:go_fmt_autosave = 1
let g:go_fmt_command = "gofmt"

0 comments on commit 3b441f6

Please sign in to comment.