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
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.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
vimrcit will execute last for PHP files.