Skip to content

Instantly share code, notes, and snippets.

@carloshpdoc
Forked from emotality/duplicate_line_xcode.md
Created December 16, 2019 01:15
Show Gist options
  • Save carloshpdoc/60fe754d5c002ec31148c07954271ddb to your computer and use it in GitHub Desktop.
Save carloshpdoc/60fe754d5c002ec31148c07954271ddb to your computer and use it in GitHub Desktop.

Revisions

  1. @emotality emotality revised this gist Sep 27, 2018. 2 changed files with 14 additions and 14 deletions.
    9 changes: 0 additions & 9 deletions IDETextKeyBindingSet.plist
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>
    19 changes: 14 additions & 5 deletions duplicate_line_xcode.md
    Original file line number Diff line number Diff line change
    @@ -11,12 +11,21 @@
    2. Open `IDETextKeyBindingSet.plist` with a text editor.


    3. Add the content of [IDETextKeyBindingSet.plist](#file-idetextkeybindingset-plist) (see below) to this file

    3. Add this in:

    ```xml
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>
    ```

    4. Open Xcode and go to `Xcode preferences` -> `Key Bindings` -> `Text tab` -> Scroll till you see `Duplication`


    5. Click on `Duplicate Current Line`, add a shortcut for it, eg. `Cmd + D` (remove any other bindings for this key)

    :sunglasses:
    5. Click on `Duplicate Current Line`, add a shortcut for it, eg. `Cmd + D` (remove any other bindings for this key)
  2. @emotality emotality revised this gist Sep 27, 2018. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions IDETextKeyBindingSet.plist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>
  3. @emotality emotality revised this gist Sep 27, 2018. 1 changed file with 0 additions and 9 deletions.
    9 changes: 0 additions & 9 deletions IDETextKeyBindingSet.plist
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>
  4. @emotality emotality revised this gist Sep 27, 2018. No changes.
  5. @emotality emotality renamed this gist Sep 26, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. @emotality emotality revised this gist Sep 26, 2018. 2 changed files with 1 addition and 1 deletion.
    File renamed without changes.
    2 changes: 1 addition & 1 deletion xcode_duplicate_line.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,4 @@

    5. Click on `Duplicate Current Line`, add a shortcut for it, eg. `Cmd + D` (remove any other bindings for this key)

    8-)
    :sunglasses:
  7. @emotality emotality revised this gist Sep 26, 2018. 3 changed files with 22 additions and 6 deletions.
    File renamed without changes.
    6 changes: 0 additions & 6 deletions xcode_duplicate_instructions.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    1. Go to: /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
    2. Open 'IDETextKeyBindingSet.plist'
    3. Add the text of 'xcode_duplicate_key.txt' to this file
    4. Go to Xcode preferences -> Key Bindings -> Text tab -> Scroll till you see Duplication
    5. Click on Duplicate Current Line, add a shortcut for it, eg. Cmnd+D (resolve any duplicate bindings)
    6. Open Xcode
    22 changes: 22 additions & 0 deletions xcode_duplicate_line.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # 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.


    3. Add the content of [IDETextKeyBindingSet.plist](#file-idetextkeybindingset-plist) (see below) to this file


    4. Open Xcode and go to `Xcode preferences` -> `Key Bindings` -> `Text tab` -> Scroll till you see `Duplication`


    5. Click on `Duplicate Current Line`, add a shortcut for it, eg. `Cmd + D` (remove any other bindings for this key)

    8-)
  8. Jean-Pierre Fourie renamed this gist Jul 16, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. Jean-Pierre Fourie revised this gist Jul 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions xcode_duplicate_key.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>
  10. Jean-Pierre Fourie created this gist Jul 16, 2016.
    6 changes: 6 additions & 0 deletions instructions.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    1. Go to: /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
    2. Open 'IDETextKeyBindingSet.plist'
    3. Add the text of 'xcode_duplicate_key.txt' to this file
    4. Go to Xcode preferences -> Key Bindings -> Text tab -> Scroll till you see Duplication
    5. Click on Duplicate Current Line, add a shortcut for it, eg. Cmnd+D (resolve any duplicate bindings)
    6. Open Xcode
    9 changes: 9 additions & 0 deletions xcode_duplicate_key.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <key>Duplication</key>
    <dict>
    <key>Duplicate Current Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Duplicate Lines</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Line</key>
    <string>selectLine:, deleteBackward:</string>
    </dict>