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

small sh.vim patch

Expand Messages
  • Will Fiveash
    Attached is a tiny patch to update sh.vim to support ksh93 s ${!var[*]} associative array index key list dereference syntax. Basically, if foo is an
    Message 1 of 10 , Aug 8, 2014
    • 0 Attachment
      Attached is a tiny patch to update sh.vim to support ksh93's ${!var[*]}
      associative array index key list dereference syntax.
      Basically, if foo is an associative array, print ${!foo[*]} would output
      all the index keys associated with foo.

      --
      Will Fiveash
      Oracle Solaris Software Engineer

      --
      --
      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+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Charles E Campbell
      ... Thanks! I ve put an updated syntax/sh.vim onto my website: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH. Chip Campbell -- -- You received this
      Message 2 of 10 , Aug 8, 2014
      • 0 Attachment
        Will Fiveash wrote:
        > Attached is a tiny patch to update sh.vim to support ksh93's ${!var[*]}
        > associative array index key list dereference syntax.
        > Basically, if foo is an associative array, print ${!foo[*]} would output
        > all the index keys associated with foo.
        >
        Thanks! I've put an updated syntax/sh.vim onto my website:
        http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH.

        Chip Campbell

        --
        --
        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+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Gary Johnson
        ... I m seeing some odd coloring of comments following set commands. In the following example, the comment retains the shSetList coloring of ignoreeof , and
        Message 3 of 10 , Aug 9, 2014
        • 0 Attachment
          On 2014-08-08, Charles E Campbell wrote:

          > Thanks! I've put an updated syntax/sh.vim onto my website:
          > http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH.

          I'm seeing some odd coloring of comments following 'set' commands.

          In the following example, the comment retains the shSetList coloring
          of 'ignoreeof', and because the text following the '#' is not
          considered a comment, the single-quote begins a region of
          shSingleQuote.

          set -o ignoreeof # Don't let Ctrl-D exit the shell.

          I took a stab at fixing the problem by terminating shSetList regions
          with an additional end pattern:

          end="\s#"me=e-2

          A patch is attached.

          Caveat: I don't really know what I'm doing when it comes to syntax
          files or what the side-effects of this change might be. It looked
          like it might work and it did.

          Regards,
          Gary

          --
          --
          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+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Charles E Campbell
          ... Hello, Gary: Are you actually using the old Bourne shell? This problem does not appear when using the Korn/Posix shell or the Bash shell. Try reading a
          Message 4 of 10 , Aug 9, 2014
          • 0 Attachment
            Gary Johnson wrote:
            > set -o ignoreeof # Don't let Ctrl-D exit the shell.
            Hello, Gary:

            Are you actually using the old Bourne shell? This problem does not
            appear when using the Korn/Posix shell or the Bash shell. Try reading a
            bit of :help sh.vim .

            Regards,
            Chip Campbell

            --
            --
            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+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • Gary Johnson
            ... No, I m using bash and I have let g:is_bash = 1 in my .vimrc. I just tried another experiment to try to eliminate the influence of non-standard files. I
            Message 5 of 10 , Aug 9, 2014
            • 0 Attachment
              On 2014-08-09, Charles E Campbell wrote:
              > Gary Johnson wrote:
              > >set -o ignoreeof # Don't let Ctrl-D exit the shell.
              > Hello, Gary:
              >
              > Are you actually using the old Bourne shell? This problem does not
              > appear when using the Korn/Posix shell or the Bash shell. Try
              > reading a bit of :help sh.vim .

              No, I'm using bash and I have

              let g:is_bash = 1

              in my .vimrc.

              I just tried another experiment to try to eliminate the influence of
              non-standard files. I executed the following.

              $ vim -N -u NONE -i NONE -c 'let g:is_bash=1' -c 'syntax on' ignoreeof.sh

              where ignoreeof.sh contains only the line shown above.

              Here is the output of :scriptnames.

              1: /usr/local/share/vim/vim74/syntax/syntax.vim
              2: /usr/local/share/vim/vim74/syntax/synload.vim
              3: /usr/local/share/vim/vim74/syntax/syncolor.vim
              4: ~/Dropbox/vimfiles/filetype.vim
              5: /usr/local/share/vim/vim74/filetype.vim
              6: ~/Dropbox/vimfiles/ftdetect/csv.vim
              7: ~/Dropbox/vimfiles/ftdetect/mediawiki.vim
              8: ~/Dropbox/vimfiles/syntax/sh.vim
              9: /usr/local/share/vim/vim74/syntax/sh.vim

              The syntax/sh.vim file is the one I just downloaded from your site,
              version 138, Aug 08, 2014.

              That one line is highlighted as I described previously and as
              illustrated below.

              set -o ignoreeof # Don't let Ctrl-D exit the shell.
              --- -- --------- ----- ----------------------------
              | | | | - |
              | | cyan shShellList | | red shSingleQuote
              | | | |
              | violet shSetOption | yellow shQuote
              | |
              yellow shSet cyan shShellList

              It should instead be that the # and everything to the right is
              highlighted blue shComment.

              Regards,
              Gary

              --
              --
              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+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Charles Campbell
              ... Hello, Gary: Please try the attached syntax/sh.vim. Thank you for your feedback, Chip Campbell -- -- You received this message from the vim_dev maillist.
              Message 6 of 10 , Aug 11, 2014
              • 0 Attachment
                Gary Johnson wrote:
                > On 2014-08-09, Charles E Campbell wrote:
                >> Gary Johnson wrote:
                >>> set -o ignoreeof # Don't let Ctrl-D exit the shell.
                >> Hello, Gary:
                >>
                >> Are you actually using the old Bourne shell? This problem does not
                >> appear when using the Korn/Posix shell or the Bash shell. Try
                >> reading a bit of :help sh.vim .
                >
                Hello, Gary:

                Please try the attached syntax/sh.vim.

                Thank you for your feedback,
                Chip Campbell

                --
                --
                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+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              • Gary Johnson
                ... Chip, Thank you. It works great. Regards, Gary -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the
                Message 7 of 10 , Aug 11, 2014
                • 0 Attachment
                  On 2014-08-11, Charles Campbell wrote:
                  > Gary Johnson wrote:
                  > >On 2014-08-09, Charles E Campbell wrote:
                  > >>Gary Johnson wrote:
                  > >>>set -o ignoreeof # Don't let Ctrl-D exit the shell.
                  > >>Hello, Gary:
                  > >>
                  > >>Are you actually using the old Bourne shell? This problem does not
                  > >>appear when using the Korn/Posix shell or the Bash shell. Try
                  > >>reading a bit of :help sh.vim .
                  > >
                  > Hello, Gary:
                  >
                  > Please try the attached syntax/sh.vim.

                  Chip,

                  Thank you. It works great.

                  Regards,
                  Gary

                  --
                  --
                  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+unsubscribe@....
                  For more options, visit https://groups.google.com/d/optout.
                • Gary Johnson
                  ... Chip, I installed this file into ~/.vim/syntax and as I said, it works fine with a current Vim. But then I happened to run an older version of Vim
                  Message 8 of 10 , Aug 15, 2014
                  • 0 Attachment
                    On 2014-08-11, Gary Johnson wrote:
                    > On 2014-08-11, Charles Campbell wrote:
                    > > Gary Johnson wrote:
                    > > >On 2014-08-09, Charles E Campbell wrote:
                    > > >>Gary Johnson wrote:
                    > > >>>set -o ignoreeof # Don't let Ctrl-D exit the shell.
                    > > >>Hello, Gary:
                    > > >>
                    > > >>Are you actually using the old Bourne shell? This problem does not
                    > > >>appear when using the Korn/Posix shell or the Bash shell. Try
                    > > >>reading a bit of :help sh.vim .
                    > > >
                    > > Hello, Gary:
                    > >
                    > > Please try the attached syntax/sh.vim.
                    >
                    > Chip,
                    >
                    > Thank you. It works great.

                    Chip,

                    I installed this file into ~/.vim/syntax and as I said, it works
                    fine with a current Vim. But then I happened to run an older
                    version of Vim (7.2.330) that shares that same ~/.vim and got a
                    number of errors about the and() function:

                    E117: Unknown function: and

                    I just added

                    if !exists("*and")
                    finish
                    endif

                    near the top of the syntax file so that the older Vim would fall
                    back to using $VIMRUNTIME/syntax/sh.vim.

                    Maybe this file now needs a version test such as the ones you use in
                    plugin/netrwPlugin.vim.

                    Regards,
                    Gary

                    --
                    --
                    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+unsubscribe@....
                    For more options, visit https://groups.google.com/d/optout.
                  • Charles E Campbell
                    ... Please try the syntax file syntax/sh.vim from my website: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH. With it older vims not having and()
                    Message 9 of 10 , Aug 16, 2014
                    • 0 Attachment
                      Gary Johnson wrote:
                      > On 2014-08-11, Gary Johnson wrote:
                      >> On 2014-08-11, Charles Campbell wrote:
                      >>> Gary Johnson wrote:
                      >>>> On 2014-08-09, Charles E Campbell wrote:
                      >>>>> Gary Johnson wrote:
                      >>>>>> set -o ignoreeof # Don't let Ctrl-D exit the shell.
                      >>>>> Hello, Gary:
                      >>>>>
                      >>>>> Are you actually using the old Bourne shell? This problem does not
                      >>>>> appear when using the Korn/Posix shell or the Bash shell. Try
                      >>>>> reading a bit of :help sh.vim .
                      >>> Hello, Gary:
                      >>>
                      >>> Please try the attached syntax/sh.vim.
                      >> Chip,
                      >>
                      >> Thank you. It works great.
                      > Chip,
                      >
                      > I installed this file into ~/.vim/syntax and as I said, it works
                      > fine with a current Vim. But then I happened to run an older
                      > version of Vim (7.2.330) that shares that same ~/.vim and got a
                      > number of errors about the and() function:
                      >
                      > E117: Unknown function: and
                      >
                      > I just added
                      >
                      > if !exists("*and")
                      > finish
                      > endif
                      >
                      > near the top of the syntax file so that the older Vim would fall
                      > back to using $VIMRUNTIME/syntax/sh.vim.
                      >
                      > Maybe this file now needs a version test such as the ones you use in
                      > plugin/netrwPlugin.vim.
                      >
                      Please try the syntax file syntax/sh.vim from my website:
                      http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH. With it older
                      vims not having and() will simply allow toggling of folding instead of
                      supporting particular subsets.

                      Regards,
                      Chip Campbell

                      --
                      --
                      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+unsubscribe@....
                      For more options, visit https://groups.google.com/d/optout.
                    • Gary Johnson
                      ... That fixed it. Thanks again. Regards, Gary -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text
                      Message 10 of 10 , Aug 16, 2014
                      • 0 Attachment
                        On 2014-08-16, Charles E Campbell wrote:
                        > Gary Johnson wrote:
                        > >On 2014-08-11, Gary Johnson wrote:
                        > >>On 2014-08-11, Charles Campbell wrote:
                        > >>>Gary Johnson wrote:
                        > >>>>On 2014-08-09, Charles E Campbell wrote:
                        > >>>>>Gary Johnson wrote:
                        > >>>>>>set -o ignoreeof # Don't let Ctrl-D exit the shell.
                        > >>>>>Hello, Gary:
                        > >>>>>
                        > >>>>>Are you actually using the old Bourne shell? This problem does not
                        > >>>>>appear when using the Korn/Posix shell or the Bash shell. Try
                        > >>>>>reading a bit of :help sh.vim .
                        > >>>Hello, Gary:
                        > >>>
                        > >>>Please try the attached syntax/sh.vim.
                        > >>Chip,
                        > >>
                        > >>Thank you. It works great.
                        > >Chip,
                        > >
                        > >I installed this file into ~/.vim/syntax and as I said, it works
                        > >fine with a current Vim. But then I happened to run an older
                        > >version of Vim (7.2.330) that shares that same ~/.vim and got a
                        > >number of errors about the and() function:
                        > >
                        > > E117: Unknown function: and
                        > >
                        > >I just added
                        > >
                        > > if !exists("*and")
                        > > finish
                        > > endif
                        > >
                        > >near the top of the syntax file so that the older Vim would fall
                        > >back to using $VIMRUNTIME/syntax/sh.vim.
                        > >
                        > >Maybe this file now needs a version test such as the ones you use in
                        > >plugin/netrwPlugin.vim.
                        > >
                        > Please try the syntax file syntax/sh.vim from my website:
                        > http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH. With it
                        > older vims not having and() will simply allow toggling of folding
                        > instead of supporting particular subsets.

                        That fixed it. Thanks again.

                        Regards,
                        Gary

                        --
                        --
                        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+unsubscribe@....
                        For more options, visit https://groups.google.com/d/optout.
                      Your message has been successfully submitted and would be delivered to recipients shortly.