"set iskeyword - = _" is not installed from vimrc

Mostly the name. When I turn on my vimrc

set iskeyword-=_ 

and save it when I restart gvim and type

 :set iskeyword 

I still see

 iskeyword=@ ,48-57,_,192-255 

As you can see, "_" still exists. If I just :set iskeyword-=_ , it works as intended. Why does this not work from my vimrc? Is there an alternative way I can get around this, and if so, how?

+7
vim config autocmd
source share
5 answers

Refer to :verbose set iskeyword? where it is installed. Note that many filetype plugins change this value (but for a non-argument, just start Vim with an empty buffer, none of them should have been installed).

If :verbose does not give an answer, write down the complete Vim startup log using vim -V20vimlog and search for the option.

Also, is your .vimrc source really? :scriptnames tells you.

+9
source share

Canceling global plugin settings from .vimrc

I had the same problem with the settings coming from the global file type plugin (perl.vim in my case), where I wanted to change the key configuration in my .vimrc. Thanks to the tips in the other answers, I realized that plugins are evaluated after my .vimrc, overriding the changes I made.

the canonical answer in this situation is to create an after directory in your local configuration, for example

~/.vim/after/ftplugin/perl.vim

and put set iskeyword-=_ there. This solved it for me.

+3
source share

Found: in my _vimrc, below, two more files were received. I just deleted them and it worked!

+1
source share

Just reset the option in your .vimrc after the plugins. According to the documentation, you can do it as follows.

set iskeyword = @, 48-57,192-255

@ - means all letters of the alphabet
48-57 - indicates ASCII characters from 48 to 57, which are the numbers 0-9
192-255 - printed latin characters

Happy coding.

+1
source share

A comment in vim80/ftplugin/perl.vim says:

 " The following line changes a global variable but is necessary to make " gf and similar commands work. The change to iskeyword was incorrect. " Thanks to Andrew Pimlott for pointing out the problem. If this causes a " problem for you, add an after/ftplugin/perl.vim file that contains " set isfname-=: set isfname+=: set iskeyword+=: 

This indicates a change to isfname , but obviously set iskeyword-=_ can be added to this file.

0
source share

All Articles