3

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.

dlz
  • 141
  • 7

3 Answers3

3

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.

Adam Byrtek
  • 12,011
  • 2
  • 32
  • 32
2

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.

BillyJoe
  • 878
  • 7
  • 25
0

There is another question that might be related: How do I disable the "Press ENTER or type command to continue" prompt in Vim?

I am using this configuration:

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

Pressing F10 key in normal mode saves me the tex file and calls make and returns to editing the file.

Community
  • 1
  • 1
kyticka
  • 604
  • 8
  • 19
  • Thanks for the quick answer. I actually encounter that question when searching Google before posting this question. Pressing ENTER to go back is fine with my. My problem is that I can not go back to the original file. – dlz Apr 17 '17 at 15:09