Last active
August 20, 2025 18:31
-
Star
(239)
You must be signed in to star a gist -
Fork
(48)
You must be signed in to fork a gist
-
-
Save emotality/b1bcb2bb8a07921f9c8cad1c969daedf to your computer and use it in GitHub Desktop.
Revisions
-
emotality revised this gist
Jul 9, 2022 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ **NOTE (2022-07-09):** Xcode finally added this functionality in Xcode 14, [please see release notes here](https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes): **New Features in Xcode 14 Beta 3** When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491) --- # Xcode line duplicate #### Bind keys to duplicate lines in Xcode -
emotality revised this gist
Apr 26, 2022 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,18 @@ #### Bind keys to duplicate lines in Xcode 1. Close Xcode 2. 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/ ``` 3. Open `IDETextKeyBindingSet.plist` with a text editor. 4. Add this in: ```xml <key>Duplication</key> @@ -25,7 +27,7 @@ </dict> ``` 5. Open Xcode and go to `Xcode preferences` -> `Key Bindings` -> `Text` tab -> Scroll till you see `Duplication` 6. Click on `Duplicate Current Line`, add a shortcut for it, eg. <kbd>Cmnd</kbd> + <kbd>D</kbd> (remove any other bindings for this key) -
emotality revised this gist
Jun 1, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ </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. <kbd>Cmnd</kbd> + <kbd>D</kbd> (remove any other bindings for this key) -
emotality revised this gist
Sep 27, 2018 . 2 changed files with 14 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,12 +11,21 @@ 2. Open `IDETextKeyBindingSet.plist` with a text editor. 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) -
emotality revised this gist
Sep 27, 2018 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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> -
emotality revised this gist
Sep 27, 2018 . 1 changed file with 0 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +0,0 @@ -
emotality revised this gist
Sep 27, 2018 . No changes.There are no files selected for viewing
-
emotality renamed this gist
Sep 26, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
emotality revised this gist
Sep 26, 2018 . 2 changed files with 1 addition and 1 deletion.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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) :sunglasses: -
emotality revised this gist
Sep 26, 2018 . 3 changed files with 22 additions and 6 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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-) -
Jean-Pierre Fourie renamed this gist
Jul 16, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Jean-Pierre Fourie revised this gist
Jul 16, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +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> -
Jean-Pierre Fourie created this gist
Jul 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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>