Commentator app icon

Using Commentator

Commentator improves your code by:

  • Keeping comments neatly formatted.

  • Avoiding typos in comments.

  • Running SwiftLint's autocorrect (direct download version only).

Keyboard shortcuts make using Commentator in Xcode simple. Write out your comment as a single line then hit the keyboard shortcut (^m by default, see below) to wrap it.  The real power shines when editing existing comment. First unwrap a comment to get back to that single-line layout (^↑M), make your edits, then re-wrap (^m).   Use the script below to set Xcode's keyboard shortcuts.

Check out the details of how all the features work with the examples in the app.

Note
: SwiftLint support is only available in the direct download version (which has been notarized by Apple). 

Download on the Mac App Store
Download direct from Optional Endeavors

Setting up Xcode's Key Bindings

Unfortunately the Source Editor Extension support that Apple provides does not allow for key bindings to be set automatically.  So you can either update these in Xcode by going to Preferences > Key Bindings, typing "Commentator" in the Filter field, and then setting the key bindings to whatever you choose.  

Or if you want help configuring them, you can download a simple script that will do it for you. After downloading you should be able to double click the script, or can run it manually in Terminal.  It's just a Swift shell script.  If GateKeeper blocks you from opening it, you can choose "Open..." from the context menu in Finder.  

Download Setup Script