I'm not sure if it has always happened or its just recent, but vim auto-compiles on each save (:w
). I would like to only manually compile (I use a hot-keyed pdflatex command instead).
I've had a quick google and read through the manual and nothing has jumped out at me. Anyone know how to do this?
Update: Relevant lines in vimrc
Plug 'vim-latex/vim-latex'
let g:tex_flavor='latex'
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" `Ctrl` + `P` compiles latest save of current .tex file to pdf
autocmd FileType tex nnoremap <c-p> <ESC>:!pdflatex %<CR>
NB: Plug-in manager is junegunn/vim-plug
Update 2: Turns out I did it back when I first got latex.. Really should be keeping a record of changes I make
:w
. Could you try a minimal installation as described here: vi.stackexchange.com/questions/17945/…? – Hotschke Mar 3 '19 at 11:37autocmd FileType tex nmap <c-p> <Plug>Tex_Compile
instead of yours. The quickfix list is then automatically filled with LaTeX errors which makes it easier to navigate to them. For example, try it with aHello World
file and add deliberately an error by inserting_
outside of a math environment. After compilation your cursor should immediately be placed on the line with the_
. – Hotschke Mar 3 '19 at 11:41let g:Tex_DefaultTargetFormat = 'pdf'
. – Hotschke Mar 3 '19 at 11:51