VSCode Vim 快捷键备忘

<leader>

The <leader> key in my configuration is ‘<Space>’.

Build-in Shortcuts

Ctrl+I / Ctrl+O Go froward/back

Customize Shortcuts

Normal Mode Customize Shortcuts

"vim.normalModeKeyBindingsNonRecursive": [
        {

            "before": ["<C-h>"],//Switch Left Window
            "after": ["<C-w>", "h"]
        },
        {
            "before": ["<C-j>"],//Switch Buttom Window
            "after": ["<C-w>", "j"]
        },
        {
            "before": ["<C-k>"],//Switch Right Window
            "after": ["<C-w>", "k"]
          },
          {
            "before": ["<C-l>"],//Switch Up Window
            "after": ["<C-w>", "l"]
        },
       {
            "before":["J"],//Cursor Up 5 lines
            "after":["5","j"]
        },
        {
            "before":["K"],//Cursor Down 5 lines
            "after":["5","k"]
        },
        {
            "before":["<Leader>","j"],//Join current & next line
            "after" : ["J"]
        },
        {
            "before": ["<Leader>", "t", "t"],//Create New File
            "commands": [":tabnew"]
        },
        {
            "before": ["<Leader>", "t", "n"],//Switch Right Tab
            "commands": [":tabnext"]
        },
        {
            "before": ["<Leader>", "t", "p"],//Switch Left Tab
            "commands": [":tabprev"]
        },
        {
            "before": ["<Leader>", "t", "o"],//Close Current Window's Other Tabs
            "commands": [":tabo"]
        },{
            "before": ["<Leader>", "/"],//No highlight
            "commands": [":noh"]
        },
        {
            "before": ["leader", "w"],//Quick Save Files
            "commands": [
                "workbench.action.files.save",
            ]
        },
        {
            "before":["leader","f"],//Quick Open Palette
            "commands":[
                "workbench.action.quickOpen"
            ]
        },
        {
            "before" :["<Leader>","t"],//Quick Go to Symbols
            "commands":[
                "workbench.action.gotoSymbol"
            ]
        }
    ]

Insert Mode Customize Shortcuts

"vim.insertModeKeyBindingsNonRecursive": [
        {
            "before":["j","k"],//enter normal mode when input 'jk'
            "after": [
                "<ESC>"
            ]
        },{
            "before":["k","j"],//backspace one letter when input 'kj'
            "after":["<Backspace>"]
        },
]

用jk进入normal模式,用kj删除一个字符,非常快,感觉kj应该改成daw更好一点,大部分时候我宁愿再输入一次也不想一直kjkj,我打字的时候双手没有按照标准的位置摆放,会自己到处漂移。。。。

Plugins

1.Vim Sneak

s{character}{character} //lower-case 's' for afterward search, upper-case 'S' for backward search. search the string sequence in file.just regard it as a quick search command

2. Vim Easymotion

<leader><leader>{secret word}

2.1 <leader><leader>w

Label word after cursor & type label to jump to.

2.2 <leader><leader>f{character}

Label letter {chraracter} after cursor.

<leader><leader>fb
emmm VSCode社区,加油!

指令备忘

1.tag scope command

d/y/c + a/i/ + ‘[‘ / ‘{‘ ‘(‘ ‘t’ ‘w’ ‘s’ ‘p’

dat: delete a tag

dit: delete things in tag

yank,change同理

2. jump to paired symbol?

3. <C-o> in insert mode

由于我把我的Esc和CapsLock键交换了,长期多次挪上去按CapsLock对我短小的小拇指是巨大的负担,这个指令非常棒。

4. u(ndo)

undo things you just messed up.

5. <C-I> <C-O>

I need a TimeMachine.

Oh! TimeMachine

学习记录

2022/03/05 从开始正式在VSCode使用Vim到现在已经差不多半个月了,我还是没法完全适应vim的操作,最不习惯的可能是粘贴和剪切(刚试了下突然灵感一现。原来是我不会用Visual模式,vat牛逼,这里可以看出经常使用Vim真的可以养成一种Vim惯性),现在我在开发时每天早上开Vim,然后用到不爽时就WorkSpace disable,只有在看源码时才会感觉不用鼠标的舒爽。直接一个<Space> d 进definition,一个指令就切窗口,<Space> f 就切文件,非常舒服。


优质Vim学习资源

Vim CheetSheet

Vscode Learn Vim插件

How to learn vim in 2020

我最开始学习Vim时阅读的教程汇总文章:How to Learn Vim in 2020

Vim Adventure

一个以游戏的方式学习Vim的网站:Vim Adventure


wep1.0 第一波快捷键添加 2022/02/20

wep1.1 第二波快捷键添加 2022/03/05

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注