vim-dict-wordpress


Ⅰ. 插件描述

WordPress dict files for vim

Ⅱ. 基本信息

创建日期:  2013-03-13
使用用户:  2
Github星:  33
插件作者:  Takayuki Miyauchi

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'miya0001/vim-dict-wordpress'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'miya0001/vim-dict-wordpress'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'miya0001/vim-dict-wordpress'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/miya0001/vim-dict-wordpress

Ⅳ. 文档说明

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.

Screen Shot

How do I made the dict ?

$ bash ./build.sh

I am using grep to search hooks and functions.

# 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.git

Then, 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.

添加新评论