This is an old revision of the document!


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.

  1. download the multi html documentation file from php.net
  2. unarchive the file
  3. inside the html folder, run this:
    for i in `ls -1| grep "^function\."`; do grep -A4 Description $i >> funcs; done
  4. open the 'funcs' file in vim
  5. run
    :g/Description/normal! 5J
  6. to remove html tags, run
    :%s/<[^>]*>//g
  7. remove the 'Description' and leading spaces, run
    :%s/^\s*Description\s*//g
  8. to create the dictionary, run
    :%s/^\([^[:space:]]\+\) \([^[:space:]]\+\) ( \(.*\)/\\ '\2(': '\3) returns \1',/g
  9. remove all non-dictionary lines, run
    :%s/^[^\\]*\n//g
  10. 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
  • docs/vim/creating_php_function_list_file.1250361821.txt.gz
  • Last modified: 2009/08/15 12:43
  • by billh