Hi All, What are the rules for configuring VI for proper indentation of .yaml f . . .

Michael Shea:
Hi All,

What are the rules for configuring VI for proper indentation of .yaml files. I’ve been seeing alot of errors that I believe are related to spacing and indentation and recall seeing some information about how to configure vi to avoid. I can’t seem to locate that information now.

Thanks

MS

Pete:
Put this in your ~/.vimrc file:

set tabstop=2
set expandtab
set shiftwidth=2

Alistair Mackay:
I also find the following additional settings useful

set nu
set ai
set pastetoggle=<F3>

which enables line numbers, auto-indent and using F3 to toggle paste mode on/off when in insert mode.

You want paste ON when pasting from the kubernetes documentation, and OFF at all other times, or you’ll get tabs inserted when you don’t want them, resulting in cryptic errors from kubectl

Michael Shea:
Thank You! I will try these