Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Use 2 spaces instead of 4 #55

Open
MartinDelille opened this issue Jun 20, 2018 · 3 comments
Open

Use 2 spaces instead of 4 #55

MartinDelille opened this issue Jun 20, 2018 · 3 comments

Comments

@MartinDelille
Copy link

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.

@codeinabox
Copy link
Collaborator

Have you try overriding it in your own vimrc file?

@MartinDelille
Copy link
Author

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?

@codeinabox
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants