On Wed, Mar 18, 2015 at 06:46:15PM -0700, Yuri Vic wrote:
> In these Bourne shell statements in .sh file:
> 
> val=$((some_variable - 1))
> val=$(some_function_or_command)
> val=$(${SOME_VAR} arg1 arg2)
> 
> enclosing dollar sign and braces highlighted as red, even though this is a
> valid shell syntax.

To quote :help ft-sh-syntax

  Vim attempts to determine which shell type is in use by specifying that
  various filenames are of specific types: >

      ksh : .kshrc* *.ksh
      bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
  <
  If none of these cases pertain, then the first line of the file is examined
  (ex. /bin/sh  /bin/ksh        /bin/bash).  If the first line specifies a 
shelltype,
  then that shelltype is used.
  …
  One may specify a global default by instantiating one of the following three
  variables in your <.vimrc>:

      ksh: >
        let g:is_kornshell = 1
  <   posix: (using this is the same as setting is_kornshell to 1) >
        let g:is_posix     = 1
  <   bash: >
        let g:is_bash      = 1
  <   sh: (default) Bourne shell >
        let g:is_sh        = 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. 

So, you haven't provided enough information for Vim to know which shell
you're targetting.  Do so and the highlighting will work as you expect.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui