From 054718029ccaa2be847dcfdb16f76e23622ea4b5 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sat, 4 Feb 2017 18:49:59 +0100 Subject: [PATCH] Update README.markdown --- README.markdown | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.markdown b/README.markdown index d3924ab..953bda6 100644 --- a/README.markdown +++ b/README.markdown @@ -106,25 +106,23 @@ Download and copy `plugin/phpns.vim` to `~/.vim/plugin/` ### Generate a tag file -The plugin makes use of tag files. If you don't already use a tag file you may create one with the following command; after having installed the `ctags` or `ctags-exuberant` package: +The plugin makes use of tag files. If you don't already use a tag file you may create one with the following command; after having installed the `ctags` package: - ctags-exuberant -R --PHP-kinds=+cf - -or - - ctags -R --PHP-kinds=+cf + ctags-exuberant -R --PHP-kinds=cfi #### Traits -ctags doesn't indexes [traits](http://php.net/traits) by default, you have to add a `--regex-php` option to index them: +[universal-ctags] supports traits natively (with `--php-kinds=cfit`). + +If you can't use universal-ctags, the `--regex-php` argument allows to extract traits: - ctags -R --PHP-kinds=+cf --regex-php=/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i + ctags -R --PHP-kinds=cfi --regex-php="/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i" -Alternatively, create a `~/.ctags` file with the following contents: +You can also create a `~/.ctags` file with the following contents: --regex-php=/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i -You could also use [this patched version of ctags](https://github.com/shawncplus/phpcomplete.vim/wiki/Patched-ctags) +Note that using `--regex-php=` is 10x slower than using universal-ctags. #### Automatically updating tags