About: Replace a word with yanked text   Sponge Permalink

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

Copy a word and paste it over other words: Copy a line and paste it over other lines: Deleting, changing and yanking text copies the affected text to the unnamed register (""). Yanking text also copies the text to register 0 ("0). So the command yiw copies the current word to "" and to "0. Typing viw selects the current word, then pressing p pastes the unnamed register over the visual selection. The visual selection that was just replaced is then stored in the default unnamed register. let mapleader="," xnoremap p "_dP And then the workflow would be: yiw, move, viw,p, move again, viw,p, etc

AttributesValues
rdfs:label
  • Replace a word with yanked text
rdfs:comment
  • Copy a word and paste it over other words: Copy a line and paste it over other lines: Deleting, changing and yanking text copies the affected text to the unnamed register (""). Yanking text also copies the text to register 0 ("0). So the command yiw copies the current word to "" and to "0. Typing viw selects the current word, then pressing p pastes the unnamed register over the visual selection. The visual selection that was just replaced is then stored in the default unnamed register. let mapleader="," xnoremap p "_dP And then the workflow would be: yiw, move, viw,p, move again, viw,p, etc
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 604(xsd:integer)
Text
  • YankRing
  • ReplaceWithRegister
Author
  • Yang Xiangyu
Complexity
  • basic
Created
  • 2003(xsd:integer)
ID
  • 605(xsd:integer)
  • 1234(xsd:integer)
  • 2703(xsd:integer)
NEXT
  • 606(xsd:integer)
Rating
  • 28(xsd:integer)
abstract
  • Copy a word and paste it over other words: Copy a line and paste it over other lines: Deleting, changing and yanking text copies the affected text to the unnamed register (""). Yanking text also copies the text to register 0 ("0). So the command yiw copies the current word to "" and to "0. Typing viw selects the current word, then pressing p pastes the unnamed register over the visual selection. The visual selection that was just replaced is then stored in the default unnamed register. As you can see in the examples above, if you want to paste the same thing a second time, then you must use the "0 register, as in viw"0p. A workaround is to remap the p command in visual mode so that it first deletes to the black hole register like so: xnoremap p "_dP Note, using P in the remap replicates the default visual mode p function. Feel free to test. And you'd use xnoremap instead of vnoremap, according to the docs. Now you don't have to worry about pasting from the "0 register each subsequent time. However, this remapping prevents you from pasting from other registers in visual mode. So viw"ap to paste from the "a register is now broken. This script may solve that. Alternatively, I guess you could use a leader key instead such as: let mapleader="," xnoremap p "_dP And then the workflow would be: yiw, move, viw,p, move again, viw,p, etc
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