Skip to content

Use ggtags mode for CFEngine3

Camilo QS edited this page Nov 19, 2020 · 1 revision

Use ggtags-mode for CFEngine3

--langdef=CFEngine3
--langmap=CFEngine3:.cf.cf3
--regex-cfengine3=/^[ \t]*bundle[ \t]+[[:alnum:]_]+[ \t]+([[:alnum:]_]+)/\1/B,bundle/
--regex-cfengine3=/^[ \t]*body[ \t]+[[:alnum:]_]+[ \t]+([[:alnum:]_]+)/\1/b,body/
  • Change ~/.globalrc to include CFEngine3:
diff -u /home/leo/.globalrc /usr/local/unix/global/share/gtags/gtags.conf
--- /usr/local/unix/global/share/gtags/gtags.conf	2014-11-10 19:14:19.347301460 +0800
+++ /home/leo/.globalrc	2014-11-13 23:14:48.636260841 +0800
@@ -67,6 +67,7 @@
 	:langmap=C\:.c:\
 	:langmap=C++\:.c++.cc.cp.cpp.cxx.h.h++.hh.hp.hpp.hxx.C.H:\
 	:langmap=C#\:.cs:\
+	:langmap=CFEngine3\:.cf.cf3:\
 	:langmap=Cobol\:.cbl.cob.CBL.COB:\
 	:langmap=DosBatch\:.bat.cmd:\
 	:langmap=Eiffel\:.e:\
@@ -106,6 +107,7 @@
 	:gtags_parser=C\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
 	:gtags_parser=C++\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
 	:gtags_parser=C#\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
+	:gtags_parser=CFEngine3\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
 	:gtags_parser=Cobol\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
 	:gtags_parser=DosBatch\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
 	:gtags_parser=Eiffel\:/usr/local/unix/global/lib/gtags/exuberant-ctags.la:\
@@ -160,6 +162,7 @@
 	:langmap=Bro\:.bro:\
 	:langmap=C#\:.cs:\
 	:langmap=C++\:.c++.cc.cp.cpp.cxx.h.h++.hh.hp.hpp.hxx.C.H:\
+	:langmap=CFEngine3\:.cf.cf3:\
 	:langmap=COBOLFree\:.cbl.CBL:\
 	:langmap=COBOL\:.cob.COB.cpy.CPY:\
 	:langmap=CUDA\:.cu.cuh:\
@@ -312,6 +315,7 @@
 	:gtags_parser=Bro\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
 	:gtags_parser=C#\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
 	:gtags_parser=C++\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
+	:gtags_parser=CFEngine3\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
 	:gtags_parser=COBOLFree\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
 	:gtags_parser=COBOL\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\
 	:gtags_parser=CUDA\:/usr/local/unix/global/lib/gtags/pygments-parser.la:\

Diff finished.  Thu Nov 13 23:24:34 2014
  • Copy ~/.globalrc to your CFEngine3 project directory and rename it to gtags.conf. Edit gtags.conf to have the default index backend set to pygments.

After all the hard work you should be able to navigate CFE3 projects with ease. A screenshot:

ggtags-cfe3.png