In order to make Vim's configuration maintainable, what is the idea behind structured Vim configuration?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 16:36:54
0
2
525

1. Describe the problem

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

  1. .vimrc contains the main basic configuration

  2. .vimrc.bundles put plug-ins

  3. .vimrc.funcsPut some functions

  4. Use source to connect between each file

In order to prevent the nightmare of post-maintenance from happening now, I think there must be a better practice. What is it?

2. Related code

3. Error message

4. Related screenshots

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

Refers to the directory structure of spf-vim, which has certain reference significance. However, due to its "community-driven" nature, it has this consideration and may not necessarily be suitable for me (the maintainer is me, the user is me, Quite personalized)

6. Problem simplification

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
漂亮男人

It is difficult to reach a conclusion on this issue. VIM itself supports many different configuration file organization methods. Everyone has different needs, so the required methods are also different. You can search for VIM or vimrc on github, then sort by stars, look at the file organization methods of the top-ranked repos, and then summarize the method that suits you.

A few general suggestions:

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

  • autocmd Remember to group, remember to clear each group before adding it

  • Decide the complexity of how the configuration files are organized based on your needs, don’t spend all your time on configuration

  • Learn to copy configurations from various channels and then change them to a form that suits you

巴扎黑

You will regret dividing so many files. Unless you learn from a master and use git to post your configuration on the Internet, it is much easier to just use a file.

I don’t have a computer around me, so I can take screenshots of the configuration on the VPS on my mobile phone

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!