I am writing a Bash script that runs a command-line program (Gromacs), saves the results, modifies the input files, and then loops through the process again.
I am trying
You can script Vim via the -c
flag.
vim -c "set ff=dos" -c wq mine.mak
However that only gets you so far.
:normal
. e.g. :norm dd
commands.vim
) and then :source
via -S
.:h ex-cmd-index
So you will end up with something like this. With all your Vim commands inside of commands.vim
.
vim -S commands.vim mine.mak
You may also want to look into using sed
and/or awk
for text processing.