Re: Cut, Copy, Paste Nightmare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-06-01 at 16:19 +0930, Tim wrote:
> Tim:
> >> Linux:  I have some document with a word I'd like to replace.  I
> >> *have* to delete the word, find and highlight its new replacement,
> >> paste it into the document.
> 
> Todd Zullinger:
> > For me, this would be done in vim with a search and replace.
> > 
> >     :%s/old/new/g
> 
> Sometimes you don't want to replace every instance, that's where copy
> and paste would (otherwise) be more useful.

Errr...
 %s/old/new/gc
             ^confirm
Or for a more interactive feel:
/old<enter>  <-position to 1st instance
cw           <-change word
new<escape>  <-type the replacement
n            <-move to next instance of 'old'
.            <-repeat last command
n.n.n. (etc., just skip the . if you don't want to replace)

Basically any command can be repeated with the '.' and it even
spans multiple files if you put them all on the vi command line
and move through them with :n.

Visual cut/paste is most useful in very short items where you
can easily see the relevant section.  If any parts are out of
sight or take significant navigation to reach, commands that
act directly are much faster.

-- 
  Les Mikesell
   lesmikesell@xxxxxxxxx


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux