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

[RFC] Enhance syntax support

Expand Messages
  • me@...
    Apologies in advance; I m not sure if this is the correct avenue for this kind of discussion. I think Vim would stand to reap extraordinary benefits from a
    Message 1 of 3 , May 17 12:41 PM
    • 0 Attachment
      Apologies in advance; I'm not sure if this is the correct avenue for this kind of discussion.

      I think Vim would stand to reap extraordinary benefits from a greater focus on built-in syntax-related functionality and the decoupling of existing syntax features from other features. To illustrate, I ask you to consider the following examples:

      - The option 'define' is a pattern that matches a macro definition. There exists a syntax/highlight group `Define` that could be used for this.

      - The option 'isident' is a pattern that matches an identifier. It is used in conjunction with 'define' and serves a variety of purposes, to a fault: changing the value of this option can break things that should not (or do not have to) strictly be related to identifiers. It's also used for "\i" in patterns. There exists a syntax/highlight group `Identifier` that could be used for this.

      - The option 'iskeyword' defines a "word", which is used for too many things to list -- among them, the `<C-]>` and `g]` normal mode commands, which are used for jumping to the tags under the cursor. Unfortunately, tags are typically syntax items which may or may not constitute a "word". Changing the definition of 'iskeyword', even on a filetype-specific basis, is both overreaching and unsatisfactory; depending on syntactical context, the pattern for an expected identifier at the cursor's location may be widely different. Matching a subset of syntactical items known to exist in tags (identifiers for example) could yield better results.

      - As both a user and script writer, I have often wanted to search for matches based not only on the composition of characters but also syntactical context. The `gd` and `gD` normal commands, for example, do a rudimentary search to attempt to find the definition of the `<cword>`, but often perform inadequately in non-C languages. A search with syntactical criteria could make this far more accurate.

      What I'm suggesting is a concerted effort to further develop and build upon Vim's existing syntax features in general. I posit that this will encourage and foster better ftplugins and, ultimately, a more robust and responsive interface to users' code at a decreased development cost to scripters.

      Even only what I've explicitly outlined represents a great deal of work, and there must no doubt be a great deal of discussion before work may be considered, as well, so what I submit to you all is a request only for that discussion; I would love to see greater support for this in my editor of choice, and I don't think I'm alone. Let's talk about it.

      Thanks for reading, and sorry again if this proselytism is misplaced.

      --
      --
      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/groups/opt_out.
    • Ben Fritz
      ... You say decouple which means make them less dependent on each other . But your examples seem to be asking for making various commands more
      Message 2 of 3 , May 18 8:09 AM
      • 0 Attachment
        On Friday, May 17, 2013 2:41:33 PM UTC-5, m...@... wrote:
        > Apologies in advance; I'm not sure if this is the correct avenue for this kind of discussion.
        >
        > I think Vim would stand to reap extraordinary benefits from a greater focus on built-in syntax-related functionality and the decoupling of existing syntax features from other features.

        You say "decouple" which means "make them less dependent on each other". But your examples seem to be asking for making various commands more context-aware, which would probably be *more* coupled to syntax, not less. Which do you want?

        --
        --
        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/groups/opt_out.
      • me@...
        ... What I mean by this is that there are things like iskeyword and isident and define and commentstring , options which are -- or, at least, could be
        Message 3 of 3 , May 22 8:08 AM
        • 0 Attachment
          > You say "decouple" which means "make them less dependent on each other". But your examples seem to be asking for making various commands more context-aware, which would probably be *more* coupled to syntax, not less. Which do you want?

          What I mean by this is that there are things like 'iskeyword' and 'isident' and 'define' and 'commentstring', options which are -- or, at least, could be -- relevant to the syntax of the file type, which could be perhaps better and more ubiquitously handled by Vim's syntax functionality rather than a pattern option. It seems to me as though we have a perfectly good hammer for this nail, and we're reaching for the screwdriver. This is what I mean by decoupling syntax features from other features; make syntax-dependent configuration dependent on the syntax functionality, and not on options that are in many cases untouchable on penalty of everything breaking.

          I'm also calling for additional usage of the syntax functionality to make scripting for file types easier -- for example, it would be useful to have a built-in search function that allows you to specify syntax group matches in addition to pattern matching. I cite again the example of tag jumping -- using more flexible syntax concepts like "identifier" instead of the less code-aware "word" when determining what tag to jump to could be useful.

          --
          --
          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/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.