1

I have Vim on Ubuntu 18.04 and I have sucessfully installed the vim-latex package. When I open a .tex file, vim regognizes it as latex and the plugin kicks in (I have already struggled with this a few days ago as shown here. If I ran :verbose set ft? I get filetype=texas my output). However, if I understand the official tutorial of this package, once I start a new file I should have some way of selecting a new template in Tex-Suite > Templates. Unfortunately, I believe I do not currently have this option on my Vim as show in the picture below (notice that my system is in Portuguese, so I have added another picture with the translation of the options I have on Vim just below):

The options available in my Vim

Options in English

I have searched in the above menus, but I haven't found any options to add templates. So I don't really have any new options when working on a .tex file. Am I doing something wrong or am I missing something to get my vim-latexworking properly? Please, let me know if I can add any other useful information here so I can edit my question properly.

Thanks for your help!

1 Answer 1

1

By default, Vim menus are only enabled in the GUI version of Vim. So if you use GVim on Linux you should see the menus and the menus added by plug-ins such as those from vim-latex will be available too.

You can enable menus on the terminal, but you need to do so explicitly. See :help console-menus:

Although this documentation is in the GUI section, you can actually use menus in console mode too. You will have to load menu.vim explicitly then, it is not done by default. You can use the :emenu command and command-line completion with 'wildmenu' to access the menu entries almost like a real menu system. To do this, put these commands in your .vimrc file:

source $VIMRUNTIME/menu.vim
set wildmenu
set cpo-=<
set wcm=<C-Z>
map <F4> :emenu <C-Z>

Pressing <F4> will start the menu. You can now use the cursor keys to select a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel. This does require the +menu feature enabled at compile time.

These "menus" also behave somewhat differently from what you typically think of menus in a graphical application. The options are always shown horizontally, just above the command-line, and once you enter a menu, the submenu is also displayed horizontally on that same line. It might be a little awkward to use and get used to...

Overall, menus can be helpful as you're learning to use a plug-in, but since they actually always map to a Vim command, using the commands directly might end up being quicker and easier in the long term.


In the specific case of vim-latex's Tex-Suite > Templates, the corresponding command is :TTemplate, which takes a template name as its argument. It has tab completion enabled, so you can use :TTemplate <Tab> to go through the list of available templates, which gives you every piece of information and all features you would get from that specific menu.

1
  • 1
    again, thanks a lot for your help! It is working perfectly now!
    – RobertoAS
    Sep 19, 2020 at 3:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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