I a have PHP syntax highlighting file in
~/.vim/syntax/php.vim. Thus, PHP functions are highlighted differently than my own custom functions and Wordpress functions. Therefore, VIM does have a way to determine if a function is a PHP built-in or not.
I am using this script slightly modified to open PHP and Wordpress documentation from within VIM:
function! BrowseDoc() if b:current_syntax == "php" ! firefox "http://php.net/manual-lookup.php?pattern=<cword>" ! firefox "https://codex.wordpress.org/Function_Reference/<cword>" elseif b:current_syntax == "perl" ! firefox "http://perldoc.perl.org/search.html?q=<cword>" elseif b:current_syntax == "python" ! firefox "https://docs.python.org/3.5/search.html?q=<cword>" else return endif endfunction map <leader>ff :call BrowseDoc()<Return><Return>
How might I use the VIM feature that determines if a function is to be highlighted as PHP or not to determine if php.net or wordpress.org documentation should be opened?
I found the
phpFunctions syn keyword in the syntax file, but I've been unable to figure out how to query if the word under the cursor is a member of that family or not.