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

RE: underscores causing problems in unix syntax files

Expand Messages
  • Keith Roberts
    ... This is true, but the solution is the same as when I want to change long in this.is.a.long.variable.name to very.long ... I use ct. while my cursor is
    Message 1 of 8 , Aug 31, 2004
    • 0 Attachment
      >-----Original Message-----
      >From: Bram@... [mailto:Bram@...]
      >Sent: Tuesday, August 31, 2004 11:41 AM
      >To: Keith Roberts
      >Cc: Corbin, Aaron R; vim@...
      >Subject: RE: underscores causing problems in unix syntax files
      >
      >
      >Keith Roberts wrote:
      >
      >> Sorry to disagree with the guru :) but why *shouldn't* &iskeyword
      >> be changed in a syntax file if keywords are defined differently in
      >> that "language" from the default? The only caveat being that it
      >> should be done using 'setlocal' rather than 'set'.
      >>
      >> IMHO, that is *exactly* where it should be changed, so that syntax
      >> hilighting can be set appropriately w/o having to resort to
      >> grievous regexp's everywhere. This can't be done if it is set
      >> in an ftplugin instead.
      >>
      >> I use a language with a similar situation: "." is merely another
      >> keyword character, not a separator. That is to say,
      >> this.is.a.long.variable.name needs to be treated as a single
      >> unit, and
      >> highlighted as such. There is no concept of classes or
      >> inheritance or
      >> such in this language. This affects variable name
      >> completion, lookups
      >> (such as lid) and anything else which expects to work on a
      >> 'word' basis.
      >> "$" and "%" are also legitimate in variable names in this
      >> language,
      >> and there's no way to get the functionality I need other
      >> than changing &isk.
      >
      >Practically every language allows adding comments. When you
      >change 'iskeyword' and use a command such as "*" in a comment,
      >it will include a trailing ".". Not exactly what you expected.

      This is true, but the solution is the same as when I want to change
      'long' in this.is.a.long.variable.name to 'very.long' ... I use ct.
      while my cursor is on the 'l' in 'long'. And use t. or f. or fl (or the
      mouse) to get there. Since I do most of my programming in this
      filetype, it's 2nd nature. :)

      The :setlocal command was a real boon, because it let me use this
      customization without adversely affecting other files/buffers. Prior to
      it I had to use BufEnter and BufLeave events to twiddle with the
      settings, and it was rather egregious.

      >I actually often have the problem that "cw" in a help file
      >includes punctuation characters. Fortunately, most people
      >don't edit help files.
      >I just have to be careful with editing them.
      >
      >Including characters like "." and "$" in 'iskeyword' may still
      >be an improvement, but you should be aware of undesired side effects.
    Your message has been successfully submitted and would be delivered to recipients shortly.