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


Reply via email to