如果您发现 ctags 对某些内容的支持不够,您可以通过向主目录中的 .ctags 文件添加一系列声明来扩展它。例如,对于 VHDL,您可以使用此处的代码:
--langdef=vhdl
--langmap=vhdl:.vhd
--regex-vhdl=/^[ \t]*package[ \t]+([^ ]+) is/\1/d,package declarations/i
--regex-vhdl=/^[ \t]*package[ \t]+body[ \t]+([^ ]+) is/\1/b,package bodies/i
--regex-vhdl=/^[ \t]*architecture[ \t]+([^ ]+) of/\1/a,architecture specifications/i
--regex-vhdl=/^[ \t]*entity[ \t]+([^ ]+) is/\1/e,entities/i
--regex-vhdl=/^[ \t]*([^ \t:]+)[ \t]*:[ \t]*process[ \t]*\(/\1/p,processes/i
--regex-vhdl=/^[ \t]*function[ \t]+([a-z0-9_]+)/\1/f,functions/i
--regex-vhdl=/^[ \t]*procedure[ \t]+([a-z0-9_]+)/\1/r,procedures/i
--regex-vhdl=/^[ \t]*type[ \t]+([^ ]+) is/\1/t,type declarations/i
Run Code Online (Sandbox Code Playgroud)