A word about style guides
Consistent style is important. One of the more prominent style guides for Vim is the one published by Google: https://google.github.io/styleguide/vimscriptguide.xml. It highlights some common development practices and outlines common pitfalls.
Here are some excerpts from the Google Vimscript style guide:
- Use two spaces for indents
- Do not use tabs
- Use spaces around operators
- Restrict lines to 80 columns wide
- Indent continued lines by four spaces
- Use
plugin-names-like-this
- Use
FunctionNamesLikeThis
- Use
CommandNamesLikeThis
- Use
augroup_names_like_this
- Use
variable_names_like_this
- Always prefix variables with their scope
- When in doubt, apply Python style guide rules
Give the Google Vimscript style guide a read; it’s rather useful even if you never plan on doing more than customizing your .vimrc
file. It’ll help with self-consistency.