开发者

How do I add Sublime Text 2 keybindings?

开发者 https://www.devze.com 2023-03-19 13:57 出处:网络
I am looking to get the following assigned to Keybindings. I am able to make a snippet for this, yet wo开发者_高级运维uld prefer to be able to CTRL + > just like in Textmate.

I am looking to get the following assigned to Keybindings. I am able to make a snippet for this, yet wo开发者_高级运维uld prefer to be able to CTRL + > just like in Textmate.

<%= %>

What do I need to add and where do I need to add it, or where could I find out.


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 %>"} }
]


Just found this, thought it might be helpful: https://github.com/eddorre/SublimeERB

0

精彩评论

暂无评论...
验证码 换一张
取 消