11

You can disable spell checking for syntax items by adding them to a cluster together with @NoSpell. You can read :help spell-syntax for some information and look at your tex syntax file which most likely contains several examples already. If you type :tabe $VIMRUNTIME/syntax/tex.vim you should get the tex syntax file in a new tab. If you then search /\c@...


9

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:vimtex_fold_manual which if enabled (set to nonzero value) will set foldmethod=manual, and instead will remap zx and zX to recalculate the folds when necessary (...


7

You are looking for set iskeyword-=: That is, making : explicitly not a keyword character. If : is in iskeyword it will be included in ciw.


6

You can add your own syntax rules to e.g. ~/.vim/after/syntax/tex.vim. In order to prevent spell checking inside a command such as \url, you can use the following code: syntax match texStatement '\\command' nextgroup=texMyCommand syntax region texMyCommand matchgroup=Delimiter start='{' end='}' contained contains=@NoSpell Here texStatement and Delimiter ...


6

To install with vim-pathogen, this should work (taken directly from the readme, I just swapped vim-sensible with vimtex): Now any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the 'runtimepath'. Observe: cd ~/.vim/bundle git clone https://github.com/lervag/vimtex.git Now vimtex is ...


6

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:tex_conceal. For direct control of the conceal feature itself, see :help conceallevel, :help concealcursor and :help syn-conceal. Short answer, you can put the ...


5

Since i$ is a mapping itself (defined by the vimtex plug-in), you need a recursive mapping to be able to use i$ as part of the expansion of your mapping. So this should work: nmap cim ci$ But you can also create an operator-pending mode mapping for im, in which case that would work with other operations such as dim or yim and other built-in or custom ...


5

In vimtex, the mappings like ie are actually vim text objects (not sure about the right vim nomenclature though). They work together with vim operators like d (delete). In particular ie stands for any tex environment like equation, itemize, .... For example, if you cursor is somewhere inside \begin{equation} Ax = b \end{equation} the command die will ...


5

:imap ) <Plug>vimtex#delim#close() You are supposed to deal with "Plug mappings" just like you would deal with any other mapping. First, since you want to reuse another mapping in your own mapping you must use a recursive mapping. :inoremap is a non-recursive mapping, :imap is a recursive mapping. Second, since <Plug>vimtex#delim#close() is ...


5

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 rule for tex command arguments allows spell checking. Some commands, e.g. \include{...}, are not spell checked. This is controlled by the @Spell and @NoSpell ...


4

I had exactly the same problem when trying to get vimtex working with Skim. That is, I had vim 8 installed with --with-client-server (showing as +clientserver) and XQuartz running but --servername option was just ignored. The solution for me was setting DISPLAY: export DISPLAY=:0.0 After that everything worked exactly as it should. Edit: help x11-...


3

If I understand your question correctly, you are trying to use the vimtex keybinding for the <plug>(vimtex-compile) command and you're expecting it should be available under ;ll, since you have let mapleader = ';' at the start of your _vimrc. If that's the case, the problem you're having is that vimtex actually uses the <localleader> (not <...


3

N represents Normal mode and O represents operational mode and X represents Ex mode. Mappings can be done in normal, ex (similar to command line), visual, insert and operational mode as well. To know more, http://vimdoc.sourceforge.net/htmldoc/intro.html Vim knows to distinguish key mappings and predefined commands. For example, if you have a mapping like ...


3

This is a question that is difficult to write a very rigorous answer to. But I find it easy to state that the prospects are not quite good. At least not if you try to include the corner cases. As you say, you must identify periods and punctuations, but you should also parse many macros, such as \emph{...}, and you should parse stuff like some text {\macro ...


3

The <F7> key is enabled by default, unless you have other mappings either in your vimrc file or in another plugin that conflicts with the vimtex mapping. You can use the mapping in both insert mode and in normal mode. In insert mode, you can use it to make the word in front of the cursor into a command, i.e. test<f7> => \test{ FYI: If you ...


3

Rather than changing the way text is actually stored by writing a custom 'formatexpr', I'd be tempted to just to use Vim's existing features to solve the stated goals of easy readability and easy "diff"-ability. Long lines are easily readable in Vim with the following set: :set wrap :set linebreak And changes towards the end of a line are also perfectly ...


3

Well, they are two different implementations, so obviously they will use different amounts of time. vimtex indentation does more, which makes it slower. But I've worked hard on making it fast, and as far as I know, it should not be unreasonable slow for daily use. Note, indenting a whole ~500 line file with gg=G should not be a "daily" activity. Indentation ...


3

UPDATE: Latest vimtex includes PR #1711 which allows you to configure vimtex to override existing mappings by setting this global variable from your vimrc: let g:vimtex_mappings_override_existing = 1 So the recommended solution for this problem is update your vimtex to latest and include this variable setting in your vimrc. OLDER UPDATE: It turns out ...


3

First you need to create your command as local to a buffer, :h :command-buffer tells us that is what the argument -buffer is for. Then I think it's better to use ftplugins (:h ftplugin) to do this kind of things rather and a Filetype autocommand which just duplicate a built-in mechanism. So you could create ~/.vim/after/ftplugin/rmd.vim and put that in it: ...


2

Neocomplete is an alternative that may have different snippets and is compatible with the UltiSnips repository. Other than that if you can't find what you are looking for, you might have to create your own as statox stated.


2

Short answer: add let g:tex_flavor = 'latex' to your vimrc file. So, more details. First: This problem is not related to vimtex. vimtex depends on the internal tex plugin, e.g. for filetype detection and syntax, and this particular problem is with how the internal tex plugin recognizes the filetype. To be more specific, the internal tex plugin differs ...


2

I do not know whether you have found a solution in the mean time, but according to this post https://stackoverflow.com/questions/606191/convert-bytes-to-a-string you have to decode the bytes object, so that the snippet becomes: snippet 'math(.*)math' "math" wr `!p import subprocess code = match.group(1) code = 'ToString[' + code + ',TeXForm]' res = ...


2

Most of auto-completion works with keywords, so the set of characters that make up possible completion prefixes and candidates is controlled by the 'iskeyword' setting. For instance, under :help compl-current you'll find: If there is a keyword in front of the cursor (a name made out of alphabetic characters and characters in 'iskeyword'), it is used as ...


2

This behavior is from vim-surround. From its source code, pressing either l or \ will result in \begin. To change the default behavior, refer to :h surround-customizing. First, find the number corresponding to \. In this case, we would find it with :echo char2nr("\\"), which gives 92. Then, declare the variable corresponding to this number. In this case, ...


2

You can also put the following in your .vimrc: xmap dsm <plug>(vimtex-env-delete-math) xmap csm <plug>(vimtex-env-change-math) xmap am <plug>(vimtex-a$) xmap im <plug>(vimtex-i$) omap dsm <plug>(vimtex-env-delete-math) omap csm <plug>(vimtex-env-change-math) omap am <plug>(vimtex-a$) ...


2

I think would be useful a "Toggle" mapping that allows us to swich concealling level: nnoremap <Leader>c :let &cole=(&cole == 2) ? 0 : 2 <bar> echo 'conceallevel ' . &cole <CR>


2

Combine vim-ninja-feet and targets.vim Preliminary steps Change $ from separator to quote augroup mytargets autocmd! autocmd User targets#mappings#user call targets#mappings#extend({ \ '$':{'quote': [{'d': '\$'}]}, \ }) augroup END I do not know how to make this change filetype-specific. If someone knows this, feel free to adjust ...


2

I wanted to write and edit a .tex document as fast as possible, so I followed this guide, but I can't get vimtex to work properly. If you just want to edit a .tex document and not want to spend time learning tools, then I suggest you consider to use something like TeX maker. It should work well out of the box and the barrier to entry is very low. If you ...


1

You can use a match for a \$, using a look-behind to match other equations enclosed in pairs of $s. That way you'll know you're always matching the first $ of each equation. This search will work: /\(^\([^$]\|\$[^$]\+\$\)\+\)\@<=\$ See :help /\@<= for the look-behind operator. The rest of the regex should be (relatively) straightforward, the look-...


1

The problem you are describing seems to be clearly concerning the vimtex plugin. The proper solution is therefore to raise this issue where it should be raised, i.e. at vimtex's issue tracker. However, no need, I just fixed the issue, so if you update your plugins, then this indentation issue should be resolved. Please open an issue at the issue tracker if ...


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