0

I use this code to highlight:

autocmd CursorMoved * exe printf('match IncSearch /\V\<%s\>/', escape(expand('<cword>'), '/\'))

But it fail for <-done in Go:

vim go highlight word under cursor

:verbose set isk returns

  iskeyword=@,48-57,_,192-255,-
        Last set from ~/.vim/vimrc line 225
2
  • I don't seem to reproduce this issue... What does :verbose set isk? tell you while editing this Go source? Please edit the question to include this information.
    – filbranden
    May 19 at 6:05
  • @filbranden added May 19 at 22:43
1

Ooops, I found that in my vimrc I have

"set iskeyword+=\-

I have this for autocompletion of CSS classes like aaa-bbb-ccc.

2
  • 2
    Do so in a file ~/.vim/ftplugin/css.vim, then it will apply for CSS files only!
    – filbranden
    May 20 at 1:42
  • 2
    Oh! And in that file make sure you use setlocal, to only affect the current buffer...
    – filbranden
    May 20 at 2:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.