Search code examples
vimautocompletelatexequationomnicomplete

In Vim, LaTeX inline equation completion


That's Vim gives us a list of matched "$ some maths symbles $" when we press some keys after typing just "$" or "$ with more maths".


Solution

  • My solution (basing on latex-box) for completing inline eqs in either inline env or numbered env

    That's you have typed two eqs, you want to type them for another time:

    % two inline eqs
    $hello$  $world$
    
    % completion in inline env
    $[part of "hello"]<ctrl-x><ctrl-o>
    
    % completion in numbered env, 
    % it's still triggered in the same way, but will leave eq without "$"
    \begin{equation}
        $[part of "world"]<ctrl-x><ctrl-o>
    

    EDIT1

    In the official repo of Latex-box, this functionality is disabled by default.

    The switch is let g:LatexBox_complete_inlineMath = 1.