I want to run some vim stuff from a shell script.
Some issues I can think of
* passing arguments to vim
* don't draw a screen
* seeing output
* seeing errors
The following more or less works; it would be nice
if vim, on an error, automatically exited with an error;
"echo g:what" in this case.
Looking for suggestions and/or alternatives and/or doc ref?
Thanks,
-ernie
Doing:
ex -s -c 'let g:arg = 123' -c 'redir >> /dev/stdout' -c 'source t.vim'
where t.vim is
vim9script
echo g:arg
echo 'foo'
echo g:what
echo "\n"
q
produces the output
123
foo
Error detected while processing command line..script /.../t.vim:
line 4:
E121: Undefined variable: g:what
Entering Ex mode. Type "visual" to go to Normal mode.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/6443a0af-f327-43ec-b6ee-49f855466fe7%40raelity.com.