Tuesday, August 4, 2020

Re: Error in bash syntax file

On Wed, Jul 29, 2020 at 11:57 PM 'J S' via vim_use
<vim_use@googlegroups.com> wrote:
>
> The following line of legal bash code gets flagged as an error:
>
> echo ${@:i:1}
>
> The above line displays the i'th command line argument.
>
> I am running vim 8.1, with lots of patches applied. My sh.vim files (3 of them) are all dated Jun 15, 2019.

Can you please try a more recent version? I am running a Vim 8.2.1360
which I compiled yesterday night (2020-08-03 23:06:35 UTC) and my
$VIMRUNTIME/syntax/sh.vim (which is the script responsible for syntax
highlighting, including flagging syntax errors) is dated April 14,
2020.

Also, if all your shell scripts are for bash (and *might* use syntax
acceptable to bash but not to legacy sh) you should have
let is_bash = 1
somewhere in your vimrc; if _some_ scripts are bash-specific but
others aren't, you could set this variable to 1, or unset it (and
possibly set another one e.g. is_kornshell), _immediately before_
starting to edit such a script.

see :help ft-bash-syntax for details.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXt5%3Dh5%2Bq8EqGAh1FkO3sn-c09EOE2b0nL1EZbQrMpzvFQ%40mail.gmail.com.

No comments: