Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miya0001/vim-dict-wordpress
WordPress dict files for vim
https://github.com/miya0001/vim-dict-wordpress
Last synced: 2 months ago
JSON representation
WordPress dict files for vim
- Host: GitHub
- URL: https://github.com/miya0001/vim-dict-wordpress
- Owner: miya0001
- Created: 2013-03-13T10:53:10.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-09-10T12:03:22.000Z (over 4 years ago)
- Last Synced: 2024-10-03T12:45:00.141Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 130 KB
- Stars: 30
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# WordPress dict files for vim
---vim-dict-wordpress is a distribution of WordPress dictionary files for Vim.
This dictionary includes all action hooks, filter hooks and functions.## How to generate dict files
```
$ bash ./build.sh
```It will download the latest WordPress version and with grep to search hooks and functions the files will be generated.
```
# action hooks
find . -name "*.php" | xargs grep "do_action" \
| sed "s/^.*do_action/do_action/g"| sed "s/);.*/);/g" \
| sed "s/ //g" | sed "s/\"/\'/g" | sed "s/do_action(\'//g" \
| sed "s/\'.*$//g" | sed "s/^.*(.*$//g" | tr -d ' ' | sort | uniq
``````
# filter hooks
find . -name "*.php" | xargs grep "apply_filters" \
| sed "s/^.*apply_filters/apply_filters/g"| sed "s/);.*/);/g" \
| sed "s/ //g" | sed "s/\"/\'/g" | sed "s/apply_filters(\'//g" \
| sed "s/\'.*$//g" | sed "s/^.*(.*$//g" | tr -d ' ' | sort | uniq
``````
# functions
find . -name "*.php" -exec egrep '^function ' {} \; \
| sed -e "s/function \(.*\)(.*/\1/g" | sed -e "s/^&//g" \
| sed -e "s/(.*$//g" | tr -d ' ' | sort | uniq
``````
# class
find . -name "*.php" | xargs grep "^class" \
| sed "s/.*\:class //g" \
| sed "s/ .*//g" | tr -d ' ' | sort | uniq
```## Install
$ cd ~/.vim/dict
$ git clone git://github.com/miya0001/vim-dict-wordpress.gitThen, add line to ~/.vimrc like below.
autocmd FileType php :set dictionary=~/.vim/dict/vim-dict-wordpress/*.dict
## License
This dictionary file is released under the terms of the GPL version 2 or (at your option) any later version.