Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporary tags file into cache dir #9

Closed
Konfekt opened this issue Dec 4, 2014 · 10 comments
Closed

temporary tags file into cache dir #9

Konfekt opened this issue Dec 4, 2014 · 10 comments

Comments

@Konfekt
Copy link

Konfekt commented Dec 4, 2014

Hey, thanks for the closure that gutentags brought to us Vim taggers.

How about generating the temporary tag files, such as tags.lock, into ta $XDG_CACHE_HOME/tags folder ? (If set up by the user.)

While there are good reasons to leave the tag files in the project root, I don't see many for the temporary tag files.

@ludovicchabant
Copy link
Owner

Hey, thanks for using it :)

Did you know you can hide both the tag file and the temp/lock file away by setting g:gutentags_cache_dir? Or do you actually want the tag file in the project root, but not the temp one?

@Konfekt
Copy link
Author

Konfekt commented Dec 4, 2014

Yep, I discovered this option but stay safe and keep the tag file in the project root but suggest only moving the temp lock file that sometimes ends up in my project root when Vim crashes.

By the way, with the former option, you tell Vim about the gutentags cache dir by adding it to the vim tagpath option, that's how it works?

@Konfekt
Copy link
Author

Konfekt commented Dec 4, 2014

Thinking about it, There's also a temp folder under Windows, perhaps there's an analog under Unix as well?

@ludovicchabant
Copy link
Owner

You specify the cache dir just by setting that value in your vimrc:

let g:gutentags_cache_dir = "~/whatever/tmp"

But yeah, I could save the lock file by default in the OS' temp directory instead of next to the tag file. I'll look into it.

@nogweii
Copy link

nogweii commented Mar 13, 2015

Using the $TMP or $TMPDIR environment variables might be enough for most OS's. (While still allowing an override via g:gutentags_cache_dir.)

@Konfekt
Copy link
Author

Konfekt commented Mar 14, 2015

The temp paths are listed in the default value set backupskip&?.

@ludovicchabant
Copy link
Owner

Mmmh backupskip only lists file patterns... I'd have to parse that to remove the wildcards and stuff... did you mean backupdir?

@Konfekt
Copy link
Author

Konfekt commented Mar 15, 2015

Hmm, true that these are Vim file patterns. that's why I asked about https://groups.google.com/forum/m/#!topic/vim_use/NXFksN223bc

But it's rather meant as inspiration regading the system's default temp folder. It defaults to

'backupskip' 'bsk'  string  (default: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")

@ludovicchabant
Copy link
Owner

I thought about this thing some more and I prefer keeping the temp files next to the tags file. When it goes well, you don't notice anything, and when it goes bad, it makes it a lot easier to cleanup or troubleshoot stuff (finding a specific file in the OS's temp dirs is really painful).

Of course, if anybody with more free time than me want to submit a pull request that adds the option, I'll gladly merge it, but in the meantime I'll close this.

@Konfekt
Copy link
Author

Konfekt commented Nov 19, 2015

Okay, to achieve that using tempname() instead of .tags.temp should suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants