global gtags
安装
需要安装global
生成gtags文件
切换到环境变量设置的各个目录里,执行gtags命令即可,会有4个G开头的文件生成。
➜ sources pwd/usr/share/sources➜ sources ls glibc-2.27 glibc-libidn-2.10.1.tar.gz glibc-ports-2.16.0 GRTAGS linuxthreads SDL2-2.0.8.zipglibc-2.27.tar.gz glibc-linuxthreads-2.3.tar.gz glibc-ports-2.16.0.tar.gz GSYMS linuxthreads_dbglibc-libidn-2.10.1 glibc-localedata-2.0.6.tar.gz GPATH GTAGS SDL2-2.0.8
在shell上使用
配置环境变量
export GTAGSLIBPATH=/usr/include:/usr/share/sources:$GTAGSLIBPATH:.
测试
➜ sources global strcpyglibc-2.27/debug/strcpy_chk.cglibc-2.27/string/strcpy.cglibc-2.27/sysdeps/alpha/strcpy.Sglibc-2.27/sysdeps/arm/armv6/strcpy.Sglibc-2.27/sysdeps/i386/i686/multiarch/strcpy-ia32.Sglibc-2.27/sysdeps/i386/i686/multiarch/strcpy.cglibc-2.27/sysdeps/ia64/strcpy.Sglibc-2.27/sysdeps/powerpc/powerpc64/multiarch/strcpy.cglibc-2.27/sysdeps/s390/multiarch/strcpy-vx.Sglibc-2.27/sysdeps/s390/multiarch/strcpy.cglibc-2.27/sysdeps/s390/s390-32/strcpy.Sglibc-2.27/sysdeps/s390/s390-64/strcpy.Sglibc-2.27/sysdeps/sparc/sparc32/strcpy.Sglibc-2.27/sysdeps/sparc/sparc64/strcpy.Sglibc-2.27/sysdeps/x86_64/multiarch/strcpy-sse2.Sglibc-2.27/sysdeps/x86_64/multiarch/strcpy.cglibc-ports-2.16.0/sysdeps/alpha/strcpy.Sglibc-ports-2.16.0/sysdeps/ia64/strcpy.S
Spacemacs 配置
在.spacemacs文件(dotfile)里
dotspacemacs-configuration-layers
(gtags :variables gtags-enable-by-default t)
dotspacemacs/user-config
(setenv "GTAGSLIBPATH" (concat "/usr/include" ":" "/usr/share/sources"))