Skip to content

Instantly share code, notes, and snippets.

@umiyosh
Last active November 7, 2018 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umiyosh/eb9591cc3b5a104551bb3f2ddbb05248 to your computer and use it in GitHub Desktop.
Save umiyosh/eb9591cc3b5a104551bb3f2ddbb05248 to your computer and use it in GitHub Desktop.
scriptencoding utf-8
if has('vim_starting')
set runtimepath+=~/.vim/plugged/vim-plug
if !isdirectory(expand('~/.vim/plugged/vim-plug'))
echo 'install vim-plug...'
call feedkeys(' ')
call system('mkdir -p ~/.vim/plugged/vim-plug')
call system('git clone https://github.com/junegunn/vim-plug.git ~/.vim/plugged/vim-plug/autoload')
end
endif
filetype off
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
Plug 'w0rp/ale'
Plug 'majutsushi/tagbar'
Plug 'Shougo/vimfiler.vim'
Plug 'vim-airline/vim-airline'
Plug 'morhetz/gruvbox'
call plug#end()
filetype plugin indent on
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_fmt_command = "goimports"
let g:go_list_type = "quickfix"
let g:go_version_warning = 0
let g:go_fmt_fail_silently = 1
let g:go_disable_autoinstall = 1
let g:go_loaded_gosnippets = 1
au FileType go nmap <leader>b <Plug>(go-build)
au FileType go nmap <leader>gr <Plug>(go-run)
au FileType go nmap <leader>gt <Plug>(go-test)
au FileType go nmap <Leader>gs <Plug>(go-implements)
au FileType go nmap <Leader>gi <Plug>(go-info)
au FileType go nmap <Leader>ge <Plug>(go-rename)
au FileType go nmap <Leader>gd <Plug>(go-doc)
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_sign_column_always = 1
let g:ale_linters = {
\ 'go': ['gometalinter'],
\}
let g:ale_go_gometalinter_options = '--fast --enable=staticcheck --enable=gosimple --enable=unused'
let g:Tlist_Use_Right_Window = 1
set tags=tags;
"set tags+=~/.tags
if has('mac')
let g:Ctags_Cmd = '/usr/local/bin/ctags'
else
let g:Ctags_Cmd = 'ctags'
endif
let g:tagbar_ctags_bin = g:Ctags_Cmd
map <silent> <leader>tl :TagbarToggle<CR>
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment