I use, e.g., dw
to delete a word based on word boundaries defined by changing character classes, so that this command applied on abc,def,ghi
will result in ,def,ghi
. (So far so good, and it worked for me for decades.) Now, since just recently, that does not work any more on dots (.
); that dw
command applied on abc.def;ghi
will result in ;ghi
.
Can anyone explain what happens here; maybe whether I changed some setting by accident. - How can that misbehaviour be fixed?
Update: Following Peter's hint in his answer I obtained:
iskeyword=@,48-57,_,192-255,.
Last set from /usr/share/vim/vim73/syntax/sh.vim
and found this content in /usr/share/vim/vim73/syntax/sh.vim
:
" AFAICT "." should be considered part of the iskeyword. Using iskeywords in
" syntax is dicey, so the following code permits the user to prevent/override
" its setting.
if exists("g:sh_isk") " override support
exe "setlocal isk=".g:sh_isk
elseif !exists("g:sh_noisk") " prevent modification support
setlocal isk+=.
endif
Now this seems to be a system setting. I have no reservations against changing that file - only that it will be changed again on system updates, I fear. But since I am not familiar with vim's script language I'd be interested to know what the correct way to fix it would be. Personally I'd just remove the .
so that the +=
becomes a no-op, but I guess the whole if
statement need to be fixed. (What's that "g:sh_noisk"
?)