About: Multiple commands at once   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

For example: %s/htm/html/c | %s/JPEG/jpg/c | %s/GIF/gif/c This example substitutes for htm, then moves on to JPEG, then GIF. The second command (and subsequent commands) are only executed if the prior command succeeds. This works for most commands, but some commands like :argdo or :autocmd see the '|' as one of their arguments. This allows commands such as :argdo, which execute a different Vim command, to execute a series of commands. See [help :\bar] for the full list of such commands. For example: argdo %s/foo/bar/gc | w map :echo "test" :echo "test2"

AttributesValues
rdfs:label
  • Multiple commands at once
rdfs:comment
  • For example: %s/htm/html/c | %s/JPEG/jpg/c | %s/GIF/gif/c This example substitutes for htm, then moves on to JPEG, then GIF. The second command (and subsequent commands) are only executed if the prior command succeeds. This works for most commands, but some commands like :argdo or :autocmd see the '|' as one of their arguments. This allows commands such as :argdo, which execute a different Vim command, to execute a series of commands. See [help :\bar] for the full list of such commands. For example: argdo %s/foo/bar/gc | w map :echo "test" :echo "test2"
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 766(xsd:integer)
Category
  • Getting started
Text
  • CommandWithMutableRange plugin
Author
  • pim
Complexity
  • basic
Created
  • 2004(xsd:integer)
ID
  • 767(xsd:integer)
  • 3270(xsd:integer)
NEXT
  • 768(xsd:integer)
Rating
  • 10(xsd:integer)
abstract
  • For example: %s/htm/html/c | %s/JPEG/jpg/c | %s/GIF/gif/c This example substitutes for htm, then moves on to JPEG, then GIF. The second command (and subsequent commands) are only executed if the prior command succeeds. This works for most commands, but some commands like :argdo or :autocmd see the '|' as one of their arguments. This allows commands such as :argdo, which execute a different Vim command, to execute a series of commands. See [help :\bar] for the full list of such commands. For example: argdo %s/foo/bar/gc | w Normally, Vim will complain if you haven't saved changes to a buffer before abandoning it, but by adding | w in the above example, you can actually write out each buffer after processing. Note that this command will, for each item in the arg list, do a :substitute and a :write. If :argdo didn't take '|' as an argument, it would instead run the :substitute on each item, then write the last item. If you want to make a command chain including one of the commands listed at [help :\bar], you can still do so using the :execute command. For example, in order to chain a :normal command, you would need to do something like this: :execute 'normal "ayiw' | echo @a If you want to chain commands form the vimrc file, then you need to user instead of | like this: map :echo "test" :echo "test2"
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software