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

vimSubst

Expand Messages
  • Charles Smith
    I m trying to colorize a file format, and find that syntax rules for things like vimSubst and vimSubstDelim conflict with my syntax. If I enter syn clear
    Message 1 of 5 , Jun 28, 2011
      I'm trying to colorize a file format, and find that syntax rules for things like vimSubst and vimSubstDelim conflict with my syntax. If I enter "syn clear vimSubst" at the command prompt, the problem goes away, but putting it into my syntax file doesn't work.

      Is there hierarchy of syntax rule importance, where some rules aren't subject to the same rules as others?

      --
      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
    • Charles Campbell
      ... Try putting your syn clear vimSubst in ~/.vim/after/syntax/... Regards, Chip Campbell -- You received this message from the vim_use maillist. Do not
      Message 2 of 5 , Jun 29, 2011
        Charles Smith wrote:
        > I'm trying to colorize a file format, and find that syntax rules for things like vimSubst and vimSubstDelim conflict with my syntax. If I enter "syn clear vimSubst" at the command prompt, the problem goes away, but putting it into my syntax file doesn't work.
        >
        > Is there hierarchy of syntax rule importance, where some rules aren't subject to the same rules as others?
        >
        >
        Try putting your "syn clear vimSubst" in ~/.vim/after/syntax/...

        Regards,
        Chip Campbell

        --
        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
      • Charles Smith
        The after directory is new to me, thank you for introducing it to me. Unfortunately, I can find very little information about how it works exactly (vim
        Message 3 of 5 , Jun 29, 2011
          The "after" directory is new to me, thank you for introducing it to me. Unfortunately, I can find very little information about how it works exactly (vim version 7.2.264).

          I don't understand this mechanism...

          Normally, when a file matching a particular name pattern is loaded
          into a buffer, a syntax file matching that pattern is loaded and
          invoked. Now, the rules that are causing me trouble are defined in a
          file called vim.vim and I don't find any matching patterns using
          that syntax file in my own filetypes.vim or the system-wide one.

          In general, it seems a pity that new features should break such
          simple, unambiguous, and useful functionality as, e.g. "syn clear":

          "This command should be used when you want to switch off syntax
          highlighting, or when you want to switch to using another syntax.
          It's normally not needed in a syntax file itself, because syntax is
          cleared by the autocommands that load the syntax file. The command
          also deletes the "b:current_syntax" variable, since no syntax is
          loaded after this command."

          Hopefully, I'm still missing something ...

          cts

          --- On Wed, 6/29/11, Charles Campbell <Charles.E.Campbell@...> wrote:

          > From: Charles Campbell <Charles.E.Campbell@...>
          > Subject: Re: vimSubst
          > To: vim_use@...
          > Date: Wednesday, June 29, 2011, 6:57 AM
          > Charles Smith wrote:
          > > I'm trying to colorize a file format, and find that
          > syntax rules for things like vimSubst and vimSubstDelim
          > conflict with my syntax.  If I enter "syn clear
          > vimSubst" at the command prompt, the problem goes away, but
          > putting it into my syntax file doesn't work.
          > >
          > > Is there hierarchy of syntax rule importance, where
          > some rules aren't subject to the same rules as others?
          > >
          > >   
          > Try putting your "syn clear vimSubst"
          > in   ~/.vim/after/syntax/...
          >
          > Regards,
          > Chip Campbell
          >
          > --
          > 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 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
        • Charles Campbell
          ... syn clear is not broken. If one loads syntax definitions after a syn clear , then that new syntax applies; in fact, many of the syntax files
          Message 4 of 5 , Jun 30, 2011
            Charles Smith wrote:
            > The "after" directory is new to me, thank you for introducing it to me. Unfortunately, I can find very little information about how it works exactly (vim version 7.2.264).
            >
            > I don't understand this mechanism...
            >
            > Normally, when a file matching a particular name pattern is loaded
            > into a buffer, a syntax file matching that pattern is loaded and
            > invoked. Now, the rules that are causing me trouble are defined in a
            > file called vim.vim and I don't find any matching patterns using
            > that syntax file in my own filetypes.vim or the system-wide one.
            >
            > In general, it seems a pity that new features should break such
            > simple, unambiguous, and useful functionality as, e.g. "syn clear":
            >
            > "This command should be used when you want to switch off syntax
            > highlighting, or when you want to switch to using another syntax.
            > It's normally not needed in a syntax file itself, because syntax is
            > cleared by the autocommands that load the syntax file. The command
            > also deletes the "b:current_syntax" variable, since no syntax is
            > loaded after this command."
            >
            > Hopefully, I'm still missing something ...
            >
            "syn clear" is not broken. If one loads syntax definitions after a "syn
            clear", then that new syntax applies; in fact, many of the syntax files
            distributed with vim have "syn clear" embedded in them.

            So your difficulty I suspect is in understanding the loading sequence.
            Here's some reading on the subject:

            :help .vimrc
            :help load-plugins
            :help 'runtimepath'

            Your first email mentioned that "syn clear" didn't work in your syntax
            file. What is it named, in what directory is it in (so we may infer
            when it gets loaded), how are you triggering your syntax to be loaded
            (.vim/filetype.vim?) and how does syntax/vim.vim get involved?

            Remember that things that are loaded later can modify what's happened
            thus far. So, if your syntax file is loaded with its "syn clear" and
            then syntax/vim.vim is loaded, naturally vim.vim's definitions have not
            been cleared; in this case they weren't even loaded and defined when
            that "syn clear" was issued.

            Regards,
            Chip Campbell

            --
            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
          • Charles Smith
            I ll read the material, thank you, that is surely what I needed. cts ... -- You received this message from the vim_use maillist. Do not top-post! Type your
            Message 5 of 5 , Jul 1, 2011
              I'll read the material, thank you, that is surely what I needed.

              cts

              --- On Thu, 6/30/11, Charles Campbell <Charles.E.Campbell@...> wrote:

              > From: Charles Campbell <Charles.E.Campbell@...>
              > Subject: Re: vimSubst
              > To: vim_use@...
              > Date: Thursday, June 30, 2011, 7:03 AM
              > Charles Smith wrote:
              > > The "after" directory is new to me, thank you for
              > introducing it to me.  Unfortunately, I can find very
              > little information about how it works exactly (vim version
              > 7.2.264).
              > >
              > > I don't understand this mechanism...
              > >
              > >    Normally, when a file matching a
              > particular name pattern is loaded
              > >    into a buffer, a syntax file matching
              > that pattern is loaded and
              > >    invoked.  Now, the rules that are
              > causing me trouble are defined in a
              > >    file called vim.vim and I don't find any
              > matching patterns using
              > >    that syntax file in my own filetypes.vim
              > or the system-wide one.
              > >
              > >    In general, it seems a pity that new
              > features should break such
              > >    simple, unambiguous, and useful
              > functionality as, e.g. "syn clear":
              > >
              > >      "This command should be used when
              > you want to switch off syntax
              > >      highlighting, or when you want to
              > switch to using another syntax.
              > >      It's normally not needed in a
              > syntax file itself, because syntax is
              > >      cleared by the autocommands that
              > load the syntax file.  The command
              > >      also deletes the
              > "b:current_syntax" variable, since no syntax is
              > >      loaded after this command."
              > >
              > > Hopefully, I'm still missing something ...
              > >   
              > "syn clear" is not broken.  If one loads syntax
              > definitions after a "syn clear", then that new syntax
              > applies; in fact, many of the syntax files distributed with
              > vim have "syn clear" embedded in them.
              >
              > So your difficulty I suspect is in understanding the
              > loading sequence.  Here's some reading on the subject:
              >
              > :help .vimrc
              > :help load-plugins
              > :help 'runtimepath'
              >
              > Your first email mentioned that "syn clear" didn't work in
              > your syntax file.  What is it named, in what directory
              > is it in (so we may infer when it gets loaded), how are you
              > triggering your syntax to be loaded (.vim/filetype.vim?) and
              > how does syntax/vim.vim get involved?
              >
              > Remember that things that are loaded later can modify
              > what's happened thus far.  So, if your syntax file is
              > loaded with its "syn clear" and then syntax/vim.vim is
              > loaded, naturally vim.vim's definitions have not been
              > cleared; in this case they weren't even loaded and defined
              > when that "syn clear" was issued.
              >
              > Regards,
              > Chip Campbell
              >
              > -- 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 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
            Your message has been successfully submitted and would be delivered to recipients shortly.