1

In the Clean language, identifiers consist of either all 'normal' characters ([a-zA-Z][a-zA-Z0-9_`]*) or all 'funky' characters ([~!@#$%^&*-=+:<>,./?|] and perhaps more). What I would like is a iskeyword setting that recognises this. To clarify some examples:

  • <.> should be one word
  • x>y should be split as x, >, y
  • x.y should be split as x, ., y

Is it possible to write an iskeyword that does this properly? I have seen this discussion where the end result seems to be it is not possible, but this is a slightly different use case and something might have changed since 2006.

1

The 'iskeyword' option defines the codepoints for a single keyword character, but cannot make a statement about its neighbors. In other words, you'd need a regular expression (something like [a-zA-Z][a-zA-Z0-9_`]*\|[~!@#$%^&*-=+:<>,./?|]\+), but Vim only offers a set of characters. Therefore, this still isn't possible. You have to pick either normal or funky characters, or live with the fact that a mixture of both that is not separated by whitespace is mistakenly recognized as a single keyword.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy