Loading ...
Sorry, an error occurred while loading the content.

49553RE: >> help with scripting vim

Expand Messages
  • Sean C. Hubbell
    Apr 22, 2004
    • 0 Attachment

      % - global
      s - substitute
      . needs to be escaped as it is a special character
      ! -just the delimiter I used
      g - all occurrences on the line

      I have a perl script that I wrote a while back that globs files in the
      current directory. I do not know if you have perl installed, but if you
      would like it I will send it to you (I will not send attachments to the
      list). The example usage is

      snr.pl OldPattern NewPattern File/s


      snr.pl "192\.168\.1\.1" "192\.168\.1\.2" *.c



      -----Original Message-----
      From: lists@... [mailto:lists@...]
      Sent: Thursday, April 22, 2004 2:54 PM
      To: vim@...
      Subject: >> help with scripting vim

      Hello list,

      I am stuck trying to write a bash shell script that can edit a text file.
      I was hoping that someone could show me how to do this with vim from
      within a bash script.

      Here's what I need to do:

      open file test.txt with vim
      search for and replace with
      save the file and exit vim

    • Show all 9 messages in this topic