Please explain Vim's configuration directories hierarchy

后端 未结 3 787
栀梦
栀梦 2021-01-31 09:13

I am trying to update my Vim configuration scripts. There are a number of sub-directories in my ~/.vim directory and I\'m not sure the specifics of wha

3条回答
  •  半阙折子戏
    2021-01-31 09:57

    Whatever goes into plugin is loaded whenever vim starts whereas what you put in ftplugin is only loaded for the specific filetype it corresponds to (so if you have a folder there called python all the files there will be loaded when you open a python file. In autoload you should have the functions corresponding to the the scripts defined in plugin. The functions here will only be loaded when called by the first time.

    In after you should put settings that you want to change from the normal plugin loading. As an example suppose you like the settings that some plugin for latex gives you, but it redefined a mapping that you had in your .vimrc. You can revert this with autocommands or by putting the correct definitions in after.

提交回复
热议问题