From: Christian Brabandt Date: Mon, 9 Feb 2026 20:51:58 +0000 (+0000) Subject: runtime(doc): clarify the use of 'iskeyword' option value X-Git-Tag: v9.1.2145~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e456e52df83f64075ce94c9a5adc43e221a6d3c;p=thirdparty%2Fvim.git runtime(doc): clarify the use of 'iskeyword' option value In particular, also mention the difference between the regex atom \k and what Vim considers for a word character. closes: #18688 Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 582712fbb0..7c1a53e1ed 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 9.1. Last change: 2025 Nov 09 +*motion.txt* For Vim version 9.1. Last change: 2026 Feb 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -429,8 +429,10 @@ These commands move over words or WORDS. *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. +tabs, ). This can be changed with the 'iskeyword' option. For +characters above 255, a word ends when the Unicode character class changes +(e.g., between letters, subscripts, emojis, etc). An empty line is also +considered to be a word. *WORD* A WORD consists of a sequence of non-blank characters, separated with white space. An empty line is also considered to be a WORD. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index ce4ee6c80e..4cea34fe95 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5354,7 +5354,13 @@ A jump table for the options with a short description can be found at |Q_op|. "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See 'isfname' for a description of the format of this option. For '@' characters above 255 check the "word" character class (any character - that is not white space or punctuation). + that is categorized as a letter, number or emoji according to the + Unicode general category). + + Note that there is a difference between the "\k" character class and + the |word| motion. The former matches any word character, while the + latter stops at a change of the character class. + For C programs you could use "a-z,A-Z,48-57,_,.,-,>". For a help file it is set to all non-blank printable characters except '*', '"' and '|' (so that CTRL-] on a command finds the help for that