I'm using Vim with LaTeX-Suite. Occasionally when I compile a file with errors using <Leader>ll, the error in my source is such that the LaTeX compiler registers an error in a file deep in the bowels of my TeX distribution, say pstricks-add.tex or something, so it automatically opens this irrelevant file in the window.

Since the actual error is in my source, I'd like to surpress this behavior, and only have it open the file when I press Enter after selecting it in the Quickfix window.


The proper, erroneous line in my source is displayed in the .log file window below the Quickfix window

I have the following in my .vimrc:

" compile to pdf                              
let g:Tex_DefaultTargetFormat = 'pdf' 

" pdf compile and view settings                                
let g:Tex_ViewRule_pdf = 'open -a Preview'
let g:Tex_CompileRule_pdf = 'latexmk -pdf'

" ignore all warnings below level 4
let g:TCLevel = 4

" one last thing for latex
let g:tex_flavor = 'latex'

let g:Tex_GotoError=0

in your ~/.vimrc should do pretty much what you want.


According to the LaTeX-Suite documentation, pressing

\ll will take you to the location of the first warning/error.

Keeping this feature enabled may be desirable. If it opens a separate file, then we can quickly return to the original file and location by pressing either




as mentioned in these posts: https://stackoverflow.com/questions/19971023/how-to-go-back-to-previous-opened-file-in-vim and https://stackoverflow.com/questions/133626/how-do-you-return-from-gf-in-vim. If it doesn't open a separate file, then we have the advantage of the cursor being moved to the location of the first warning/error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.