3
I would like to be able to specify on bash command line set of keys that will vim execute on given file, just the same as I am doing it when manually editing, for instance, hypothetically:
vim myfile +'Gosome footer here<ESC>ggOsome header here<ESC>x'
I know that + executes Ex commands. Is there a way to do that? Using vim only of course.
Thanks m8. Thats very close to what I want. Can't I use hotkeys ? '10-commands-limit' seems pretty low – majkinetor – 2012-12-19T14:08:36.897
@majkinetor: hotkeys? If you're generating commands to run, you could write them to a file and then execute vim with
vim -c 'source cmdfile' myfile
. You may also want to look up-s scriptin
and-w scriptout
or-W scriptout
in the man page, they make it easy to repeat macros across many files. – Thor – 2012-12-19T14:47:02.037