vim-ansible-yaml
vim-ansible-yaml copied to clipboard
Use 2 spaces instead of 4
trafficstars
Would it be possible to configure the plugin to use 2 spaces instead of 4? It looks like everyone is using 2 spaces by the way.
Have you try overriding it in your own vimrc file?
Ok it works if I add this to the vimrc file:
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set smarttab
set autoindent
The problem is that I have globally 2 spaces and for other language I have other convention (4 hard tab for C++ for example).
Any idea how to apply this 2 soft spaces setup only for yaml files?
Sure, I believe the filetype is ansible so you could add the following to a file called ~/.vim/after/ftplugin/ansible.vim
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal expandtab
setlocal smarttab
setlocal autoindent