吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2440|回复: 7
收起左侧

[讨论] vscode vim 自定义一些快捷键

[复制链接]
古月不傲 发表于 2020-11-30 12:33
本帖最后由 古月不傲 于 2020-12-1 17:18 编辑

[Asm] 纯文本查看 复制代码
{
    "vim.easymotion": true,
    "vim.sneak": true,
    "vim.useSystemClipboard": true,
    // 设置自定义控制键 空格
    "vim.leader": "<space>",
    // 以下按键依旧有效
    "vim.handleKeys": {
        "<C-c>": false,
        "<C-v>": false,
        "<C-z>": false,
        "<C-s>": false,
        "<C-a>": false,
    },
    // 普通模式递归映射
    "vim.normalModeKeyBindings": 
    [
        // 强制退出当前文件
        {"before": ["<leader>","q",],"commands": [":q!",]},
        // 强制保存当前文件
        {"before": ["<leader>","w",],"commands": [":w!",]},
        // 强制保存并退出当前文件
        {"before": ["<leader>","r",],"commands": [":wq!",]},
        // 强制退出所有文件
        {"before": ["<leader>","a",],"commands": [":qa!",]},
        // 水平分屏
        { "before": ["\\",],"commands": [":vsp",]},
        // 垂直分屏
        { "before": ["|",],"commands": [":sp",]},
        // 窗口切换
        {"before": ["<C-h>",],"after": ["<C-w>","h",]},
        {"before": ["<C-l>",],"after": ["<C-w>","l",]},
        {"before": ["<C-j>",],"after": ["<C-w>","j",]},
        {"before": ["<C-k>",],"after": ["<C-w>","k",]},
        // 切换下一个文件
        {"before": ["F",],"commands": [":tabn",]},
        // 切换上一个文件
        {"before": ["B",],"commands": [":tabp",]},
        // 新建文件
        {"before": ["N",],"commands": [":tabnew",]},
        // 关闭其他文件
        {"before": ["<leader>", "x",],"commands": [":tabo",]},
    ],
    // 插入模式非递归映射
    "vim.insertModeKeyBindingsNonRecursive": 
    [
        // 切换普通模式 
        {"before": ["i","i",],"after": ["<Esc>",]},
    ],
    // 普通模式非递归映射
    "vim.normalModeKeyBindingsNonRecursive": 
    [
        // 跳至行首 
        {"before": ["H",],"after": ["^",],},
        // 跳至行尾
        {"before": ["L",],"after": ["$",]},
        // 向下跳3行
        {"before": ["J",],"after": ["3","j",],},
        // 向上跳3行
        {"before": ["K",],"after": ["3","k",],},
        // 复制3行 
        {"before": ["Y",],"after": ["3","y",],},
        // 删除3行 
        {"before": ["D",],"after": ["3","d","d",],},
        // 删除至行首
        {"before": ["d","a",],"after": ["d","^",]},
        // 删除至行尾
        {"before": ["d","g",],"after": ["d","$",]},
        // 删除至行首并插入
        {"before": ["<leader>","h",],"after": ["c","^",]},
        // 删除至行尾并插入
        {"before": ["<leader>","l",],"after": ["c","$",]},
        // 空行不插入 
        {"before": [";",],"after": ["o","<Esc>",],},
    ],
}

免费评分

参与人数 1吾爱币 +1 收起 理由
甘愿堕落 + 1 热心回复!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

头像被屏蔽
lgsovo 发表于 2020-11-30 12:45
提示: 作者被禁止或删除 内容自动屏蔽
wu731kk 发表于 2020-11-30 12:56
chenkeai深蓝 发表于 2020-11-30 13:29
XiaoBaizzZ 发表于 2020-11-30 13:59
感谢大佬分享
甘愿堕落 发表于 2020-11-30 14:21
vim永远滴神
daymissed 发表于 2020-11-30 14:29
学习了,感谢分享。
忧郁小男生 发表于 2020-11-30 15:13
映射修改这些基础文件编辑指令一点意义没有,楼主把vim玩偏了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-1 06:53

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表