Match shebang lines in Vim9 and legacy script.
Mark these as an error if they appear anywhere other than the first line of a legacy-script file. In Vim9 script these match as normal line comments rather than an error.
https://github.com/vim/vim/pull/15011
(8 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
oh does this actually work? can we use a shebang line and run a vimscript directly? Is this documented somewhere?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Merged #15011 into master.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
See :help :#!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Interesting, I wasn't aware. of this. I searched the help for shebang
but didn't find anything, so let me add this help-tag
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Patch 7.0.056, for the curious.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
You need to make it executable: chmod +x foo.vim && ./foo.vim
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
The example worked for me correctly. Of course you need to remove the :q
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
The example is a bit silly as it just echos a messsage in Vim then quits immediately.
Perhaps you could add a better example, like a filter or similar?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
How about this:
#!/bin/vim -S
let mylogbook='$HOME/logbook.md'
exe ':e ' .. mylogbook
$
put ='## ' .. strftime('%m. %b %Y')
norm! o
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
no, first line was the matter.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.