skywind3000 / gutentags_plus

The right way to use gtags with gutentags
264 stars 49 forks source link

sh: global: command not foundgtags-cscope: GTAGS not found #10

Open tgzhou98 opened 6 years ago

tgzhou98 commented 6 years ago

I use neovim

NVIM v0.3.1-140-g336ce02a6
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/gcc-5 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-d1e824fe-64b3-4932-97e0-f24dbf352dfb

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
Error detected while processing function <SNR>28_GscopeFind[19]..<SNR>28_GscopeAdd:
line   21:
cs_read_prompt EOF: Success
E609: Cscope error: sh: global: command not foundgtags-cscope: GTAGS not found. Please invoke again without -d option.
(1 of 1): [cscope s: symbol "uniq"]
Press ENTER or type command to continue

image

image

part of .vimrc

let $GTAGSLABEL = 'native-pygments'
let $GTAGSCONF = '/home/tgzhou/.local/share/gtags/gtags.conf'
let g:gutentags_define_advanced_commands = 1
let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
" 所生成的数据文件的名称
let g:gutentags_ctags_tagfile = '.tags'
" 同时开启 ctags 和 gtags 支持:
let g:gutentags_modules = []
let g:gutentags_ctags_executable = '/home/tgzhou/.local/bin/ctags'
let g:gutentags_gtags_executable = '/home/tgzhou/.local/bin/gtags'
let g:gutentags_gtags_cscope_executable = '/home/tgzhou/.local/bin/gtags-cscope'
if executable('ctags')
    let g:gutentags_modules += ['ctags']
endif
if executable('gtags-cscope') && executable('gtags')
    echo "gtags-cscope and gtags work"
    let g:gutentags_modules += ['gtags_cscope']
endif

" " Have to do this
let g:gutentags_modules += ['ctags']
let g:gutentags_modules += ['gtags_cscope']

" 将自动生成的 tags 文件全部放入 ~/.cache/tags 目录中,避免污染工程目录
let s:vim_tags = expand('~/.cache/tags')
let g:gutentags_cache_dir = s:vim_tags
" 配置 ctags 的参数
let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
let g:gutentags_ctags_extra_args += ['--c++-kinds=+px']
let g:gutentags_ctags_extra_args += ['--c-kinds=+px']
let g:gutentags_ctags_extra_args += ['--python-kinds=-iv -R']
" 禁用 gutentags 自动加载 gtags 数据库的行为
let g:gutentags_auto_add_gtags_cscope = 0
" 检测 ~/.cache/tags 不存在就新建
if !isdirectory(s:vim_tags)
    silent! call mkdir(s:vim_tags, 'p')
endif

set shell=bash\ -l
ttchin commented 5 years ago

这个问题解决了吗?

skywind3000 commented 5 years ago

找不到 gtags-cscope 这个可执行程序啊,你的这个文件在哪里呢?

Cloudprogram commented 10 months ago

在项目下面使用gtags创建索引文件GTAGS就可以了