Tuesday, August 25, 2009

Re: Use VIM to perform text manipulation on file (like sed/awk)

On Aug 24, 11:06 am, WL <izaq...@gmail.com> wrote:
> In an interactive VIM session that would have been trivial (/
> <pattern>  then vap then s/^/#/ or s/^#// for example). However I want
> to embed this in a bash script so it must be non interactive.

You've received some good answers, but also see :help -s
and :help :source (and look at the entry for :so[urce]!).

It is possible to save the operations that you would do by hand to a
file, and just run them exactly as if typed. No knowledge of vimscript
required.

You could make it even easier if you first run Vim interactively with -
w to record everything as you type it. See :help -w. The only problem
is you'll need to get it exactly right while you're recording or
you'll need to record again or edit the recorded file.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: