Custom Key Binding in Sublime Text 3

If you are a Windows->OSX switcher like me, you will counter several user habits conflicts. One of them is keyboard layout and key binding in different applications. Using Sublime Text3 editor in first days was nightmare. Luckily Sublime support possibility to bind commands to custom keys.


To change keys binding just go to Sublime Text > Preferences > Key Binding – User . Here create JSON record of your preferences. This file is preserved when Sublime upgrade itself and will not change as Key Binding – Default. But be aware of conflict with Key Binding – Default (this file is not possible to change).

Here is a list of custom key binds for Sublime Text 3 editor:

[
	{ "keys": ["ctrl+x"], "command": "cut" },
	{ "keys": ["ctrl+c"], "command": "copy" },
	{ "keys": ["ctrl+v"], "command": "paste" },
	
	// Control all 		- Super+A
	// Sublime Default - { "keys": ["ctrl+a"], "command": "select_all" },
	// Home on line		- Ctrl+A
	// End on line		- Ctrl+E

	{ "keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },

	{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },

	{ "keys": ["ctrl+z"], "command": "undo" },

	{ "keys": ["ctrl+y"], "command": "redo_or_repeat" },
]

There is a conflict between default keyboard binding on OSX and default keyboard binding on Windows for “Home” and “End” keyboard keys. It seems to me I will need to re-learn my user habits…

This entry was posted in Tips & tricks and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.