+ Reply to Thread
Results 1 to 3 of 3

Thread: VI: Search and Replace

  1. #1
    Wanch Guest

    VI: Search and Replace

    I am constantly looking this up so I figured I would post it here in the tip section.

    VI Search and Replace Commands

    First occurrence on current line:
    Code:
      :s/OLD/NEW
    Globally (all) on current line:
    Code:
      :s/OLD/NEW/g
    Between two lines #,#:
    Code:
       :#,#s/OLD/NEW/g
    Every occurrence in file:
    Code:
       :%s/OLD/NEW/g

  2. CODECALL Circuit advertisement

     
  3. #2
    Jordan Guest
    Very nice, thank you! I've thought about putting together a TotalPenguin vi Cheat Sheet. What do you think?

  4. #3
    Tor
    Tor is offline Programming Expert
    Join Date
    Oct 2007
    Posts
    488
    Rep Power
    0
    I think that would be a good idea. What format, PDF?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 09-15-2010, 06:19 AM
  2. Replies: 1
    Last Post: 03-18-2010, 10:15 AM
  3. search and replace question
    By jonnyfolk in forum PHP Development
    Replies: 7
    Last Post: 03-03-2010, 05:31 AM
  4. Looking for search and replace feature.
    By Billboard in forum C and C++
    Replies: 0
    Last Post: 01-04-2010, 12:33 AM
  5. search and replace over a file
    By dirdamalah0 in forum PHP Development
    Replies: 1
    Last Post: 06-21-2008, 06:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts