How can I execute a bunch of editor commands stored in a file in VIM?

Posted by LES2 on Stack Overflow See other posts from Stack Overflow or by LES2
Published on 2010-03-09T16:49:03Z Indexed on 2010/03/27 22:03 UTC
Read the original article Hit count: 231

Filed under:
|
|
|
|

I have read the other posts, e.g., http://stackoverflow.com/questions/1830886/vim-executing-a-list-of-editor-commands and others. The answer isn't clear to me for my case. I have some editor commands that I generated from an SQL query. It uses :s/foo/bar to change country codes (from FIPS to a non-standard code set). Here's a sample of the file:

:s/CB/CAMBO
:s/CQ/NMARI
:s/KV/KOSOV
:s/PP/PAPUA
...

I have saved that in a file called fipsToNonStd.vim (unsure about the correct extension). I want to run those commands one after another. What's the easiest way to do so?

Thanks a bunch! SO Rocks!

© Stack Overflow or respective owner

Related posts about vim

Related posts about scripts