I'm trying to add a plugin that will provide additional tags files to look up the documentation of a language: https://github.com/DanielSiepmann/phpstorm-stubs/blob/feature/add-dynamic-tags-file/plugin/php.vimBut none of my tries worked out:let &l:tags += expand('%:p:h:h') . /tagslet &tags = expand('%:p:h:h') . /tagsset tags += expand('%:p:h:h') . /tagsThe first solution returns the following error:Error detected while processing  /Users/siepmann/.dotfiles/.vim/bundle/phpstorm-stubs/plugin/php.vim:  line    1: E734: Wrong variable type for += Press ENTER or type  command to continueThe second one will prevent all other defaults that would be set in addition. So tags=./tags,tags will become tags=~/Projects/typo3/tags where ~/Projects/typo3/ is current working dir.The thing is that the plugin should ship with the tags file and as the plugin can be installed into multiple locations the include should be dynamic.So what will be a working solution / approach?
How to add a tags file with expand
tags
Thanks to @dNitro and @VanLaser the following is the working solution.In ftplugin/php.vim:if &l:tags ==      Gather information    let s:additionalFile=expand('<sfile>:p:h:h')./tags    let s:existingPath=&tags    let s:newPath=s:existingPath.,.s:additionalFile    if s:existingPath[-1:] ==         let s:newPath=s:additionalFile    endif     Set new path    let &l:tags=s:newPathendifThis will first check if tags is set for current buffer. If not it will fetch the path relative to tags file in the current plugin.Next it will concatenate the global tags setting with the new file if global tags contains something. This is due to the fact that let &l:tags+=s:newPath will not work.