Generate PHP tags with exctags on FreeBSD

Generally, exctags(1) on FreeBSD is what you know as ctags on Linux based systems.

1.  Install exctags from port

# cd /usr/ports/devel/ctags
# make install clean

Note: If you install ctags by command pkg install ctags, the ctags included in the basesystem is not what you expect on Linux based systems. For ctags you are looking for install ctags from package/ports, it will provide you with exctags binary.

2.  Generate tags 

I generate tags by putting the generate_tags.sh script to the project directory and executes it.

#!/bin/sh
exec exctags \
--languages=PHP \
--langmap=PHP:+.phpt \
-h ".php" -R \
--exclude="\.git" \
--totals=yes \
--tag-relative=yes \
--PHP-kinds=+cdf \
--regex-PHP='/abstract class ([^ ]*)/\1/c/' \
--regex-PHP='/interface ([^ ]*)/\1/c/' \
--regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/'
 
CTRL + ]  Go to tag's definition. 

CTRL + t  Jump back from definition.
or
CTRL + o  Jump back from definition.

You can learn more vim and ctags tips and tricks from: 
 
And more information with the article Use vim with (ex)ctags
 
References:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Comments

Popular posts from this blog

BdsDex: failed to load Boot0001 "UEFI BHYVE SATA DISK BHYVE-OABE-20A5-E582" from PciRoot(0x0)/Pci (0x2, 0x0)/Stat(0x0,0xFFFF,0x0) : Not Found

How To Install Nginx, MySQL and PHP (FEMP) Stack on FreeBSD 13.0

Install samba on FreeBSD(on VMware Workstation) to share files with Window.