我注意到当我保存一个文件并且我的代码中有语法错误时,错误快速修复窗口不会自动出现。我最近重建了我的系统并简单地复制了我的 .vim/
目录以及相同的 .vimrc
文件。我以前做过这个,从来没有遇到过任何问题。但是,如果我手动输入 :GoErrCheck
或 GoBuild
,该窗口就会出现。给了什么?
这是我的.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set nu
set completeopt-=preview
set encoding=utf-8 " Set default encoding to UTF-8
set autoread
set laststatus=2
set noswapfile " Don't use swapfile
set nobackup " Don't create annoying backup files
"
nmap <Leader>t :TagbarToggle<CR>
autocmd FileType qf wincmd J
"CtrlP Settings
let g:ctrlp_show_hidden = 1
let g:neocomplete#enable_at_startup = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 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:molokai_original = 1
let mapleader=","
colorscheme molokai
最佳答案
自述文件在 vim-go
中用 syantastic
Sometimes when using both vim-go and syntastic Vim will start lagging while saving and opening files. The following fixes this:
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
Another issue with vim-go and syntastic is that the location list window that contains the output of commands such as :GoBuild and :GoTest might not appear. To resolve this:
let g:go_list_type = "quickfix"
一个建议是删除线条
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes':
并使用
let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
代替
关于vim-go/synstatic 错误不会在保存时自动显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37769882/