On Monday, January 7, 2019 at 8:55:21 AM UTC+13, 38spl wrote: > the following is valid bash(1) code to trim the last character of a string: > > string="${string::$((${#string}-1))}" > > The characters in bold above are highlighted as if they are syntax errors.
>From :help sh.vim: One may specify a global default by instantiating one of the following variables in your <.vimrc>: ... bash: let g:is_bash = 1 ... If there's no "#! ..." line, and the user hasn't availed himself/herself of a default sh.vim syntax setting as just shown, then syntax/sh.vim will assume the Bourne shell syntax. If I add a shebang line, #/bin/bash, or I let g:is_bash = 1 in my .vimrc, that line of code is highlighted without indicating an error. So, in your vim, what does this say: :echo b:is_bash if it says E121: Undefined variable: b:is_bash then the code has not been recognized as bash. Note that setting is_bash doesn't have an effect immediately, only after a reload or otherwise re-executing the syntax script, by, say, turning syntax off and on. Regards, John Little -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.