[swift-users] Swift indentation for vim

Aaron Bohannon aaron678 at gmail.com
Fri Jan 27 16:15:47 CST 2017


You have probably noticed that the available vim plugins do not provide
robust support for automatic indentation of Swift code.  The most complete
vim plugin appears to be the one here:

https://github.com/keith/swift.vim

I found that its indentation script would frequently get confused, though.
Therefore, it seemed necessary for me to create a new indentation script.
Mine is configurable and (appears to be) extremely robust.  My script is
available here:

https://gist.github.com/morefun2compute/bdc6ee6d8b9add60a03b318bd91ba570

Unfortunately, I cannot distribute my script as a standalone plugin because
it depends upon syntax highlighting support, which I have not
re-implemented (nor do I plan to re-implement it at this point in time).
If any of you have advice on how to distribute my script so that it can be
easily installed, please let me know.  For now, you will have to copy my
file into the location `.../indent/swift.vim` within the plugin I mentioned
above.  (I suspect it will also work with the vim plugin supplied in the
Swift source tree, although you will have to add the `indent` directory
manually.)

- Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170127/6fc3ee48/attachment.html>


More information about the swift-users mailing list