在 VIM 中,有没有办法将键绑定到 shell 命令?例如,当按下 F3 时git commit -a -m "test"应该执行。
map <F3> :!git commit -a -m "test" <enter>
Run Code Online (Sandbox Code Playgroud)
在其他答案的基础上,这消除了多余的调用sh并启动命令,而无需按 Enter。
我正在寻找这个但找不到,我也无法发表评论,所以我做了一个答案。
尝试map <F3> :!sh -xc 'git commit -a -m "test"'。