Hot answers tagged

28 votes
Accepted

How do I make vim highlight math properly in the align environment?

Sometime around 2017 (I think), Dr. Chip decided that base-vim should only support syntax highlighting for base-latex. It is necessary to add in support for syntax highlighting for things available in ...
24 votes

Shortcut for inserting matching \end{something} in VIM

When using VimTeX, you can type ]] in insert mode to close the current environment.
  • 4,935
11 votes
Accepted

How can I quickly type a LaTeX accent in vim?

You could just write ó and tell latex which encoding you are using, such as \usepackage[utf8]{inputenc} you do not have to use the ascii markup for accents unless you want to.
11 votes
Accepted

How can I find invisible differences?

Since you are using vim you can use :setlocal nobomb :wq see https://stackoverflow.com/questions/295472/how-do-i-remove-the-bom-character-from-my-xml-file
7 votes

Compiling a LaTeX document manually

Here is a basic tutorial for a Unix-like system (tested on Debian GNU/Linux). Yes, one can use latexmk, arara, shell scripts, or editor functions to automate much of this, but I wanted to demonstrate ...
7 votes
Accepted

Set master file in vim-latex (TeX-Suite)

There are instructions on how to do this here. For master file called my_master.tex, create a file in either the same directory as your \input{}ed file or a directory anywhere above that one called: ...
  • 3,832
7 votes
Accepted

Don't open vim when I exit pdflatex

When TeX, in interactive mode, shows the ? prompt after an error, you have a few choices, but you should keep in mind that the first character you type determines the subsequent behavior: return ...
  • 1.0m
7 votes
Accepted

Vim does not recognize math environment (but handles other math fine)

Check if the syntax highlighting rules are up to date. Those should be located under /usr/share/vim/vim80/syntax/tex.vim. In this file there should be a block name Standard Math Zones:. Below that you'...
  • 49.8k
7 votes

Vimtex: how to display error messages?

The best way is to use \le, and here is a full list of command of vimtex (from the official document) ---------------------------------------------------------------------~ LHS RHS ...
  • 308
6 votes

How to setup synctex with vim, pdflatex and an open-source PDF-viewer under Linux?

Following frabjous's answer and with some inputs from this blogpost I got this working with GVim + Zathura. Important things to do are: Configure ~/.config/zathura/zathurarc to setup inverse search ...
  • 190
6 votes

Errors/Warnings in LaTeX Output

To make things easier: The LaTeX build wrapper ltx2any offers a nice (and aesthetical very pleasing) summary of any error or warnings in different file formates, amongst them pdf and markdown. From ...
6 votes

How to set automatic folding of newcommands and usepackages in vim?

I don't know about automatic folding, but you should comment your fold markers : %{{{ and %}}}, otherwise they will be read by TeX. Also, you can put your opening fold marker at the end of the \...
  • 6,241
6 votes
Accepted

Entering \ll command to compile using LaTeX suite plug-in to MacVim

Turning my comment into an answer: The \ stands for your leader, which is a definable key in vim for special shortcuts. You can set your leader with let mapleader = "<leader>" in your vimrc ...
  • 49.8k
5 votes

vim-LaTeX does not run bibTeX

Looks strange, have you solved the problem? For me, add the following line into .vimrc solved the problem let g:Tex_MultipleCompileFormats='pdf,bib,pdf' And my default pdf compileFormat is XeLaTeX
  • 203
5 votes

vim-LaTeX does not run bibTeX

I had the same problem with a project consisting of lots of separate .tex source files. I found that BibTeX is not called when I use \include{other_file} in my main file where other_file has new/...
  • 51
5 votes

vim LateX-Suite indentation and line breaking

The breakintent feature has been finally merged into vim, see https://retracile.net/wiki/VimBreakIndent. You can now simply use set breakindent or combine it with other methods like set showbreak=....
5 votes
Accepted

Vimtex: how to display error messages?

The vimtex plugin populates the quick fix view with the errors. It should actually open automatically (by default) in a bottom split-window. It is weird that it does not for you. Invoking :copen ...
5 votes
Accepted

vim/vimtex editing text in curly braces

You need ci{ or ci} orciB. Vim has the notion of text-objects. From :he object-select This is a series of commands that can only be used while in Visual mode or after an operator. The commands ...
  • 61.4k
5 votes
Accepted

Dollar sign breaks syntax highlighting in Vim

If Vim fails to detect that the dollar sign is used in a verbatim environment, it probably means it is not using the right syntax highlighting flavour. Use :set syntax to find out which syntax ...
4 votes

Getting \cite{} autocompletion to work in gvim with latex-suite on windows 7

Sorry to be a necromancer, but this is the top google result for this problem and I feel like this thread is missing an important bit of info for Windows users working in Cygwin and/or Babun For ...
  • 141
4 votes

Biber backend and Vim-Latex

After the answer by Paul and Werner above didn't work for me, I did the following, based on what they wrote: In ~/.vimrc, I added: let g:Tex_BibtexFlavor = 'biber' let g:Tex_DefaultTargetFormat="...
  • 1,309
4 votes

\cite{} autocompletion in VIM in non tex file

There is now a plugin to complete citation tags for asciidoc documents. vim-autocite
  • 786
4 votes
Accepted

LaTeX-Vim Return to edit after error?

A possible command for going back to the previously edited file is: Ctrl+^ and another option is: :e#
  • 76
4 votes
Accepted

Redefine smart key mappings in vim's Latex-suite plugin

I'm not sure why what you tried didn't work (maybe you have to disable Smart Dots), disabling Smart Dots with let g:Tex_SmartKeyDot=0 in my vimrc and appending call IMAP('...', '\dots','tex') to ...
  • 56
4 votes

Turn off Vim spellcheck in custom region

By placing that line by itself in ~/.vim/after/syntax/tex.vim instead of adding it to a copy of $VIMRUNTIME/syntax/tex.vim in ~/.vim/syntax/tex.vim, the spell checking behavior was disabled between \...
4 votes
Accepted

Configure vim-latex suite to use treat .tikz files as ordinary .tex files

Add the following lines to the ~/.vimrc file (or create it if doesn't exist): syntax on filetype on au BufNewFile,BufRead *.tikz set filetype=tex
  • 2,128
4 votes

lstlisting: highlighting for vimscript

The listings package does not support vimscript out of the box. You'd have to write your own highlighting rules. Here I present an alternative, which is the minted package. It uses the external ...
4 votes

How do I set XeLaTeX as my default engine?

Without considering your tex editor, in order to compile your tex file with xelatex, add %!TeX program = xelatex to the first line of your source code. Because according to this link, Vimtex supports ...
  • 777
4 votes
Accepted

Vim: spell-check words with diacritics

My suggestion is to enter the text already encoded as UTF-8 and then to instruct vim to accept other than, or additional languages to English for the spell check. With the following example containing ...
4 votes

Dollar sign breaks syntax highlighting in Vim

As the other answer says, if you are writing LaTeX you should have let g:tex_flavor="latex" set in the .vimrc. With that, Vim will skip highlighting verbatim environments but it will still ...

Only top scored, non community-wiki answers of a minimum length are eligible