About: Search and replace in multiple buffers   Sponge Permalink

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

The following performs a search and replace in all buffers (all those listed with the :ls command): :bufdo %s/pattern/replace/ge | update The command above uses :update to save each buffer, if it was changed. That is necessary because, by default, Vim will not switch away from a buffer if it has been changed. One alternative is to set the 'autowriteall' option so changed buffers are automatically saved when required: :set autowriteall :bufdo %s/pattern/replace/ge :set hidden :bufdo %s/pattern/replace/ge :wa :bufdo! %s/pattern/replace/ge

AttributesValues
rdfs:label
  • Search and replace in multiple buffers
rdfs:comment
  • The following performs a search and replace in all buffers (all those listed with the :ls command): :bufdo %s/pattern/replace/ge | update The command above uses :update to save each buffer, if it was changed. That is necessary because, by default, Vim will not switch away from a buffer if it has been changed. One alternative is to set the 'autowriteall' option so changed buffers are automatically saved when required: :set autowriteall :bufdo %s/pattern/replace/ge :set hidden :bufdo %s/pattern/replace/ge :wa :bufdo! %s/pattern/replace/ge
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 381(xsd:integer)
Category
  • Searching
Complexity
  • basic
Created
  • 2002(xsd:integer)
ID
  • 382(xsd:integer)
NEXT
  • 383(xsd:integer)
Rating
  • 16(xsd:integer)
abstract
  • The following performs a search and replace in all buffers (all those listed with the :ls command): :bufdo %s/pattern/replace/ge | update The command above uses :update to save each buffer, if it was changed. That is necessary because, by default, Vim will not switch away from a buffer if it has been changed. One alternative is to set the 'autowriteall' option so changed buffers are automatically saved when required: :set autowriteall :bufdo %s/pattern/replace/ge Another alternative is to set the 'hidden' option so buffers do not need to be saved, then use :wa to save all changes (only changed buffers are written): :set hidden :bufdo %s/pattern/replace/ge :wa If you don't wish to save the results of your replacement, but want to review each changed buffer first, you can force the bufdo to continue without saving files with bufdo!: :bufdo! %s/pattern/replace/ge
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