In order to make Vim configuration maintainable, what is the idea of structuring Vim configuration?

  question, vim

I. description of the problem

Recently, I took the time to modify the vimrc configuration, and found that my previous configuration of vim was too rough and regretted it (because the process of modifying vimrc was very painful)
They are initially divided into the following:

  1. The main basic configuration of. vimrc amplifier

  2. . vimrc.bundles plug-in

  3. . vimrc.funcs put some functions

  4. Use between documentssourceConnection

In order to prevent the nightmare of maintenance at this late stage, I think there must be better practice. What is it?

II. Relevant codes

III. Error reporting information

IV. Relevant screenshots

V. What methods have been tried but still have not been solved (with relevant links attached)

Reference is made to the directory structure of spf-vim, which has certain reference significance. However, due to its “community-driven” nature, it may not be suitable for me (the maintainer is me, the user is me, which is quite personalized)

VI. Simplification of Issues

It is difficult to come to a conclusion on this issue. VIM itself supports many different methods for organizing configuration files. Everyone has different needs, so the methods needed are different. You can search VIM or vimrc on github, then sort by stars, look at the file organization of the top repo, and then sum up the methods suitable for you.

Several general suggestions:

  • Each configuration file is divided into logical blocks according to certain logic, and comments and brackets for folding are added between each logical block.

  • Autocmd remembers grouping, and each group must be cleared before joining.

  • Determine the complexity of the organization of configuration files according to requirements, and do not spend all your time on configuration.

  • Learn to copy the configuration from various channels and then change it into a form suitable for yourself.