swift.vim icon indicating copy to clipboard operation
swift.vim copied to clipboard

Use tabs for indentation, only in Swift

Open ivnsch opened this issue 8 years ago • 1 comments

My global config is set to 2 spaces but for Swift I'd like to use tabs. I found this but it apparently requires me to modify the plugin, which I assume isn't a good idea (I anyway tried it out and it didn't work).

I'm rather new to vim so probably I'm missing something basic. How do I configure it to use always tabs, only for Swift? (or at least 4 spaces instead of 2)

ivnsch avatar Oct 15 '17 11:10 ivnsch

Inside your ~/.vimrc you can set file specific rules for file types. The answer below the one you linked to (https://stackoverflow.com/a/12134557) provides how to set this in your .vimrc.

autocmd Filetype swift setlocal noexpandtab tabstop=4 shiftwidth=4

kylef avatar Oct 15 '17 12:10 kylef