我一直在尝试寻找可以让我在Vim中的同一行上运行多个命令的东西,类似于在* nix系统或& 在Windows中。有办法吗?
I've been trying to find something that will let me run multiple commands on the same line in Vim, akin to using semicolons to separate commands in *nix systems or & in Windows. Is there a way to do this?
推荐答案酒吧 | 将允许你这样做。从:help:bar
A bar | will allow you to do this. From :help :bar
'|'可用于分隔命令,因此您可以在一行中给出多个命令。如果要在参数中使用'|',请在其前加上'\'。
'|' can be used to separate commands, so you can give multiple commands in one line. If you want to use '|' in an argument, precede it with '\'.
示例:
:echo hello |回声再见
输出:
hello goodbye注意:您可能会发现您的 〜/ .vimrc 不支持映射 | 或 \ | 。在这些情况下,请尝试使用< bar> 。
NB: You may find that your ~/.vimrc doesn't support mapping |, or \|. In these cases, try using <bar> instead.
更多推荐
同一行上的多个命令
发布评论