Last active
March 28, 2022 13:48
-
-
Save seanwoodward/c808940b84d3a629996e6c7411dab3fc to your computer and use it in GitHub Desktop.
Shell Script for Updating Xcode IDETextKeyBindingSet.plist with custom actions: Insert New Line Above, Insert New Line Below, and Duplicate Current Line
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 characters
# update with the path to your file, | |
# /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist | |
KEYBINDINGSET='IDETextKeyBindingSet.plist' | |
plutil -insert 'User Defined' -dictionary -- "$KEYBINDINGSET" | |
# ^⇧⏎ | |
plutil -insert 'User Defined'.'Insert New Line Above Current Line' -string 'moveUp:, moveToEndOfParagraph:, insertParagraphSeparator:' -- "$KEYBINDINGSET" | |
# ^⌥⏎ | |
plutil -insert 'User Defined'.'Insert New Line Below Currnt Line' -string 'moveToEndOfParagraph:, insertParagraphSeparator:' -- "$KEYBINDINGSET" | |
# ⌘D | |
plutil -insert 'User Defined'.'Duplicate Current Line Down' -string 'selectParagraph:, delete:, yank:, moveToBeginningOfParagraph:, yank:, moveUp:, moveToEndOfParagraph:' -- "$KEYBINDINGSET" |
I prefer to set these user defined bindings to the following keyboard shortcuts:
"Insert New Line Above Current Line" = ^⇧⏎
"Insert New Line Below Current Line" = ^⌥⏎
"Duplicate Current Line Down" = ⌘D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
User Defined key bindings from CodeSlicing