An alternative is one tool for one job :
Code highlighting : just vim
In .vimrc : syntax on
Folding : just vim
In .vimrc : set fdm=marker
Commands : zc, zo, zr, zm.
I open and close a section with %{{{1 and %}}}, a subsection with %{{{2 %}}}. A long TikZ code goes in %{{{ and %}}}= so it is immune to zr or zm.
Spell checking : just vim
In ftplugin/tex.vim (filetype plugin on in .vimrc):
setlocal spell
In normal mode:
- zg (add Good word to local dict.).
- zw (remove wrong word from local dict.)
Compiling 1 : just vim8.1
:term latexmk -pdf -pv %
Compiling 2 : latexmk (in tmux using Dispatch in vim)
- When pressing
<LocalLeader>L, latexmk compiles in the background and the pdf shows up on success. On failure, I press :Copen to view the error messages in a vim split.
- When pressing
<LocalLeader>l, latexmk spits out its output in a vim split (actually in a tmux split during compilation) and the pdf shows up.
Here are the commands in ftplugin/tex.vim:
nnoremap <LocalLeader>l :w<CR> :Dispatch latexmk -pdf -pv -halt-on-error %<CR>
nnoremap <LocalLeader>L :w<CR> :Dispatch! latexmk -pdf -pv -halt-on-error %<CR>
Code checking / Linting : ALE (using chktex)
In ftplugin/tex.vim (filetype plugin on in .vimrc) :
execute "packadd ale"
let b:ale_fixers = ['remove_trailing_lines', 'trim_whitespace']
let b:ale_linters = ['chktex’]
NOTE: To ignore the error type 6 at a particular line, I add that to its end % chktek 6
Grammar checking : vim-grammarous
In ftplugin/tex.vim (filetype plugin on in .vimrc):
execute "packadd vim-grammarous"
nnoremap <LocalLeader>g :GrammarousCheck --lang=fr<CR>
vnoremap <LocalLeader>g :'<,'>GrammarousCheck --lang=fr<CR>
nnoremap <LocalLeader>G :GrammarousReset<CR>