This is more of a warning to other users since i discovered the hard-way that universal-ctags installed by snap is NOT compatible with gutentags. For me it manifested as permission errors reading the ctags_recursive.options file, but I could imagine different file perm errors depending on your config. The fs limitations are mentioned at https://snapcraft.io/universal-ctags and in https://github.com/universal-ctags/ctags-snap/issues/26. I don’t think there is anything for gutentags to do except maybe include a warning in the doc about snap installed ctags.
Universal Ctags 0.0.0(3671ad72), Copyright (C) 2015 Universal Ctags Team Universal Ctags is derived from Exuberant Ctags. Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert Compiled: May 72020, 17:26:30 URL: https://ctags.io/ Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +packcc
然后世界就恢复正常了!tags数据库已经可以正常生成了。
源码安装gtags(GNU Global)
vim-gutentags插件此时还没法用cscope相关命令,搜索符号引用相关功能,还需要gtags支持,即GNU Global,是一套跨环境的源码标签系统(GNU GLOBAL is a source code tagging system that works the same way across diverse environments)。
gtags (GNU GLOBAL) 6.6.4 Powered by Berkeley DB 1.85. Copyright (c) 1996-2019 Tama Communications Corporation License GPLv3+: GNU GPL version3or later <http://www.gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There isNO WARRANTY, to the extent permitted by law.
""cscope ifhas("cscope") ifexecutable('gtags-cscope') && executable('gtags') "禁用原GscopeFind按键映射 letg:gutentags_plus_nomap = 1 "Find this C symbol 查找C语言符号,即查找函数名、宏、枚举值等出现的地方 nmap <C-\>s :GscopeFind s <C-R>=expand("<cword>")<CR><CR> "Find this difinition 查找函数、宏、枚举等定义的位置,类似ctags所提供的功能 nmap <C-\>g :GscopeFind g <C-R>=expand("<cword>")<CR><CR> "Find functions called by this function 查找本函数调用的函数 nmap <C-\>d :GscopeFind d <C-R>=expand("<cword>")<CR><CR> "Find functions calling this function 查找调用本函数的函数 nmap <C-\>c :GscopeFind c<C-R>=expand("<cword>")<CR><CR> "Find this text string 查找指定的字符串 nmap <C-\>t :GscopeFind t <C-R>=expand("<cword>")<CR><CR> "Find this egrep pattern 查找egrep模式,相当于egrep功能,但查找速度快多了 nmap <C-\>e :GscopeFind e<C-R>=expand("<cword>")<CR><CR> "Find this file 查找并打开文件,类似vim的能 nmap <C-\>f :GscopeFind f<C-R>=expand("<cfile>")<CR><CR> "Find files #including this file 查找包含本文件的文件 nmap <C-\>i :GscopeFind i ^<C-R>=expand("<cfile>")<CR>$<CR> else set csto=1 setcst set nocsverb " add any database in current directory iffilereadable("cscope.out") csaddcscope.out endif set csverb
nmap <C-\>s :csfind s <C-R>=expand("<cword>")<CR><CR> nmap <C-\>g :csfind g <C-R>=expand("<cword>")<CR><CR> nmap <C-\>d :csfind d <C-R>=expand("<cword>")<CR><CR> nmap <C-\>c :csfindc<C-R>=expand("<cword>")<CR><CR> nmap <C-\>t :csfind t <C-R>=expand("<cword>")<CR><CR> nmap <C-\>e :csfinde<C-R>=expand("<cword>")<CR><CR> nmap <C-\>f :csfindf<C-R>=expand("<cfile>")<CR><CR> nmap <C-\>i :csfind i ^<C-R>=expand("<cfile>")<CR>$<CR>