Questions tagged [keyword]
Keywords are sequences of characters that are included in the 'iskeyword' option. They are commonly referred to as word.
24 questions
1 vote
1 answer
101 views
Vim just started treating "-" as a word character when editing a CSS file
I've been working on a web project for the last week or so, making heavy use of CSS which uses a lot of hyphens in defining attributes. Vim's been working normally until now. For example, if I had ...
2 votes
1 answer
61 views
Why does iskeyword contain colon for TeX files? And where is it set?
From iskeyword's doc I read that its default on Linux is @,48-57,_,192-255. However, when I open a *.tex file, echo &iskeyword gives @,48-57,_,192-255,:. Where in the startup of Vim is that : ...
1 vote
2 answers
52 views
Use Word for `*`/`#`
As a lot of people, I have removed _ from iskeyword, so it considers it kind of like whitespace. This is really useful for changing part of an identifier in languages like Python and Rust with normal ...
1 vote
0 answers
14 views
How can I get language and keyword completion in omnifunc? [duplicate]
Let's say I'm editing this Python script: something = 1 something_else = 2 My cursor is on the third line, in insert mode. When omnifunc is unset, <C-X><C-O> displays an error: E764: ...
4 votes
0 answers
67 views
treat '-' as part of a word if it is followed by a letter, but not '>'
Is there a way to treat dashed-as-one-word but have this-> split into this and -> instead of this- and >?
1 vote
1 answer
98 views
How to have w,e,b-based motions handle underscores without using iskeyword?
Using Neovim 0.6.1. I use a lot of snake_case_variable_names and have a frequent need to navigate within their individual components instead of treating these names as a single word. Right now, the ...
6 votes
2 answers
2k views
Why is % part of a word?
I have come across this behaviour and the documentation does not make sense to me. Consider this sentence: I am 100% sure there is something I am missing. This is the next line. Pressing w takes me ...
1 vote
1 answer
224 views
Sourcing (a very tiny) vimrc changes iskeyword
I'm having a hard time understanding how set nocompatible (a line which, from this answer on StackOverflow, I understand I could also remove from my ~/.vimrc, correct me if I'm wrong), syntax enable ...
1 vote
0 answers
48 views
autocompletion - set iskeyword disabling highlights
I have set up some syntax highlights for some patterns, for example: sc.nextInt() nextInt will be highlighted as a Function... Then I have included :set iskeyword+=(,.,) in order for autocompletion ...
2 votes
0 answers
43 views
regard continuous colons as part of a word
I want to regard continuous colons as part of a word. How can I configure the iskeyword option? For example, in ::hoge, the whole thing is a word in :hoge, : is a word, and hoge is also a word in ...
2 votes
2 answers
416 views
Is it possible to make "???" a keyword that can be highlighted?
Is it possible to make ??? (3 question marks) a keyword, and highlight it? I have tried the following in a syntax file. Other strings on the line are highlighted, but not ???. \?\?\? does not work ...
2 votes
2 answers
296 views
Is there a simple way to remove a single keyword from a syntax group (or otherwise override it in a match)?
I occasionally like to tinker with syntax files (especially conceals; I use λ for anonymous functions (lambda:, fn) in several languages). However, one complaint with conceal is that I can only use a ...
3 votes
1 answer
164 views
custom mapping to make dge consistent with dw, de, and db?
Situation Recently I was investigating the behaviour of word motions in vim and to me it seems like ge is grossly inconsistent with the other 3. Here is an example with ^ showing the cursor: word1 ...
0 votes
0 answers
48 views
Add character to iskeyword string, but only at the beginning of a word [duplicate]
I wondered if it is possible to add a character to iskeyword or similar, but such that it is only allowed at the start of the keyword. Use case: TeX macros start with \ Related question: Possible to ...
3 votes
1 answer
432 views
How to treat underscores as whitespace when skipping to the next word? [duplicate]
Let's consider an example where the cursor is at the beginning of the text one_two three. Underscores are treated as part of the word, so w moves right to the first letter of three. With set iskeyword-...