2

I am trying to get started with VimTeX. I am reading through a guide (https://www.ejmastnak.com/tutorials/vim-latex/vimtex.html) and using vim-plug to manage plugins. I am very new to Vim generally, and so I was wondering what the purpose is of there being ftplugin directories associated with each plugin.

Is it still necessary to create a new ~/.vim/ftplugin/ directory? Should I do anything with the other ftplugin directories that get created once a plugin is installed (i.e., ~/.vim/plugged/vimtex/ftplugin/)?

Sorry if these questions are dumb!

1
  • Do you have an answer to your question? If so maybe could you accept it using the v green button next to the arrow voting buttons. It allow the question to rest :-) Commented Mar 24, 2023 at 8:08

1 Answer 1

1

Context

At the beginning there were only one ftplugin folder and siblings (e.g. ftdetect). All the plugins were sharing these folders.

The consequences were that:

  • Plugins installation lead to conflicts (writing the same files in the same folders)
  • Uninstalling the plugins were complex

Later some plugin authors introduced a way to install their plugin in their own structure (manipulating runtimepath). The idea have been taken by plugin managers like Vundle, Vim-Plug and became the standard way to deploy plugins.

Answers

You don't have to create ~/.vim/ftplugin/.

You shouldn't touch the plugin folder (i.e. the subfolders of ~/.vim/plugged/) unless you want to uninstall the plugin (delete the corresponding folder).

If you play with plugin I advice you to install a plugin manager like vim-plug

5
  • 2
    "Vim 8 introduced the possibility for the plugin to have their own structure." --- No, this possibility was always there and was taken advantage of by different people in different ways. I believe tpope was one of the first to popularize the idea of manipulating the runtimepath with vim-pathogen. Later came vim-plug and other plugin managers, and even later the new package feature was added to Vim. Commented Oct 25, 2022 at 6:09
  • Thanks for your comment I'll adapt my answer accordingly. Commented Oct 25, 2022 at 6:15
  • Thank you for the information. Just to be clear, is there any reason to add an ftplugin directory manually to ~/.vim/? Also, is there any reason to mess with files like tex.vim in the VimTeX plugin?
    – monty_m
    Commented Oct 25, 2022 at 15:53
  • There are no reason to mess with tex.vim unless you want to contribution to the plugin. Commented Oct 25, 2022 at 16:51
  • The ftplugin folder may be used to amend filetypes configuration that comes with Vim Commented Oct 25, 2022 at 16:52

Your Answer

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

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