同一行上的多个命令

编程入门 行业动态 更新时间:2024-10-09 11:18:56
本文介绍了同一行上的多个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在尝试寻找可以让我在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.

更多推荐

同一行上的多个命令

本文发布于:2023-10-31 10:17:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545785.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   命令

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!