junegunn / fzf.vim

fzf :heart: vim
MIT License
9.52k stars 582 forks source link

Force :Tags to use a specific file #1451

Closed SKOHscripts closed 1 year ago

SKOHscripts commented 1 year ago

Hi everyone,

I'm using fzf for a few weeks now and it really changed my workflow. I'm working on a big project with multiple things interconnected.

I'd like to use :Tags command to have an overview of all existing tags in the whole project (not to have multiple tags files) in the folder /home/work/. I precise that the ctag bin is in /home/ctags/bin/.

My command in the vimrc is

let g:fzf_tags_command='/home/ctags/bin/ctags -R --extra=+qf --excmd=pattern --exclude=Makefile -f /home/work/tags /home/work/project/'

Because of something I don't understand, while I use :Tags, tags file is generated where I want to, but the error "Failed to create tags" occurs..

The question becomes more simple : how to force fzf to use a specific tag file ?

The question becomes more simple : how to force fzf to use a specific tag file ?

Bonus I added

set tags=/home/work,tags;
set tags+=/usr/include

To also include import tags, but it doesn't seem to work. Any idea ?

EDIT Found the solution !

This has to be added on top of .vimrc file

set autochdir
set tags=/home/work/tags,tags;

And the command for :Tags is

let g:fzf_tags_command='/home/ctags/bin/ctags -R -f /home/work/tags --extra=+qf --excmd=pattern --exclude=Makefile /home/work/project/'