You can run these scripts in vim editor in normal mode.

:source hi.vim

Or you can use:

vim -e -c 'redir >> /dev/stdout' -S hi.vim -c 'q'

or

vim -e '+redir >> /dev/stdout' -S hi.vim '+q'

Examples

Hi

Reference

Learn Vimscript the Hard Way VimL Learn Learn X in Y minutes Vim scripting cheatsheet