Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remap escape when in Sublime Text vintage mode?

I am a vim user who is moving to Sublime text and using Vintage mode. In my .vimrc I have the following line:

imap jk <Esc> 

In vim, this allows me to escape out of insert mode without having to lunge for the escape key and keep my fingers on the home row. How do I do the same thing with Sublime Text Vintage mode?

like image 615
gerryster Avatar asked Mar 08 '12 16:03

gerryster


People also ask

Can you use Vim in sublime?

Sublime includes vim, which is an advanced section of vi editor, and includes customization of macros, snippets and plugins.


2 Answers

"Vintage mode is implemented entirely via key bindings and the plugin API - feel free to browse through the Vintage package and see how it's put together. As an example, if you'd like to bind "jj" to exit insert mode, you can add this key binding:"

{ "keys": ["j", "j"], "command": "exit_insert_mode",     "context":     [         { "key": "setting.command_mode", "operand": false },         { "key": "setting.is_widget", "operand": false }     ] } 

Just modify first line to jk if you prefer that.
Source

like image 75
Ulquiomaru Avatar answered Sep 28 '22 23:09

Ulquiomaru


If you are using the Vintageous plugin, use the following key binding:

{     "keys": ["j", "k"],     "command": "_enter_normal_mode",     "args": {"mode": "mode_insert"},     "context": [{"key": "vi_insert_mode_aware"}] } 
like image 32
Druska Avatar answered Sep 29 '22 00:09

Druska