Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thanks! The sample you gave worked indeed, so upvoted already! I'm trying to understand the rest of your answer though. You say something about not being allowed to use | in a command, but in the A-B example you do use one? What's the difference there? Also: where should I add this -bar argument? Simply behind the command? Like :command A | :command B -bar ? I've never seen this kind of syntax in Vim before. I've been exclusively using Vim for 2 years now, and I still feel like there's so much I don't understand yet :) Commented Apr 5, 2022 at 7:25
  • you need to add the -bar to the definition of the command. E.g. you need to define command A like this: :command -bar A :echo foobar and then you can use :A | echo "bar". Commented Apr 5, 2022 at 8:54
  • Okay, thanks for the explanation. I it didn't work in this case (but you already pointed that out in your answer), but it's good to know for the future. Commented Apr 5, 2022 at 8:57