This question follows on from this vim search question
I have a setting in my .vimrc which excludes $ as a valid part of a word:
set iskeyword-=$
This works fine for most files but isn't working in PHP. I assume it is being overwritten by a php plugin, but since plugins are loaded after .vimrc I can't work out how to overwrite this setting. I'd prefer not to have to type
:set isk-=$
every time I load a PHP file.
Any suggestions?
( Ubuntu 8.04 / Vim 7.1.138 if it matters )
Summary
Two excellent answers, thank you!
I went with tomalak's because it was less effort, and added the following to my ~/.vimrc
autocmd FileType php setlocal isk-=$
but thanks also to Luc Hermitte. Putting the settings in a ~/vim/after/ftplugin/php.vim file also worked.
:help autocmd and :help after-directory both helped too
Add a {rtp}/after/ftplugin/php.vim that contains the :setlocal isk-=$
Otherwise, you will have to track where it has been changed last with :verbose set isk
, or by playing with :scriptnames
I would probably just add set isk-=$
to my syntax highlighting auto command in $VIMRUNTIME\filetype.vim
. Don't know if it is the nicest way to do it, though.
Thinking about it... I think it would be enough to have an appropriate autocommand in your vimrc
.
au FileType php set isk-=$
This executes after the FileType has been set. Auto commands are executed in the order they are given, so when you put it late in your vimrc
it will execute last for PHP files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With