Due to Swift project's code indentation settings, Swift filetype plugin uses 2 spaces for ts and sw. This conflicts with Xcode, which uses 4 by default (and generally Swift projects use 4), and if same file is opened via Vim or vice versa, it's always extra steps to fix indentation. This PR sets ts and sw to 4, for a more unified environment.
I've brought this up to Swift team, but they prefer to keep it 2.
https://github.com/vim/vim/pull/5801
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
If this plugin is part of the Swift project and the Swift project team prefers 2, wouldn't it be more appropriate to put your preferences for 4 into ~/.vim/after/ftplugin/swift.vim? Regards, Gary
I certainly do; this is about providing more sensible defaults. They only use two, because Swift project code uses 2, however most Swift projects do not. Regarding ownership issues, I am using this conversation as basis; if it's not appropriate to modify it on Vim side, feel free to close this PR.
—
You are receiving this because you commented.
—
You are receiving this because you commented.
Why is 'tabstop' set here? It is strongly recommended to keep it at 8, since that's what is used nearly everywhere. Instead 'softtabstop' can be set: setlocal sw=4 sts=4 Since 'expandtab' is set that will work the same, without any side effects.
You're right. Edited as such.
—
You are receiving this because you commented.
I'll include it like this, thanks.
—
You are receiving this because you commented.