[vim] Allow adding non-ASCII characters to iskeyword (#576)

75 views
Skip to first unread message

Matthew Orlando

unread,
Jan 23, 2016, 3:21:36 PM1/23/16
to vim/vim

Vim is not treating Unicode's For All character as alphanumeric, so I'm having trouble getting the syntax highlighting & word boundary navigation to work with jank.

Vim's documentation is very clear on this, but doesn't seem to offer any justification:

word:

A word consists of a sequence of letters, digits and underscores, or a sequence of other non-blank characters, separated with white space (spaces, tabs, ). This can be changed with the 'iskeyword' option. An empty line is also considered to be a word.

iskeyword:

Keywords are used in searching and recognizing with many commands: "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See 'isfname' for a description of the format of this option.

isfname (emphasis mine):

Multi-byte characters 256 and above are always included, only the characters up to 255 are specified with this option. For UTF-8 the characters 0xa0 to 0xff are included as well.

Besides the inability to add or remove characters above 255, the assertion that multi-byte characters are always included is clearly false. λ and ƒ are both multibyte and work fine in keyword syntax specs. ∀ is multibyte, but does not behave like them.


Reply to this email directly or view it on GitHub.

Noah Luck Easterly

unread,
Oct 31, 2019, 8:51:51 AM10/31/19
to vim/vim, Subscribed

Vim excludes Unicode white-space, punctuation and symbols from iskeyword, which is the right thing to do.

As a default, I agree.

However, that's not a reason to prevent users from customizing iskeyword to include arbitrary codepoints.

As another example, agda is extremely liberal in the identifiers it allows to be used for value and type names:

A name part is a non-empty sequence of printable Unicode characters not containing any of the following reserved characters.

@.(){};_

...

This means that strings like x:A and A→B are valid names. To write the type signature and the function type, white space has to be inserted: x : A, and A → B.

For example, right now I've got a function that has an argument dubbed inv-suc-2^⟨e-1⟩-1. It's pretty long and requires two digraphs to type, but since I can't include or in iskeyword, I can't use completion to avoid typing it.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Curiosity

unread,
Jan 29, 2022, 7:58:26 AM1/29/22
to vim/vim, Subscribed

Vim excludes Unicode white-space, punctuation and symbols from iskeyword

where is the official manpage for it ?


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/576/1024906976@github.com>

Curiosity

unread,
Jan 29, 2022, 8:07:01 AM1/29/22
to vim/vim, Subscribed

isfname (emphasis mine):
Multi-byte characters 256 and above are always included, only the characters up to 255 are specified with this option. For > > UTF-8 the characters 0xa0 to 0xff are included as well.

this statement for multi-byte charaters is only right for isfname and isprint, but not for iskeyword

image

I think this statement is quite hard to understand.

For '@'  characters above 255 check the "word" character class (any character
that is not white space or punctuation).

:set iskeyword+=256 or :set iskeyword+=2222, etc. will get E474: Invalid argument: isk+=256 and alike


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/576/1024908439@github.com>

Sandy Maguire

unread,
Jan 26, 2023, 12:31:17 PM1/26/23
to vim/vim, Subscribed

What's the status of this? I work on an Agda filetype plugin, and it would be really nice to properly support Agda's identifiers.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/576/1405353129@github.com>

Bram Moolenaar

unread,
Jan 26, 2023, 3:25:53 PM1/26/23
to vim/vim, Subscribed

I'm not aware of someone working on this. It is going to be a lot of work to implement and test properly.

My idea is that while changing this, the usage should be split up, 'iskeyword' is used for various things that might actually need a different value. This can also be used to split up the work in smaller parts, adding new options that overrule 'iskeyword' for a certain purpose. E.g. start with an option to specify word movement with "w", "e" and "b".


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/576/1405608022@github.com>

Reply all
Reply to author
Forward
0 new messages