Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bebrws/a12acde14bf43d91a5dad30ca692abc1 to your computer and use it in GitHub Desktop.
Save bebrws/a12acde14bf43d91a5dad30ca692abc1 to your computer and use it in GitHub Desktop.
Xcode KeyBindings as VSCode

Add this to /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist Thanks to: https://gist.github.com/emotality/b1bcb2bb8a07921f9c8cad1c969daedf

<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>

Add this to ~/Library/Developer/Xcode/UserData/KeyBindings/VSCode.idekeybindings Then, select VSCode in Xcode/Preferences/KeyBindings

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Menu Key Bindings</key>
	<dict>
		<key>Key Bindings</key>
		<array>
			<dict>
				<key>Action</key>
				<string>duplicate:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandID</key>
				<string>Xcode.IDEKit.CmdDefinition.Duplicate</string>
				<key>Group</key>
				<string>Edit Menu</string>
				<key>GroupID</key>
				<string>Xcode.IDEKit.MenuDefinition.Main</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~$</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Title</key>
				<string>Duplicate</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>toggleBreakpointAtCurrentLine:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandID</key>
				<string>Xcode.IDEKit.CmdDefinition.ToggleBreakpointAtCurrentLine</string>
				<key>Group</key>
				<string>Debug Menu</string>
				<key>GroupID</key>
				<string>Xcode.IDEKit.MenuDefinition.Main</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string></string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Breakpoints</string>
				<key>Title</key>
				<string>Create Breakpoint at Current Line</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineDown:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>Group</key>
				<string>Editor Menu for Asset Catalog Comparison</string>
				<key>GroupID</key>
				<string>Xcode.DeltaComparisonEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Down</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineDown:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>Group</key>
				<string>Editor Menu for Playground</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusPlaygroundEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Down</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineDown:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineDown</string>
				<key>Group</key>
				<string>Editor Menu for Source Code</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Down</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineUp:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>Group</key>
				<string>Editor Menu for Asset Catalog Comparison</string>
				<key>GroupID</key>
				<string>Xcode.DeltaComparisonEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Up</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineUp:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>Group</key>
				<string>Editor Menu for Playground</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusPlaygroundEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Up</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>moveCurrentLineUp:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.MoveLineUp</string>
				<key>Group</key>
				<string>Editor Menu for Source Code</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string>~</string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Structure</string>
				<key>Title</key>
				<string>Move Line Up</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>renameRefactor:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>Group</key>
				<string>Editor Menu for Asset Catalog Comparison</string>
				<key>GroupID</key>
				<string>Xcode.DeltaComparisonEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string></string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Refactor</string>
				<key>Title</key>
				<string>Rename…</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>renameRefactor:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>Group</key>
				<string>Editor Menu for Playground</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusPlaygroundEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string></string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Refactor</string>
				<key>Title</key>
				<string>Rename…</string>
			</dict>
			<dict>
				<key>Action</key>
				<string>renameRefactor:</string>
				<key>Alternate</key>
				<string>NO</string>
				<key>CommandGroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>CommandID</key>
				<string>Xcode.IDEPegasusSourceEditor.CmdDefinition.Refactor.Rename</string>
				<key>Group</key>
				<string>Editor Menu for Source Code</string>
				<key>GroupID</key>
				<string>Xcode.IDEPegasusSourceEditor.MenuDefinition.Editor</string>
				<key>GroupedAlternate</key>
				<string>NO</string>
				<key>Keyboard Shortcut</key>
				<string></string>
				<key>Navigation</key>
				<string>NO</string>
				<key>Parent Title</key>
				<string>Refactor</string>
				<key>Title</key>
				<string>Rename…</string>
			</dict>
		</array>
		<key>Version</key>
		<integer>3</integer>
	</dict>
	<key>Text Key Bindings</key>
	<dict>
		<key>Key Bindings</key>
		<dict>
			<key></key>
			<array>
				<string>scrollToEndOfDocument:</string>
				<string>scrollToBeginningOfDocument:</string>
				<string>selectToMark:</string>
				<string>swapWithMark:</string>
				<string>moveParagraphBackwardAndModifySelection:</string>
				<array>
					<string>moveBackward:</string>
					<string>moveToBeginningOfParagraph:</string>
				</array>
				<array>
					<string>moveForward:</string>
					<string>moveToEndOfParagraph:</string>
				</array>
				<string>moveParagraphForwardAndModifySelection:</string>
			</array>
			<key>^x</key>
			<string>deleteLine:</string>
			<key></key>
			<string>deleteForward:</string>
		</dict>
		<key>Version</key>
		<integer>3</integer>
	</dict>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment