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 and VimPlug are interacting as regards
iskeyword which changes upon sourcing my
~/.vimrc, causing a change in the behavior of *.
I'm sure I had a similar issue some week ago with a TeX file, but I can't bother reproducing it now, as the present reproduction seems enough for asking a question.
My troubleshooting resulted in the following screencast, which I describe it below, if you find it more convenient
- At the time 00:35 I have reduced my
~/.vimrcto a bare minimum:
if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim au VimEnter * PlugInstall --sync | source $MYVIMRC endif call plug#begin('~/.vim/plugged') call plug#end() set nocompatible " to use Vim, not just vi syntax enable
- Then I go back to the terminal via Ctrl-Z, open a CSS file and, at time 00:44, I hit * while the cursor is at the beginning of the word
box-sizing, and what gets searched is
\<box-sizing\>, which I think is correct for a CSS file; not shown in the screencast, I've verified that
- At the time ~00:53 I
:so ~/.vimrc(which I've modified at step 1) then hit * again, showing that something
\<box\>is searched this time! I've verified (not shown) that
quit the CSS file, then I go back to my
~/.vimrc, and delete the
set nocompatibleline at the time 01:05.
- One more time, I reopen the CSS file and repeat the procedure, showing that this time, also after
:so ~/.vimrc, * still searches
- I close the CSS file, go back to
~/.vimrc, restore the
set nocompatibleline, delete all VimPlug specific stuff, and
:write this content (time 01:29)
set nocompatible syntax enable
- Finally I open the CSS file a third time, and show that * only searches
\<box\>now. What is happening? Given the very scarce
~/.vimrcI show during the screencast, what in world could be messing around with
iskeyword? Should I ask for help to Junegunn Choi?