swift.vim
swift.vim copied to clipboard
Use tabs for indentation, only in Swift
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)
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