skip to content
Alvin Lucillo

Vim shift width

/ 1 min read

💻 Tech

When copying text from outside source into a Vim editor, sometimes you want to modify by indentation, especially if the alignment of the lines matter like those in YAML files. The indentation is based on the number of characters (i.e., width) that the line will move from. To set that width, you can set it by: :set shiftwidth=3. Select the line with shift+v, move indent the line with shift+>>, and you’ll see it move to the right by 3 characters. Repeat the same shift by pressing . key.