Questions tagged [keyword]

Keywords are sequences of characters that are included in the 'iskeyword' option. They are commonly referred to as word.

Filter by
Sorted by
Tagged with
2 votes
1 answer
28 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 : ...
Enlico's user avatar
  • 2,184
1 vote
2 answers
25 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 ...
Dominik Teiml's user avatar
1 vote
0 answers
13 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: ...
Big McLargeHuge's user avatar
4 votes
0 answers
30 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 >?
David Oneill's user avatar
1 vote
1 answer
43 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 ...
jwav's user avatar
  • 121
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 ...
Ference's user avatar
  • 61
1 vote
1 answer
169 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 ...
Enlico's user avatar
  • 2,184
1 vote
0 answers
32 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 ...
Something's user avatar
2 votes
0 answers
33 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 ...
user1692121's user avatar
2 votes
2 answers
390 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 ...
Seilbahnwagen's user avatar
2 votes
2 answers
188 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 ...
D. Ben Knoble's user avatar
  • 25.8k
3 votes
1 answer
106 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 ...
Karolis Koncevičius's user avatar
0 votes
0 answers
43 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 ...
Skillmon's user avatar
  • 111
3 votes
1 answer
341 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 ...
danijar's user avatar
  • 391
0 votes
0 answers
22 views

Vim what the :c command do? [duplicate]

On vim I enter for a mistake the :c And I can exit only with ctrl+c What the command :c do?
elbarna's user avatar
  • 179
0 votes
2 answers
218 views

Syntax of keys on keyboard in documentation

What is the meaning of <S-x> or <C-x> in the documentation? Example: http://vimdoc.sourceforge.net/htmldoc/motion.html#%3CS-Right%3E I often see people using <C-x> to refer to Ctrl-...
flow2k's user avatar
  • 157
1 vote
1 answer
415 views

Is there a conflict between `syntax enable` and custom keywords?

I have the following minimal .vimrc file: " syntax enable syntax case match syntax keyword MyTodo TODO PENDING syntax keyword MyTodoIP IN PROGRESS syntax keyword MyTodoClosed CLOSED COMPLETE DONE ...
John's user avatar
  • 121
9 votes
2 answers
6k views

Add keywords to a highlight group

Todo highlight group currently highlights TODO and FIXME keywords. What do I do to add NOTE, and possibley more keywords, to this existing highlight group, for all file types?
3N4N's user avatar
  • 5,624
0 votes
1 answer
582 views

\<C-v> character in vim

I've this in my vimrc let g:currentmode={ \ 'n' : 'NORMAL ', \ 'v' : 'VISUAL ', \ 'V' : 'V·Line ', \ '^V' : 'V·Block ', \ ...
3N4N's user avatar
  • 5,624
1 vote
1 answer
262 views

folding in matlab

I'm using vim for my matlab editor. And It works nicely, except I cannot get folding to work. I found my syntax file on github: matlab.vim And I wanted to add folding. I changed the line syn ...
Thorbjørn E. K. Christensen's user avatar
6 votes
1 answer
341 views

Unable to set iskeyword for colon ( : ) character

I am using vim to edit LaTeX files. Throughout the text, there are labels to equations, tables etc. for which an accepted convention among TeX writers is the following \label{eq:massenergy} , \...
Dr Krishnakumar Gopalakrishnan's user avatar
0 votes
0 answers
31 views

YouCompleteMe: How to define special keyword?

For example, I need to type (others => '0') many times. Can I define (others => '0') as a keyword. If I type something like other then (others => '0') will show in the selection menu.
Fisher's user avatar
  • 1,086
1 vote
1 answer
292 views

Character class to match "iskeyword" characters

In short: how do I define a regex that matches 'iskeyword'. My initial thought was that match(str, '\w*') would match an arbitrary number of keyword characters in str, but it really only matches to a ...
Octaviour's user avatar
  • 952