Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Creating PHP function list file ====== Since new functions could be added to PHP, or old function parameters changed, you may want to create your own function reference list to use with omni-completion in Vim. - download the multi html documentation file from php.net - unarchive the file - inside the html folder, run this:<code> for i in `ls -1| grep "^function\."`; do grep -A4 Description $i >> funcs; done </code> - open the 'funcs' file in vim - run<code> :g/Description/normal! 5J </code> - to remove html tags, run<code> :%s/<[^>]*>//g </code> - remove the 'Description' and leading spaces, run<code> :%s/^\s*Description\s*//g </code> - to create the dictionary, run<code> :%s/^\([^[:space:]]\+\) \([^[:space:]]\+\) ( \(.*\)/\\ '\2(': '\3) returns \1',/g </code> - remove all non-dictionary lines, run<code> :%s/^[^\\]*\n//g </code> - FIXME add the other necessary items, such as removing dollar signs and correct the ending parenthesis issue on some lines; then show how to finish the file and what to name it and where to put it; I'm doing the following in a new window and then executing it on the func file<code> :g/Description/normal! 5J :%s/<[^>]*>//g :%s/^\s*Description\s*//g :%s/^\([^[:space:]]\+\) \([^[:space:]]\+\) (\(.*\)/\\ '\2(': '\3) returns \1',/g :%s/^[^\\]*//g :%s/^\n//g :%s/))/)/g :%s/' /'/g :sort :sort u (we still need to fix a few bugs and clean up & and " values, maybe fixing open ['s too) it looks like the file should be called php.vim, and placed in ~/.vim/after/ftplugin/ </code> docs/vim/creating_php_function_list_file.txt Last modified: 2009/08/15 15:53by billh