我试图弄清楚如何在VSCodeVim中创建文本插入,例如:
inoremap <leader>sys <esc>ISystem.out.println(<esc>A);
vnoremap <leader>sys yOSystem.out.println(<esc>pA);
但我唯一能想到的是一些hacky:
"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",")",";"]
}
它运行良好。因为有这么多单独的键,所以延迟创建了一个非常令人愉悦的动画 XD 问题是编写它们。我也为 For 循环写了一个,这不是一个好的体验。
必须有更好更简单的方法来做到这一点!如果我在某处的引号内有多个字符,它会停止序列。
谢谢!