Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable jumping to warning location after compile in vim-latex?

Tags:

vim

latex

After compilation, vim-latex opens a quickfix buffer, lists errors and warnings, and jumps to the first error or warning in the list. How do I make it not jump for warnings? or better yet, for certain warnings?

If this is not possible, is there some shortcut for returning the cursor back to its position before the jump?

NOTE: Ignoring warnings via let g:TexIgnoredWarnings = ... is not adequate since I do want to see the warnings.

like image 871
alexei Avatar asked May 01 '13 20:05

alexei


2 Answers

If you're compiling via Vim-Latex's \ll command as I do, then adding the following option in either your vimrc or the ftplugin tex.vim should solve your problem:

let g:Tex_GotoError=0

This will leave your cursor where it was, but still populate the QuickFix window with warnings and errors. The documentation (linked below) says that it defaults to on, so switching it off should accomplish what you want.

http://vim-latex.sourceforge.net/documentation/latex-suite.html#Tex_GotoError

like image 104
John Avatar answered Oct 18 '22 04:10

John


I assume you are compiling LaTeX with the :make command. The help for that command gives a list detailing exactly what the command does, including:

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

If you trigger your compilation with :make! or the abbreviation :mak! instead of :make, then the cursor will not jump.


vim also saves a list of places your cursor has been recently. You can jump back to your previous location with Ctrl-O, and then jump forward again with Ctrl-I Use :help jump-motions to see more about this feature.

like image 37
andrewdotn Avatar answered Oct 18 '22 05:10

andrewdotn