I recently installed some plugins on vim, and since then every file write is triggering a build process, showing errors in the file (here's a C++ file):

enter image description here

The problem is, I'm pretty new to vim and am not sure which plugin is causing it. It'd be great if someone can help me out. I have the following in my ~/.vim/bundle:

  • minibufexpl.vim
  • nerdtree
  • syntastic
  • tagbar
  • tlib_vim
  • vim-addon-mw-utils
  • vim-snipmate
  • vim-snippets

And here's my ~/.vimrc:

syntax on
colorscheme papayawhip
set smartindent
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab
set number
set nowrap

"do not use the irritating red bg for highlighting errors
hi Error None

"load plugins in bundle automatically
execute pathogen#infect()

"autocmd vimenter * NERDTree

map <C-v> :NERDTreeToggle<CR>
:nnoremap <C-n> :bnext<CR>
:nnoremap <C-p> :bprevious<CR>

Please help!

  • 2
    Nothing leaps out at me as causing that but I don't use all those plugins. I'd try doing a binary search for the plugin causing the problem by turning off half of them. If that fixes it, turn half back on, etc. If that doesn't point to anything and no one answers here, maybe ask again on vi.stackexchange.com. – blm Nov 13 '15 at 18:37
  • @blm Genius idea! :D :D I'll try it if no other suggestion works. By the way, which plugins do you use/recommend to make vim work like an IDE? – ankush981 Nov 14 '15 at 3:58
  • @blm It worked! The culprit was Syntastic, which has a "helpful" file checker built in. Arrrrrrrgh! – ankush981 Nov 14 '15 at 4:09
  • Ok, that makes sense. From the Syntastic README: "Syntastic is a syntax checking plugin for Vim that runs files through external syntax checkers and displays any resulting errors to the user. This can be done on demand, or automatically as files are saved." I'd guess the "external syntax checkers" for C/C++ is just the C compiler with some options. Glad you found it! – blm Nov 14 '15 at 17:53
  • 1
    Of course it's Syntastic. Why would you install that thing if you don't want what it does? – romainl Nov 14 '15 at 21:48

This will probably show you what plugin is doing it:

:verbose autocmd FileWritePre,FileWritePost

You will see several auto-commands, but the one that runs a :make will be the culprit.

  • No make here. Here's the full output: pastebin.com/0xjYWM2F – ankush981 Nov 14 '15 at 4:01
  • But removing plugins one by one solved it for me (see comments to original question). Thanks anyway! :-) – ankush981 Nov 14 '15 at 4:10
  • 1
    I assumed it would be triggering post-write, but it might be triggering pre-write, so I updated my answer. Also, it's possible it wasn't actually running ":make", but since I don't know what the alternative would be, I left that part. – Heptite Nov 14 '15 at 4:46

Answering my own question so that it can be closed. As I removed plugins one by one, I found that the behavior was being caused by Syntastic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.