Reader small image

You're reading from  Mastering Vim

Product typeBook
Published inNov 2018
PublisherPackt
ISBN-139781789341096
Edition1st Edition
Tools
Right arrow
Author (1)
Ruslan Osipov
Ruslan Osipov
author image
Ruslan Osipov

Ruslan Osipov is a software engineer at Google, an avid traveler, and a part-time blogger. He is a self-taught engineer. He started publishing personal Vim notes in 2012, and became increasingly interested in the intricacies of the editor and its applications in optimizing development workflows.
Read more about Ruslan Osipov

Right arrow

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. It'll help with self-consistency.

...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Vim
Published in: Nov 2018Publisher: PacktISBN-13: 9781789341096

Author (1)

author image
Ruslan Osipov

Ruslan Osipov is a software engineer at Google, an avid traveler, and a part-time blogger. He is a self-taught engineer. He started publishing personal Vim notes in 2012, and became increasingly interested in the intricacies of the editor and its applications in optimizing development workflows.
Read more about Ruslan Osipov