0

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
    finish
endif

" ... 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.

iskeyword=@,48-57,_,192-255,58,-
    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?

2

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, privacy policy and cookie policy

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