About: Repeating a substitute from current cursor position   Sponge Permalink

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

For example: " The cursor position is indicated with '^' on next line. one two three one two three one two three ^ :RS /two/TWO/ one TWO three one two three one two three ^ move cursor: one TWO three one two three one two three ^ (I think tip author intended to repeat :RS here?) cursor ends up: one TWO three one two three one TWO three Put the following into your vimrc if you'd like to be able to do this.

AttributesValues
rdfs:label
  • Repeating a substitute from current cursor position
rdfs:comment
  • For example: " The cursor position is indicated with '^' on next line. one two three one two three one two three ^ :RS /two/TWO/ one TWO three one two three one two three ^ move cursor: one TWO three one two three one two three ^ (I think tip author intended to repeat :RS here?) cursor ends up: one TWO three one two three one TWO three Put the following into your vimrc if you'd like to be able to do this.
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 572(xsd:integer)
Author
  • Charles E. Campbell, Jr.
Complexity
  • intermediate
Created
  • 2003-10-03(xsd:date)
ID
  • 573(xsd:integer)
NEXT
  • 575(xsd:integer)
Rating
  • 4(xsd:integer)
abstract
  • For example: " The cursor position is indicated with '^' on next line. one two three one two three one two three ^ :RS /two/TWO/ one TWO three one two three one two three ^ move cursor: one TWO three one two three one two three ^ (I think tip author intended to repeat :RS here?) cursor ends up: one TWO three one two three one TWO three Put the following into your vimrc if you'd like to be able to do this. " RS: repeat substitution command com! -range -nargs=* RS call RepeatSubst() " RepatSubst: fun! RepeatSubst(subexpr) if a:subexpr != "" let g:repeatsubst= a:subexpr endif let curcol= col(".") let sep = strpart(g:repeatsubst,0,1) let pat = substitute(g:repeatsubst,'^.\(.\{-}\)'.sep.'.*$','\1','') s/\%#./&/ let curcol= curcol + matchend(getline("."),pat) exe "s".g:repeatsubst norm! k j! exe 'norm! '.curcol.'|' endfun
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