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

VIM highlights valid POSIX shell syntax as errorneous #1147

Closed
andrewshadura opened this issue Oct 4, 2016 · 6 comments
Closed

VIM highlights valid POSIX shell syntax as errorneous #1147

andrewshadura opened this issue Oct 4, 2016 · 6 comments

Comments

@andrewshadura
Copy link

As I noted in [1], POSIX specifies both $(…) syntax and $((…)), see §2.6.3 and §2.6.4.

However, the current VIM version highlights both of those as invalid syntax when #!/bin/sh shebang is used.

@jamessan
Copy link
Contributor

jamessan commented Oct 4, 2016

:help ft-sh-syntax describes how to make the sh syntax default to POSIX.

When you see the erroneous highlighting, does :echo b:is_sh show 1? If so, then the auto-detection of whether /bin/sh is a POSIX shell didn't get triggered and you don't have let g:is_posix = 1 in your vimrc, so the highlighting is defaulting to Bourne syntax.

@chrisbra
Copy link
Member

chrisbra commented Oct 5, 2016

Closing, as this behaviour is documented. Please ask user questions on the appropriate forums. Thanks.

@chrisbra chrisbra closed this as completed Oct 5, 2016
@andrewshadura
Copy link
Author

@chrisbra, why have you closed it? It is documented, yet it is wrong, and has to be changed.

@chrisbra
Copy link
Member

chrisbra commented Oct 5, 2016

I think it is configurable, so please read the relevant help section :h ft-sh-syntax

@andrewshadura
Copy link
Author

I did read it, it didn’t answer my question. Korn shell isn’t the same as POSIX shell, and it’s 2016, there probably are very few machines having the original Bourne shell as /bin/sh. Is it good to still assume /bin/sh is non-POSIX-compliant?

@chrisbra
Copy link
Member

chrisbra commented Oct 5, 2016

I don't know. You might want to discuss this issue with Charles as maintainer of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants