dongqiuwei8667 2016-06-12 01:17
浏览 135
已采纳

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']
    

    instead

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?