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

Re: Running a Set of Commands from a File

Expand Messages
  • Charles E Campbell Jr
    ... No. ... Not if its composed of vim commands. Please be aware that the sourcing of commands is done in command mode; if you have normal mode commands,
    Message 1 of 3 , Aug 31, 2006
    • 0 Attachment
      Mike Blonder wrote:

      >I have saved a file called 'commands.' This file has all of the
      >commands (g /foobar/,/goobar/ d, etc) I need to edit some very large
      >files. I want to 'run' this commands file from within each of the large
      >files that I need to edit.
      >
      >1) do I have to chmod 'commands' as an executable?
      >
      >
      No.

      >2) can I invoke the file from within VIM?, if yes, then what is the
      >syntax?
      >
      >

      :so commands

      >3) would it be better to run it from the shell? (Linux/SuSE)
      >
      >
      Not if its composed of vim commands.

      Please be aware that the sourcing of commands is done in command mode;
      if you have
      normal mode commands, you'll want to be looking into how to use
      ":normal" (:help :normal).

      Also, check out :help -S , a command line option to vim that allows
      the sourcing of files.

      Regards,
      Chip Campbell
    • Mike Blonder
      Hi. I have saved a file called commands. This file has all of the commands (g /foobar/,/goobar/ d, etc) I need to edit some very large files. I want to
      Message 2 of 3 , Aug 31, 2006
      • 0 Attachment
        Hi.

        I have saved a file called 'commands.' This file has all of the
        commands (g /foobar/,/goobar/ d, etc) I need to edit some very large
        files. I want to 'run' this commands file from within each of the large
        files that I need to edit.

        1) do I have to chmod 'commands' as an executable?
        2) can I invoke the file from within VIM?, if yes, then what is the
        syntax?
        3) would it be better to run it from the shell? (Linux/SuSE)

        Thanks

        Mike
      • striker
        I have a set of quotes that I download as a .html file and then manipulate. I use a file called data.vim to do everything I need. I run the file in Vim with
        Message 3 of 3 , Aug 31, 2006
        • 0 Attachment
          I have a set of quotes that I download as a .html file and then
          manipulate. I use a file called data.vim to do everything I need.
          I run the file in Vim with the command :so data.vim

          Here is an example from the file:

          :e ~/Desktop/sf.html
          :v/String('/d
          :execute "norm vf'df'D"
          :%s/|/\r/g
          :%!sort
          :sav! /Applications/Trendsetter/Data/SFU06
          :bd

          On Aug 31, 2006, at 12:32 PM, Charles E Campbell Jr wrote:

          > Mike Blonder wrote:
          >
          >> I have saved a file called 'commands.' This file has all of the
          >> commands (g /foobar/,/goobar/ d, etc) I need to edit some very large
          >> files. I want to 'run' this commands file from within each of the
          >> large
          >> files that I need to edit.
          >> 1) do I have to chmod 'commands' as an executable?
          >>
          > No.
          >
          >> 2) can I invoke the file from within VIM?, if yes, then what is the
          >> syntax?
          >>
          >
          > :so commands
          >
          >> 3) would it be better to run it from the shell? (Linux/SuSE)
          >>
          > Not if its composed of vim commands.
          >
          > Please be aware that the sourcing of commands is done in command
          > mode; if you have
          > normal mode commands, you'll want to be looking into how to use
          > ":normal" (:help :normal).
          >
          > Also, check out :help -S , a command line option to vim that
          > allows the sourcing of files.
          >
          > Regards,
          > Chip Campbell
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.