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.

Revisions

  1. @b-outlaw b-outlaw revised this gist May 1, 2019. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions insert_newline_xcode.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,3 @@
    # Xcode line duplicate

    #### Bind keys to duplicate lines in Xcode

    1. Open below directory in Finder with <kbd>Cmnd</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd>

    ```
  2. @b-outlaw b-outlaw created this gist May 1, 2019.
    26 changes: 26 additions & 0 deletions insert_newline_xcode.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Xcode line duplicate

    #### Bind keys to duplicate lines in Xcode

    1. Open below directory in Finder with <kbd>Cmnd</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd>

    ```
    /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
    ```

    2. Open `IDETextKeyBindingSet.plist` with a text editor (not Xcode's plist editor).


    3. Add this in:

    ```xml
    <key>Insert Newline Before</key>
    <string>moveUp:, moveToEndOfLine:, insertNewline:</string>
    <key>Insert Newline After</key>
    <string>moveToEndOfLine:, insertNewline:</string>
    ```

    4. Open Xcode and go to `Xcode preferences` -> `Key Bindings` Search for "insert newline"


    5. Add shortcuts for new commands.