开发者

Reopen a file closed by vim quickfix

When I use vim's quickfix to jump to errors in my build, if the file containing an error isn't already open it opens it in one o开发者_运维百科f my splits, replacing the file I had open.

Is there a way to either reopen last closed file in a split or get quickfix to open files in a new split?


Try using <C-o> in normal mode. It takes you to the previous position, even if previous position was in other file.


If you have the quickfix window open then pressing <ctrl-W><enter> while the cursor is on the error you want to go to will open the file in a new split window.


what I do in this case is the following: before starting the compilation process I first split the window

:sp

After the compilation process I just go to the original window (the one I created with split) and do CTRL-w+o closing other windows and leaving me in the original position.


You can use :cn :cp :cl to jump to previous/next/list errors in a build. This way you can :bn and then :bp. Or use markers: ma, 'a.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜