I'm following the page where there is an example how to set-up Vim as a system interpreter for vimscript by setting the following shebang line:
#!/usr/bin/vim -nNesc:let&verbose=1|let&viminfo=""|source%|echo""|qall!
so I did the test by adding %print
, but it prints the current script file.
I obviously don't want to parse my current file which consist commands for Vim, but I want to parse the file from the argument.
What shebang line should I use, so I can use the script as a parser for the file which I will specify in the argument?
For example to execute commands from parser.vim
on file my_file.txt
I would run:
./parser.vim my_file.txt