Loading ...
Sorry, an error occurred while loading the content.

Re: [vim] shell syntax highlighting

Expand Messages
  • Benji Fisher
    ... I think that you want ... in your vimrc file. The variables b:is_bash and b:is_kornshell should be local to the buffer, not set in the vimrc file. (And
    Message 1 of 9 , Apr 30, 2001
    • 0 Attachment
      Jeroen Valcke wrote:

      > On Mon, Apr 30, 2001 at 04:32:36PM -0400, Charles E. Campbell wrote:
      >
      >> bash, even if it is named sh. Try putting "let is_kornshell=1" or
      >> "let is_bash=1" in your <.vimrc>; that will tell <sh.vim> to
      >> highlight it with the ksh/bash extensions (which include $((...)) ).
      >
      > Indeed, in the sh.vim file there's a reference too $((...)) on line 115.
      > It should be executed when is_bash is set. However I have the line "let
      > is_bash=1" in my .vimrc and still it colors the $(...) red?
      > How is this possible?
      > Thanks for helping me out so far.

      I think that you want

      :let bash_is_sh = 1

      in your vimrc file. The variables b:is_bash and b:is_kornshell should be
      local to the buffer, not set in the vimrc file. (And you probably do not
      need them.)

      :help sh.vim

      HTH
      --Benji Fisher
    • Charles E. Campbell
      Thus saith Charles E. Campbell: CC bash, even if it is named sh. Try putting let is_kornshell=1 or CC let is_bash=1 in your ; that will tell
      Message 2 of 9 , May 1, 2001
      • 0 Attachment
        Thus saith Charles E. Campbell:
        CC> bash, even if it is named sh. Try putting "let is_kornshell=1" or
        CC> "let is_bash=1" in your <.vimrc>; that will tell <sh.vim> to
        CC> highlight it with the ksh/bash extensions (which include $((...)) ).

        Thus saith Jeroen Valcke:
        JV> Indeed, in the sh.vim file there's a reference too $((...)) on line 115.
        JV> It should be executed when is_bash is set. However I have the line "let
        JV> is_bash=1" in my .vimrc and still it colors the $(...) red?
        JV> How is this possible?

        Hmm, looks like there's a bug with 6.0's <sh.vim>; the
        is_kornshell/is_bash global variables weren't being used
        properly. I've sent a New&Improved version to Bram, and
        its available at my website (http://www.erols.com/astronaut/vim ;
        check out the Links at the bottom of the page). It
        won't work with 5.7, though.

        Since you're on the [vim] mailing list, does that mean that
        you're using 5.7? If so, try putting the following line
        in your <.vimrc>:

        let b:is_bash=1

        That's only a partial fix because bringing up the file
        via :e filename for example won't have b:is_bash
        set. In that case, try

        :syn clear
        :let b:is_bash=1
        :so ..path../vim57/synax/sh.vim

        Regards,
        Chip Campbell

        --
        Charles E Campbell, Jr, PhD _ __ __
        Goddard Space Flight Center / /_/\_\_/ /
        cec@... /_/ \/_//_/
        PGP public key: http://www.erols.com/astronaut/pgp.html
      • Jeroen Valcke
        ... Works fine! I m using VIM 5.7.28 Thanks a lot. -- Jeroen Valcke jeroen@valcke.com ICQ# 30116911 Home page:
        Message 3 of 9 , May 1, 2001
        • 0 Attachment
          On Tue, May 01, 2001 at 09:20:09AM -0400, Charles E. Campbell wrote:
          > Since you're on the [vim] mailing list, does that mean that
          > you're using 5.7? If so, try putting the following line
          > in your <.vimrc>:
          >
          > let b:is_bash=1

          Works fine! I'm using VIM 5.7.28
          Thanks a lot.

          --
          Jeroen Valcke jeroen@...
          ICQ# 30116911 Home page: http://www.valcke.com/jeroen
          Phone +32(0)56 32 91 37 Mobile +32(0)486 88 21 26
        Your message has been successfully submitted and would be delivered to recipients shortly.