Re: Vim: edit a register?




Mikolaj Machowski wrote:
> kar1107@xxxxxxxxx scripsit:
> > Hi,
> >
> > Tried Internet search..couldn't find a right answer.
> >
> > Can I do a substitution on a register content?
> > I would like to yank a few C functions into register a.
> > Then do some s/foo/bar on contents of a; then paste a.
> > Repeat the process multiple times (with s/bar/baz.. etc).
>
> :let @a = substitute(@a, "bar", "baz", "")
>
> :help substitute()

Great.. exactly what I was looking for. Seems like there is a ton
of built-in functions which I never knew.

http://vimdoc.sourceforge.net/htmldoc/eval.html#functions

Thanks,
Karthik

>
> m.
> --
> LaTeX + Vim = http://vim-latex.sourceforge.net/
> Vim Universal Templates: http://vim.sf.net/script.php?script_id=1078
> vim.pl - http://skawina.eu.org/mikolaj
> CLEWN - http://clewn.sf.net

.



Relevant Pages

  • Re: Vim: edit a register?
    ... kar1107@xxxxxxxxx scripsit: ... > Tried Internet search..couldn't find a right answer. ... > Can I do a substitution on a register content? ... > I would like to yank a few C functions into register a. ...
    (comp.editors)
  • Re: Haldanes Dilemma
    ... > a clearer view of the cost of substitution. ... > This is easily verified with Internet search-engines. ... I would be happy to see a more thoughtful review of it than is ... NG regarding "the sociology of science", ...
    (sci.bio.evolution)
  • Re: Haldanes Dilemma
    ... > a clearer view of the cost of substitution. ... > This is easily verified with Internet search-engines. ... > In a recently completed review (at the journal, ...
    (sci.bio.evolution)
  • Re: Vim: edit a register?
    ... Repeat the process multiple times (with s/bar/baz.. ... > is time consuming to mark and copy and do the substitution. ... > What I like to do is, yank the "template" code into a register, say a. ...
    (comp.editors)
  • Vim: edit a register?
    ... I would like to yank a few C functions into register a. ... It is time consuming to mark and copy and do the substitution. ... template code in this file and do the %s onit. ...
    (comp.editors)

Loading