Vim does not return to the same file when exiting an external command

I am trying to compile my tex file inside vim. I have a Makefile to compile and I just type :make

to call it. This usually works well, but sometimes vim doesn't come back to the .tex file where I called make. Instead, I find myself in a .cls file after pressing "ENTER or type command to continue".

Wondering what's going on? And how do I get it to work as I expected - revert to the original file? Thank.

+3


source to share


3 answers


It looks like Vim has caught some bugs in your code and is trying to be helpful by jumping to the appropriate file and line. As per :help make

you can avoid this by using :make!

(note the exclamation mark):



If [!] is not given the first error is jumped to.

+3


source


You can also invoke :make

and open the file with the first error and then return to the original file by typing Ctrl o.



+2


source


There is one more question that may be related: How to disable "Press ENTER or enter command to continue" prompt in Vim?

I am using this config:

map <F10> :w<CR>:!make<CR><CR>

      

Pressing F10 normally saves the tex file to me and calls make and returns editing the file.

0


source







All Articles