vim-go debug
2018.09.04
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Shougo/echodoc.vim'
Plugin 'fatih/vim-go', {'do': ':GoUpdateBinaries'}
Plugin 'ludovicchabant/vim-gutentags'
Plugin 'mklabs/vim-json'
"Plugin 'majutsushi/tagbar'
Plugin 'skywind3000/asyncrun.vim'
Plugin 'leafgarland/typescript-vim'
Plugin 'crooloose/nerdtree'
Plugin 'easymotion/vim-easymotion'
Plugin 'sickill/vim-monokai'
Plugin 'Valloric/YouCompleteMe', {'do': './install.sh --clang-completer --go-completer --js-completer --rust-completer'}
Plugin 'Yggdroot/LeaderF', { 'do': './install.sh' }
call vundle#end()
"###### simple
set nu
set nopaste
filetype plugin indent on
syntax enable
set sw=4
set ts=4
set hlsearch
let mapleader=","
"##### tarbar gotags
"nmap <C-f> :TagbarToggle<CR>
"let ctagsbin = 'gotags'
"let GOPATH = '/root/workspace/go'
"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'
" \ }
"######vim-monokai
syntax enable
colorscheme monokai
"###### apiline_powerline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='luna'
set t_Co=256
nnoremap <tab> :bn <cr>
nnoremap <S-tab> :bp <cr>
"##### LeaderF
let g:Lf_ShortcutF = '<C-P>'
noremap <c-f> :LeaderfFunction<cr>
noremap <leader><c-f> :LeaderfFunctionAll<cr>
noremap <C-n> :LeaderfMru<cr>
noremap <C-l> :LeaderfLine<cr>
noremap <leader><C-l> :LeaderfLineAll<cr>
"##### YouCompleteme
let g:ycm_add_preview_to_completeopt = 0
set completeopt=menu,menuone
let g:ycm_filetype_whitelist = {
\ "go": 1,
\ "js": 1,
\ "c": 1,
\ "cpp": 1
\}
nnoremap <leader>gc :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gd :YcmCompleter GoToDefinition<CR>
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_goto_buffer_command = 'horizontal-split'
"let g:ycm_rust_src_path = '/usr/local/rust/src'
autocmd BufNewFile,BufRead *rs set filetype=rust
let g:ycm_rust_src_path = '/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src'
"#### nerdtree
map <C-e> :NERDTreeToggle<CR>
"#### echodoc
set noshowmode
"#### vim-gutentags
let g:gutentags_project_root = ['.gosrcroot']
let g:gutentags_ctags_tagfile = '.tags'
let s:vim_tags = expand('~/.cache/tags')
let g:gutentags_cache_dir = s:vim_tags
if !isdirectory(s:vim_tags)
silent! call mkdir(s:vim_tags, 'p')
endif
set tags=./.tags;,.tags
"##### vim-go
"let g:go_metalinter_autosave = 1
"let g:go_metalinter_autosave_enabled = ['vet', 'golint', 'errcheck']
"let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
let g:go_fmt_autosave = 1
let g:go_fmt_command = "gofmt"
let g:go_fmt_options = {
\ 'gofmt': '-s',
\ 'goimports': '-local mycompany.com',
\ }
"##### f5-f11
function SetEnv(envs)
let envKeys = keys(a:envs)
for envKey in envKeys
exec 'let