Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim does not go back to the same file when exit from external command

Tags:

vim

I'm trying to compile my tex file inside vim. I have a Makefile to do the compilation, and I just type :make to call it. Usually it works well, but sometimes vim does not go back to the .tex file where I called make. Instead, I find I'm in a .cls file after pressing "ENTER or type command to continue".

I wonder what's happening? And how to make it work as I expected -- going back to the original file? Thanks.

like image 948
dlz Avatar asked Jan 30 '26 12:01

dlz


2 Answers

Looks like Vim found some errors in your code and tries to be helpful by jumping to the related file and line. According to :help make you should be able to avoid that by using :make! (notice the exclamation mark) instead:

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

like image 65
Adam Byrtek Avatar answered Feb 02 '26 18:02

Adam Byrtek


You can also call :make and let it open the file with the first error, then jump back to the original file by typing Ctrlo.

like image 35
BillyJoe Avatar answered Feb 02 '26 16:02

BillyJoe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!