2016-06-12 01:17
浏览 134

vim-go / synstastic错误不会在保存时自动显示

I noticed that when I save a file and I have a syntax error in my code, the error quickfix window does not automatically appear. I recently rebuilt my system and simply copied over my .vim/ directory along with the same .vimrcfile. I've done this before and have never had any issues. However, if I manually enter :GoErrCheck or GoBuild, the window shows up. What gives?

Here is my .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    
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • douping5015 2016-06-12 06:48

    Readme file in vim-go explains its usage with 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"

    In this issue

    One recommendation is to remove the lines

    let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
    let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': 

    and use

    let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']


    解决 无用
    打赏 举报

相关推荐 更多相似问题