简体   繁体   English

使用 vscode 时使用 key 打开特定文件 / vim

[英]Open specific file using key when using vscode / vim

I often work in a specific file and would like to have that file opened when pressing a shortcut.我经常在特定文件中工作,并希望在按下快捷方式时打开该文件。 I tried several combinations but seem to hit a wall..我尝试了几种组合,但似乎碰壁了..

    // file settings.json

    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["leader","t"],
            "commands": [ 
                "vscode.open"
            ],
            "args": "notes/todo.md"
        }
    ]

Any hint on how i can get this working?关于如何让这个工作的任何提示? When executing the above code i get a illegal argument 'resource'执行上述代码时,我得到一个非法参数“资源”

Using normal vim keywords solves the problem.使用普通的 vim 关键字可以解决问题。

        {
            "before": [
                "leader", "t"
            ],
            "commands": [
                ":edit file:///notes/todo.md"
            ]
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM