how to go back to main file after during navigation through errors

36 views
Skip to first unread message

Artem Bursuk

unread,
Nov 18, 2015, 3:43:38 PM11/18/15
to vim-syntastic
hey, what's up guys!

I'm trying to figure out, is it possible to go back to the main file.
The situation is following: I messed up in my code, It's generating me an errors list. few of them pointing to the c++ standard library's file. When i write :lnext it automatically opens a file from std where it thinks error is. Ok, how can I go back to my file? I know two options: e ./.. or t 1. Both do not satisfy myself. Because when I go back to my file, the current error is the first one. It means I cannot move below error which directs me into std lib's file. How can I handle this?

thank you in advance

LCD 47

unread,
Nov 18, 2015, 4:07:30 PM11/18/15
to vim-syntastic
On 18 November 2015, Artem Bursuk <a.bu...@gmail.com> wrote:
> hey, what's up guys!
>
> I'm trying to figure out, is it possible to go back to the main file.
> The situation is following: I messed up in my code, It's generating
> me an errors list. few of them pointing to the c++ standard library's
> file.

Side note: you might find this useful:

:help syntastic-filtering-errors

> When i write :lnext it automatically opens a file from std where it
> thinks error is. Ok, how can I go back to my file?

:bp , or [b (the latter if you have followed the advice in the
FAQ[1] to install Tim Pope's unimpaired[2]). Both will take you to the
previous buffer, rather than to the original file (but both will get
you there eventually, if you keep hitting them). There is no command
to go straight to the original file, and you have Vim itself to thank
for that, since navigation through quickfix lists is Vim's doing, not
syntastic's.

> I know two options: e ./.. or t 1. Both do not satisfy myself.
> Because when I go back to my file, the current error is the first one.

Only if you have issues in the current file. It's entirely
conceivable that all issues are in included files.

> It means I cannot move below error which directs me into std lib's
> file. How can I handle this?

The same way you handle most Vim problems: swear, ask yourself
why you keep using this editor, and find a creative workaround. The
Official Workarounds[TM] for this are :bp, and [b.

/lcd

[1]: https://github.com/scrooloose/syntastic#faqlnext
[2]: https://github.com/tpope/vim-unimpaired
Reply all
Reply to author
Forward
0 new messages