Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shebang detect #!/usr/bin/env -S nvim -l for lua syntax #12722

Open
Freed-Wu opened this issue Aug 2, 2023 · 5 comments · May be fixed by #12794
Open

Add shebang detect #!/usr/bin/env -S nvim -l for lua syntax #12722

Freed-Wu opened this issue Aug 2, 2023 · 5 comments · May be fixed by #12794

Comments

@Freed-Wu
Copy link
Contributor

Freed-Wu commented Aug 2, 2023

nvim -l can accept lua syntax:

❯ nvim --help
Usage:
  nvim [options] [file ...]      Edit file(s)
  nvim [options] -t <tag>        Edit file where tag is defined
  nvim [options] -q [errorfile]  Edit file with first error

Options:
  --                    Only file names after this
  +                     Start at end of file
  --cmd <cmd>           Execute <cmd> before any config
  +<cmd>, -c <cmd>      Execute <cmd> after config and first file
  -l <script> [args...] Execute Lua <script> (with optional args)
  ...
@chrisbra
Copy link
Member

chrisbra commented Aug 8, 2023

Sorry, is this for Neovim?

@dkearns
Copy link
Contributor

dkearns commented Aug 8, 2023

It makes sense either way. A Lua file is a Lua file.

@chrisbra
Copy link
Member

chrisbra commented Aug 8, 2023

sorry, don't get it...

@dkearns
Copy link
Contributor

dkearns commented Aug 8, 2023

I might have misunderstood your question. I thought you were asking if the PR was misdirected and intended for NeoVim.

If I understand the issue correctly any shebang line ending in nvim -l is specifying raw Lua content. So this makes sense to be included in Vim.

I can create a PR tomorrow.

@chrisbra
Copy link
Member

chrisbra commented Aug 8, 2023

sure, please go ahead. Thanks!

dkearns added a commit to dkearns/vim that referenced this issue Aug 10, 2023
Nvim specifies Lua scripts with the -l and -ll options so match nvim
shebang lines with these options as as file type Lua.

E.g., #!/usr/bin/env -S nvim -l

Fixes vim#12722
dkearns added a commit to dkearns/vim that referenced this issue Aug 14, 2023
Nvim specifies Lua scripts with the -l and -ll options so match nvim
shebang lines with these options as as file type Lua.

E.g., #!/usr/bin/env -S nvim -l

Fixes vim#12722
dkearns added a commit to dkearns/vim that referenced this issue Aug 27, 2023
Problem:  Script filetype cannot be specified by shebang-line command
          args
Solution: Capture command args and make them available for later testing

E.g., the following are Lua scripts

Fixes vim#12722
dkearns added a commit to dkearns/vim that referenced this issue Aug 27, 2023
Problem:  Script filetype cannot be specified by shebang-line command
          args
Solution: Capture command args and make them available for later testing

E.g., the following are Lua scripts

 #!/usr/bin/env -S nvim -l
 #!/usr/bin/pandoc --lua-filter

Fixes vim#12722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants