sublime模式下开启vim并修改esc

首先我用的是sublime text2

 

sublime下开启vim模式:

在Preference -> Setting-User里面加上

1 "ignored_packages": 
2 [ 
3 ]

就可以使用一些vim的基本功能了。

 

修改ESC:

esc超级远按起来超级不方便, 所以我们可以把esc修改掉。

如果把esc修改成shift+space的话, 在Preference -> Browse Packages 里面, 最下面找到Vintage文件, 然后在里面找到default,sublime-keymap, 在最后加上

 1 ,
 2     { "keys": ["shift+space"], "command": "exit_insert_mode",  
 3         "context":  
 4         [                 
 5             { "key": "setting.command_mode", "operand": false },  
 6             { "key": "setting.is_widget", "operand": false }  
 7         ]  
 8     },  
 9   
10     { "keys": ["shift+space"], "command": "hide_auto_complete", "context":  
11         [  
12             { "key": "auto_complete_visible", "operator": "equal", "operand": true }  
13         ]  
14     },  
15   
16     { "keys": ["shift+space"], "command": "vi_cancel_current_action", "context":  
17         [  
18             { "key": "setting.command_mode" },  
19             { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },  
20             { "key": "vi_has_input_state" }  
21         ]  
22     } 

开头的逗号不要忘记..这样shift+space也就有了esc的功能。

 

然而我是将Caps Lock 这个改成了ESC, 但是sublime貌似没有办法改, 所以我直接把电脑的Caps Lock给改掉了...

Windows Registry Editor Version 5.00
 
 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00

新建一个文本文档然后把上面的代码复制进去, 另存为XXX.reg。 然后打开那个文档重启电脑就可以了 =.=。

 

posted on 2016-03-06 13:39  yohaha  阅读(1736)  评论(0编辑  收藏  举报

导航