0

I have recently managed to install and configure vim-latex and started using it. I used to use TexStudio for writing my file and in it I used to have several setting that were tailored for my workflow:

  1. I had a key combination (Shift+F1) that automatically inserted the inline equation $|$ and moved the cursor between the dolar signs. Is there a way to do the same in vim-latex? Maybe add an extra Alt Key Macro such that when I type $ then press <Alt+L> it will insert and do what I want.
  2. I had a similar shortcut to inser the english quotes in the text (I like them because they look better). So when I press Shift+F2 it will insert ``|''. Can I do the same thing with vim-latex?
  3. This one is a bit weird: I like to have every phrase in a different row in my latex document. So I have TexStudio to automatically insert a space and after I inserted a full stop.
  4. Another one setting was to automatically insert curly brackets when in math mode for subscript and superscript and move the cursor inside the curly brackets.
  5. Is vim-latex able to recognize the \newcommand definitions in the document preamble? I usually have several defined and they don't seem to work.

Are these things possible with vim-latex?

  • 1
    I think your question could be splitted in 3 different ones: your first three points are actually abbreviations (see :h abbreviations) or snippets (see this question). Your point 4 could be a question on its own: how to automatically add braces I think we have a question about that on this site and there are plugins which do that. The last one is a question about the plugin you could ask a question on here or directly on their issue tracker. – statox Nov 15 '18 at 10:20
  • Have you read the documentation (also :help latex-suite.txt)? If I remember correctly, it should answer most of your questions. – Karl Yngve Lervåg Nov 15 '18 at 11:39
  • well that's how I found about the Alt Key Macro which btw doesn't work, even with the let g:Tex_AdvancedMath = 1 set in the .vimrc (I placed it there because I didn't know where. In the documentation, it says to place it in $VIM/ftplugin/tex.vim but that does not exist... Also the documentation is even more unclear because it says: "Latex-Suite utilizes a set of macros originally created by Carl Mueller in auctex.vim". But that file doesn't exist either... So here I am asking how to do this. – lucian Nov 15 '18 at 11:52
0
  1. Type $$ (predefined by vim-latex)
  2. Type "" (predefined by vim-latex)
  3. Unclear (row=line?). ... is automatically converted by vim-latex to \ldots. You probably have to disable this functionality with let g:Tex_SmartKeyDot=0. Also :iabbrev seems not to help since you still have to type a space; e.g. :ia teh the fixes the typo teh automatically in insert mode when typing teh<space>. BTW I am not convinced this is a huge time saver. Pressing the <space> key requires no hand movement at all. However, you are not alone, someone else has asked this already: Insert a newline after punctuations

    ~/.vim
    ❯ cat after/ftplugin/tex.vim
    let g:Tex_SmartKeyDot=0
    inoremap <buffer> .  .<space>
    
  4. Type ^^ and __ (:h lsq-keyboard-shortcuts) (predefined by vim-latex)

  5. I think vim-latex does not parse the preamble for newcommand. What does not work? If these are math environments and the syntax is messed up, see https://tex.stackexchange.com/q/412862/.

For the record $$, "", ^^, __ do not occur in the main helpfile. But ^^ is mentioned in the quickstart tutorial.

List all imaps of vim-latex with (assuming installation into the given vim8 packpath)

:vim 'call IMAP'  ~/.vim/pack/my_latex_plugins/start/vim-latex/ftplugin/**

and open the list with :copen (so called quickfix list).

As already mentioned in the comments: please split your questions and use the search engines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.