How do I add Sublime Text 2 keybindings?

If you just want to literally insert those characters, you can set up your “User Key Bindings” like this:

[
    { "keys": ["ctrl+."], "command": "insert", "args": {"characters": "<%= %>"} }
]

You can use the Default Key Bindings file as an example for possible key binding commands. Both User and Default are located in Sublime Text 2 -> Preferences on OS X.

Not sure if you really wanted "ctrl+shift+.", but it would work as well.

To move the cursor to the middle during insert, you can use insert_snippet like this:

[
    { "keys": ["ctrl+shift+."], "command": "insert_snippet", "args": {"contents": "<%=$0 %>"} }
]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)