Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
38 votes

What are the differences between LaTeX plugins?

I will not provide an in-depth comparison, as I only have limited experience with the different plugins. I know a couple of plugins well (LaTeX-Box and LaTeX-Suite), and I know one plugin very well, ...
user avatar
16 votes
Accepted

How do I get Vim to compile my .tex file when executing :w?

Don't be so inefficient! Your time is valuable. Use the vimtex plugin offered by @lervag: see here. You can control all of the plugins you install by using Vundle or any similar plugin manager (vim-...
user avatar
13 votes

What are the differences between LaTeX plugins?

I can't do comparison, as Vim-LaTeX is the only LaTeX plugin I've used. I have been using Vim-LaTeX for almost a year. So I will talk about Vim-LaTeX alone. There are many features present in Vim-...
user avatar
  • 383
11 votes
Accepted

Filetype that LaTeX should be

When there's not enough information to decide otherwise, 'filetype' is set to the most basic -- plaintex. Your existing file must have had enough content for the detection to determine that it was ...
user avatar
  • 10.3k
10 votes

How can I treat LaTeX quotes as a text object?

I don't know LaTeX but this seems to work: vnoremap iq :<C-U>silent! normal! t'vT`<CR> omap iq :normal viq<CR> I based this off the information over here: http://vim.wikia.com/wiki/...
user avatar
  • 631
10 votes
Accepted

How can I lookup LaTeX symbols in Vim?

To expand commands in LaTeX, I use a dictionary copied from latex-suite (in details, this one) and put it in ~/.vim/dictionaries and then using autocmd FileType * exec("setlocal dictionary+=".$HOME."/...
user avatar
  • 728
9 votes
Accepted

Folding slow with vimtex

First: Did you bother to read the vimtex documentation, i.e. :h vimtex-folding? The docs clearly point out that the fold-expr method of folding is slow, and so therefore provides an option g:...
user avatar
8 votes

How can I treat LaTeX quotes as a text object?

Edit: I just discovered the vim-textobject-latex plugin, which adds the exact functionality you're looking for (in addition to a few other things). From the plugin's README: Currently supported text ...
user avatar
7 votes
Accepted

Call PDF viewer on the compiled tex file

% indeed stands for the current file. %:r (see :help filename-modifiers) strips off the file extension. You can then use :! to launch an external command, e.g. the PDF viewer: :! zathura %:r.pdf
user avatar
  • 16.6k
7 votes
Accepted

How can I make quick environment or command changes in LaTeX

If you use the vimtex plugin, you can: Change an enclosing command using csc: According to the help, a ysc corresponding to the commands offered by surround.vim isn't available, but can be added. ...
user avatar
  • 23.7k
7 votes
Accepted

Use search matches as parameters in external command

To avoid leaving the buffer for entering the password, you can use sudo's -S flag: -S, --stdin Write the prompt to the standard error and read the password from the ...
user avatar
  • 23.7k
7 votes
Accepted

Unable to set iskeyword for colon ( : ) character

You are looking for set iskeyword-=: That is, making : explicitly not a keyword character. If : is in iskeyword it will be included in ciw.
user avatar
  • 12.6k
7 votes
Accepted

How to force vimtex to display \textbf and \textit in insert/normal mode?

This is not due to vimtex directly, but due to the conceal feature in Vim. vimtex only adds to the syntax plugin that ships with Vim/neovim, and it adhers to the relevant option, see :help g:...
user avatar
7 votes

Yank both sides of equation

This can be done with either regex+substitute or macros Substitute. This is the same as your regex except the important parts are surrounded by \( . \) to create capture groups. These are referred ...
user avatar
  • 12.6k
7 votes
Accepted

Why does vim still auto-indent LaTeX after I set noai noci nosi?

'indentexpr' has the highest priority of how vim can automatically indent lines. :h 'indentexpr': When this option is not empty, it overrules the 'cindent' and 'smartindent' indenting. Your ...
user avatar
  • 3,960
6 votes
Accepted

Make % jump between identical delimiters

What you ask is possible, but the solution is nontrivial. Both LaTeX-Box and vimtex has implemented solutions for this, see here: LaTeX-Box/ftplugin/latex-box/motion.vim:57 (s:FindMatchingPair) ...
user avatar
5 votes
Accepted

Mathematical expressions in TeX files are displayed in a human-readable way

This functionality comes from the internal LaTeX plugin. See :h tex-conceal and :h g:tex_conceal. You can turn it off either by setting conceallevel=0 or by letting g:tex_conceal=''. To be more ...
user avatar
5 votes
Accepted

Completion past special characters

If the chapter, section etc. labels are in the same file, or in any other open buffers, you can still use Ctrl-n/Ctrl-p. You just have to add : to the keyword characters, with: :set iskeyword+=: ...
user avatar
  • 9,260
5 votes
Accepted

change meaning of "paragraph" for TeX input?

One way to do it employs the ie (inside-environment) custom text object, available in a number of places: e.g. in the plugin vimtex, or with vim-textobj-latex (and there are others). With this ...
user avatar
  • 9,260
5 votes
Accepted

Context sensitive insert mode mapping or abbreviation

Perhaps like this: let s:TeXmaps = { \ '`a': '\alpha', \ '`b': '\beta', \ '->': '\to', \ '=>': '\Rightarrow' } function! <SID>IsTeXMath() return &ft ==# 'tex' &...
user avatar
  • 3,568
5 votes

How can I fix the auto indentation in LaTeX?

The documentation for the indentation plugin for LaTeX is unfortunately not available in the help files, but it is written in the source code in $VIMRUNTIME/indent/tex.vim. The following variables are ...
user avatar
5 votes
Accepted

How do I spellcheck TeX files using vim-lexical, skipping some command arguments but not others?

First: This is not related to vim-lexical. Syntax rules define where spell checking should be done, and so the current behaviour is defined by the internal syntax plugin for LaTeX. The default syntax ...
user avatar
5 votes
Accepted

Compiling whole LaTeX projects

I would say that you are approaching this the wrong way. If you want to use a very minimalistic solution without any plugins, I would claim that you should not have anything in your vimrc file for ...
user avatar
5 votes
Accepted

Indentation in Latex within a list after an equation

The reason this is happening is because the indentexpr [1] prefers text to be indented inside \items. You can see this by pressing gg=G. This is what it considers correct indenting: \begin{document}...
user avatar
  • 12.6k
5 votes

Syntax of :endif in if-statements

Rather than figuring out what's going on with your existing mappings, it's easier and more readable just to use a function, instead: nnoremap <F5> :call <SID>compile_latex()<CR> ...
user avatar
  • 27.4k
5 votes
Accepted

Trigger reindentation after snippet has expanded to word in 'indentkeys'

You can manually fix the indent by typing CTRL-F (this is documented at :help indentkeys-format). Thus, an autonomous solution would be to issue this key-press after snippet expansion. global !p def ...
user avatar
  • 12.6k
5 votes
Accepted

Unable to conditionally test for presence of a plugin command & invoke it

The problem is, your vimrc file is executed before any plugins are loaded. You can check the order of what source files are loaded by issueing the :scriptnames command. The usual way to fix this ...
user avatar
5 votes
Accepted

Silence command but not its output

As Ben said in the comments prompting the command used before its result is a built-in behavior that you can not change without modifying Vim's source code. However a possible workaround is to use :h ...
user avatar
  • 45.9k
4 votes
Accepted

Remove eqnarray from Vim LaTeX

While infuriating, a number of vim-latex's features can be customised without editing the source code. Disable the EEA mapping In .vim/after/ftplugin/tex.vim, add call IMAP('EEA', 'EEA', 'tex') ...
user avatar
  • 156

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