VSCodeVim-如何正确绑定文本插入?
我试图找出如何在中创建文本插入,如:VSCodeVim-如何正确绑定文本插入?,vim,visual-studio-code,vscodevim,Vim,Visual Studio Code,Vscodevim,我试图找出如何在中创建文本插入,如: inoremap sys ISystem.out.println(A); vnoremap系统yOSystem.out.println(pA); 但我唯一能想到的是一些骇客: "vim.insertModeKeyBindingsNonRecursive": [ { // Console.WriteLine "before": ["<leader>", "c", "w", "l"], "af
inoremap sys ISystem.out.println(A);
vnoremap系统yOSystem.out.println(pA);
但我唯一能想到的是一些骇客:
"vim.insertModeKeyBindingsNonRecursive": [
{
// Console.WriteLine
"before": ["<leader>", "c", "w", "l"],
"after": ["<Esc>","I","C","o","n","s","o","l","e",".","W","r","i","t","e","L","i","n","e","(","<Esc>","A",")",";"]
}
“vim.InsertModeKeyBindings非递归”:[
{
//控制台写入线
“之前”:[,“c”,“w”,“l”],
在“:[”,“I”,“C”,“o”,“n”,“s”,“o”,“l”,“e”,“W”,“r”,“I”,“t”,“e”,“l”,“I”,“n”,“e”,“(“,”,“A“,”),”;“]
}
它确实运行得很好。因为有这么多单独的关键点,延迟创建了一个非常令人愉快的动画XD。问题是编写它们。我也为for循环编写了一个,这不是一个好的体验
必须有一种更好更简单的方法来实现这一点!如果在引号中有多个字符,它会停止序列
谢谢!您可以使用命令
editor.action.insertSnippet
{
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "c", "w", "l"],
"commands": [
{
"command": "editor.action.insertSnippet",
"args": { "snippet": "Console.WriteLine();" }
}
]
}
]
}
{
“vim.InsertModeKeyBindings非递归”:[
{
“之前”:[,“c”,“w”,“l”],
“命令”:[
{
“命令”:“editor.action.insertSnippet”,
“args”:{“snippet”:“Console.WriteLine();”}
}
]
}
]
}
您可以使用命令editor.action.insertSnippet
来执行此操作
{
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "c", "w", "l"],
"commands": [
{
"command": "editor.action.insertSnippet",
"args": { "snippet": "Console.WriteLine();" }
}
]
}
]
}
{
“vim.InsertModeKeyBindings非递归”:[
{
“之前”:[,“c”,“w”,“l”],
“命令”:[
{
“命令”:“editor.action.insertSnippet”,
“args”:{“snippet”:“Console.WriteLine();”}
}
]
}
]
}