I'm using Vundle and have othree/xml.vim installed, as well as my own bundle for working with PHP.

My PHP bundle has the following code:

if exists('b:did_ftplugin') && 1 == b:did_ftplugin

" ... various things here.

setlocal iskeyword=$,a-z,A-Z,48-57,_-_

However, the iskeyword option does NOT contain what I've specified above. If I type verbose set iskeyword? I get the following output.

    Last set from ~/.vim/bundle/xml.vim/ftplugin/xml.vim

Disabling the othree/xml.vim plugin solves this problem, but I don't understand why it would be executing in the first place, as the file type is php and not xml.

Any pointers?

1 Answer 1


The PHP filetype loads the HTML filetype; from $VIMRUNTIME/syntax/php.vim (around like 63):

runtime! syntax/html.vim
unlet b:current_syntax

This is because PHP is layered "on top" of HTML, and you can start/stop with the <?php and ?> tags.

That plugin of yours ships with a ftplugin/html.vim file which load the ftplugin/xml.vim syntax file.

The only way you can fix this is by resetting the iskeyword value from an autocmd:

augroup fix_php
    autocmd FileType php setlocal iskeyword&vim
augroup end

The iskeyword&vim will reset it to the default Vim value.

You could also consider creating a bug report on their issue tracker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.