I have been using vim for a while now and have some plugins including syntastic.

I got a project with fileA.cpp fileA.h fileB.cpp fileB.h

While debugging, I run vim fileA.cpp, and it will open fileB.h. I do not understand why—I cannot open fileA.cpp at all. Any guess what might cause that?

fg indicates no such job.

I suppose it could be syntastic telling me an included file contains errors which have to be resolved before opening the desired file.

For example, fileB.h is included in fileA.cpp. Because fileB.h contains an error it will jump to that file.

Can anyone explain to me how to turn this off?

  • 1
    Welcome to Vi and Vim! Can you reproduce this issue when you run vim --clean or vim -u NONE? If so, you might want to see How to debug my vimrc
    – D. Ben Knoble
    Commented Jul 25, 2020 at 20:06
  • thanks! When using vim --clean it isn't reproducing the error.
    – spaceKelan
    Commented Jul 27, 2020 at 14:25
  • that’s a good indicator that something in your config or a plugin is the cause. Check out the debugging link I gave and see what other info you can get from that.
    – D. Ben Knoble
    Commented Jul 27, 2020 at 14:32
  • Thanks for your help. It is the option let:syntastic_auto_jump = 1 (2 or 3). All options lead to the auto jump to the first error, regardless of in which file it is. So it is impossible to use this option if you want to access the first error in the exact file. Good to know. Thanks for your supportive know-how.
    – spaceKelan
    Commented Jul 29, 2020 at 21:49
  • no problem ! Please add an answer if you were able to solve your problem
    – D. Ben Knoble
    Commented Jul 29, 2020 at 21:50

1 Answer 1


The flag let g:syntastic_auto_jump = 1 jumps to the first error as soon as :w is commanded, automatically.

In case a header contains an error it will jump there immediately. Therefore, if the header is compromised that flag prohibits to enter the main file.

Commenting this flag out fixed the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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