vscode与sublime 配置vim normal模式

vscode:

settings.json

{
    "vim.easymotion": true,
    "vim.sneak": true,
    "vim.incsearch": true,
    "vim.useSystemClipboard": true,
    "vim.useCtrlKeys": true,
    "vim.hlsearch": true,
    "vim.insertModeKeyBindings": [
        {
            "before": ["j","j"],//将jj与<Esc>绑定为normal模式
            // "before":["<ctrl>","["],
            "after": ["<Esc>"]
        }
    ],
    "vim.otherModesKeyBindingsNonRecursive": [
        {
            "before": ["<leader>","d"],
            "after": ["d", "d"]
        },
        {
            "before":["<C-n>"],
            "after":[],
            "commands": [
                {
                    "command": ":nohl"
                }
            ]
        }
    ],
    "vim.leader": "<space>",
    "vim.handleKeys":{
        "<C-a>": false,
        "<C-f>": false
    }
}

vim:

启用vim:
在菜单栏中: Preferences -> Setting - User ,即可打开配置文件进行编辑,将 ignored_packages 项的[]里面内容清空:

“ignored_packages”:
 [
 ],
 
 修改Esc快捷键:
首先安装sublime安装目录找到Packages,再找到 Vintage.sublime-package这个包,加上一个能压缩的后缀如(.zip),
然后打开后找到Default.sublime-keymap 文件,最后打开这个文件,搜索exit_insert_mode,在2,10,19,25行修改切换成normal模式,把escape即ESC改为jj。

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

    { "keys": ["ctrl+["], "command": "exit_visual_mode",
        "context":
        [
            { "key": "setting.command_mode"},
            { "key": "num_selections", "operand": 1},
            { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": 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": ["j", "j"], "command": "exit_insert_mode",
        "context":
        [
            { "key": "setting.command_mode", "operand": false },
            { "key": "setting.is_widget", "operand": false },
            { "key": "setting.vintage_ctrl_keys" }
        ]
    },

    { "keys": ["j", "j"], "command": "exit_visual_mode",
        "context":
        [
            { "key": "setting.command_mode"},
            { "key": "num_selections", "operand": 1},
            { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false },
            { "key": "setting.vintage_ctrl_keys" }
        ]
    },

    { "keys": ["j", "j"], "command": "vi_cancel_current_action", "context":
        [
            { "key": "setting.command_mode" },
            { "key": "vi_has_input_state" },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": false },
            { "key": "setting.vintage_ctrl_keys" }
        ]
    },
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值