sublime 中使用vim模式

来源:互联网 发布:企业培训网络课程设计 编辑:程序博客网 时间:2024/05/02 00:52

sublime 中使用vim模式

在sublime中编写代码时使用vim快捷键,编写非常方便,但是使用vim模式时,有部分快捷键会出现冲突,例如,常用的 ctrl + [ 快捷键,在vim中表示 Esc (退出插入模式), 而在sublime 中表示 incident, 容易给使用带来麻烦。 但是只要做稍微的修改,就能解决这种麻烦。

1. 修改seting

sublime ->preference->seting 添加修改{    "caret_extra_bottom": 1,    "caret_extra_top": 1,    "caret_extra_width": 2,    "font_size": 11,    "ignored_packages":    [    ],    "vintage_ctrl_keys": true,    "vintage_start_in_command_mode": true}

其中, “vintage_ctrl_keys”: true 表示增加部分vim快捷键,”vintage_start_in_command_mode”: true 表示打开时直接进入vim 模式,tab采用4个空格。

2.修改退出插入模式快捷键

sublime->preference->key binding 添加修改

[{ "keys": ["ctrl+]"], "command": "unbound" }, { "keys": ["ctrl+["], "command": "unbound" },    { "keys": ["ctrl+["], "command": "exit_insert_mode",    "context":    [           { "key": "setting.command_mode", "operand": false },        { "key": "setting.is_widget", "operand": false }    ]},{ "keys": ["ctrl+["], "command": "hide_auto_complete", "context":    [        { "key": "auto_complete_visible", "operator": "equal", "operand": true }    ]},{ "keys": ["ctrl+["], "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" }    ]},{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},    "context":    [        { "key": "setting.tab_completion", "operator": "equal", "operand": true },        { "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },    ]},{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":    [        { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },        { "key": "setting.tab_completion", "operator": "equal", "operand": true }    ]},{ "keys": ["tab"], "command": "reindent", "context":    [        { "key": "setting.auto_indent", "operator": "equal", "operand": true },        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },        { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },        { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }    ]},{ "keys": ["tab"], "command": "indent", "context":    [        { "key": "text", "operator": "regex_contains", "operand": "\n" }    ]},{ "keys": ["enter"], "command": "next_field", "context":    [        { "key": "has_next_field", "operator": "equal", "operand": true }    ]},{ "keys": ["tab"], "command": "commit_completion", "context":    [        { "key": "auto_complete_visible" },        { "key": "setting.auto_complete_commit_on_tab" }    ]},]

其中才用 ctrl + [ 代替 esc, 采用 enter 跳跃到 nextfield

插件

  1. 通用
    FileDiffs
    GBK Support
    Gist
    Git
    GitGutter
    Alignment 等于符号自动对齐
    AutoFileName 自动插入文件名
    BracketHighlighter 括号匹配高亮
    ColorPicker 颜色
    ConvertToUTF8
    Clipboard Manager 剪切板
    DocBlockr
    Package Control
    PackageResourceView
    SideBarEnhancements
    SublimeLinter
    Terminal
    Trimmer

  2. 前端开发
    Can I Use Css 语法检测
    CSScomb css排序
    Emmet
    JsFormat

  3. C++
    参考http://blog.csdn.net/dc_726/article/details/45749805/
    SublimeCodeIntel (比较喜欢:C++ 再加一个sublimeclang)
    All autocomplete
    cscope
    ctag
    代码检测 sublime linter
    使用说明

  4. python
    anaconda 相关配置
    关闭错误提示

  5. markdown
    Markdown Preview
    MarkdownEditing

0 0
原创粉丝点击