tree-sitter-grammars/tree-sitter-vim

feature: support shebang

Freed-Wu opened this issue · 5 comments

Did you check the tree-sitter docs?

Is your feature request related to a problem? Please describe.

#!/usr/bin/env -S vi -u
echo 1

Describe the solution you'd like

Support shebang in tree-sitter

Describe alternatives you've considered

highlight default link shebang Special
augroup Shebang
  autocmd!
  autocmd BufEnter * syntax match shebang /\%^#!.*$/ display
augroup END

Additional context

No response

No; this is not part of the Vim syntax.

vim syntax support shebang. This is a demo:

#!/usr/bin/env vim -u
echo 1
$ chmod +x test.vim
$ ./test.vim
1

No, that's not Vim. That's shell.

See :help #!:

							*:#!*
:#!{anything}		Ignored, so that you can start a Vim script with: >
				#!vim -S
				echo "this is a Vim script"
				quit

That's just a generalized comment marker. Can be added, but low priority.