Skip to content

Instantly share code, notes, and snippets.

@seanwoodward
Last active March 28, 2022 13:48
Show Gist options
  • Save seanwoodward/c808940b84d3a629996e6c7411dab3fc to your computer and use it in GitHub Desktop.
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
# 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"
@seanwoodward
Copy link
Author

@seanwoodward
Copy link
Author

seanwoodward commented Mar 28, 2022

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