In my work I have to copy and paste sample manifest snippet from kubernetes documentation site. After copying many a time I have to correct indent and change some section of the copied content. Many a time challenges comes from the structure of the yaml file, specifically space characters and tab characters. Currently I am using the following setting
set number relativenumber
set tabstop=2
set softtabstop=2
set expandtab
set shiftwidth=2
Is there any more setting that I am missing?
A few things.
paste
set. It’s a used as a temporary setting for letting the text be put without changes. You can use pastetoggle
for this, and tpope’s unimpaired has useful (relevant) mappings.setlocal
&co. inside ~/.vim/after/ftplugin/yaml.vim
. If they are not given a filetype, you may need to create a filetype-detection script (Google and the Vim help are quite good resources for this).tabstop
, since you can’t control how wide a tab is on every display (you can always control spaces, though ;)).