[vim/vim] runtime(vim): Update base-syntax, match shebang lines (PR #15011)

17 views
Skip to first unread message

dkearns

unread,
Jun 15, 2024, 6:34:57 AM (11 days ago) Jun 15
to vim/vim, Subscribed

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.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/15011

Commit Summary

  • 028bd23 runtime(vim): Update base-syntax, match shebang lines

File Changes

(8 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011@github.com>

Christian Brabandt

unread,
Jun 15, 2024, 9:05:31 AM (11 days ago) Jun 15
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2169553277@github.com>

Christian Brabandt

unread,
Jun 15, 2024, 9:07:06 AM (11 days ago) Jun 15
to vim/vim, Subscribed

Merged #15011 into master.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011/issue_event/13169103567@github.com>

dkearns

unread,
Jun 15, 2024, 9:07:31 AM (11 days ago) Jun 15
to vim/vim, Subscribed

See :help :#!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011/c2169558116@github.com>

Christian Brabandt

unread,
Jun 15, 2024, 9:50:33 AM (11 days ago) Jun 15
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2169675972@github.com>

dkearns

unread,
Jun 15, 2024, 10:48:43 AM (11 days ago) Jun 15
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2169830661@github.com>

Shane-XB-Qian

unread,
Jun 16, 2024, 9:25:02 AM (10 days ago) Jun 16
to vim/vim, Subscribed

> oh does this actually work? can we use a shebang line and run a vimscript directly? Is this documented somewhere?

interesting too, but how to run it directly? i tried the example in its help, then `./foo.vim` seems failed.
// via bash cli

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011/c2171635780@github.com>

Christian Brabandt

unread,
Jun 16, 2024, 11:12:17 PM (10 days ago) Jun 16
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2172092586@github.com>

Shane-XB-Qian

unread,
Jun 17, 2024, 5:13:06 AM (9 days ago) Jun 17
to vim/vim, Subscribed

> You need to make it executable: `chmod +x foo.vim && ./foo.vim`

yes, it was executable; after look into a bit more, seems the example of help was not accurate, it maynot find vim without path.

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011/c2172808621@github.com>

Christian Brabandt

unread,
Jun 17, 2024, 5:29:11 AM (9 days ago) Jun 17
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2172859490@github.com>

dkearns

unread,
Jun 17, 2024, 5:30:29 AM (9 days ago) Jun 17
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2172861985@github.com>

Shane-XB-Qian

unread,
Jun 17, 2024, 5:43:28 AM (9 days ago) Jun 17
to vim/vim, Subscribed

no, just the shebang needed to specify where vim is as general shebang it is. :sweat_smile:
// but nevermind, it should be no common fixed answer where vim must be.

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15011/c2172900979@github.com>

Christian Brabandt

unread,
Jun 17, 2024, 5:45:07 AM (9 days ago) Jun 17
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2172906760@github.com>

Shane-XB-Qian

unread,
Jun 17, 2024, 5:46:04 AM (9 days ago) Jun 17
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15011/c2172909716@github.com>

Reply all
Reply to author
Forward
0 new messages