Skip to content

Instantly share code, notes, and snippets.

@gdoudeng
Forked from b-outlaw/insert_newline_xcode.md
Created October 6, 2022 09:20
Show Gist options
  • Select an option

  • Save gdoudeng/df7f6303dec9a4cbf939cdb6222324e1 to your computer and use it in GitHub Desktop.

Select an option

Save gdoudeng/df7f6303dec9a4cbf939cdb6222324e1 to your computer and use it in GitHub Desktop.
Xcode – Insert Newline Before/After
  1. Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
  1. Open IDETextKeyBindingSet.plist with a text editor (not Xcode's plist editor).

  2. Add this in:

<key>Insert Newline Before</key>
<string>moveUp:, moveToEndOfLine:, insertNewline:</string>
<key>Insert Newline After</key>
<string>moveToEndOfLine:, insertNewline:</string>
  1. Open Xcode and go to Xcode preferences -> Key Bindings Search for "insert newline"

  2. Add shortcuts for new commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment