现在的位置: 首页 > 综合 > 正文

Sublime Text 2_vim配置及快键设置

2017年09月03日 ⁄ 综合 ⁄ 共 927字 ⁄ 字号 评论关闭

1.Preferences->Settings - User添加以下内容:

"ignored_packages":[],                 
"vintage_start_in_command_mode":true,   //打开文件时为命令模式
"vintage_ctrl_keys":true		//用vim的ctrl快捷键取代windows

修改后便可使用vim的简单操作,要想使用vim的命令模式还需第2步。

2.安装VintageEx

页面右侧下载解压后,放入Packages目录Preferences(%%\AppData\Roaming\Sublime Text 2\Packages),也可在Preferences->Browse Packages...打开该目录。

重启后便可使用vim的简单命令。

3.自定义快捷键

将Esc键映射为其他键,在上述Packages目录下修改Vintage/Default.sublime-keymap文件,添加内容:

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

	{ "keys": ["shift+space"], "command": "hide_auto_complete", "context":
		[
			{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
		]
	},

	{ "keys": ["shift+space"], "command": "vi_cancel_current_action", "context":
		[
			{ "key": "setting.command_mode" },
			{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },
			{ "key": "vi_has_input_state" }
		]
	}

即将Shift+Space映射为Esc.

抱歉!评论已关闭.