-
Notifications
You must be signed in to change notification settings - Fork 171
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
~/.git causes gutentags to index the entire home directory #13
Comments
Perhaps by abusing |
|
@justinmk Off topic: I used to have a This was annoying, so I changed my setup to avoid this class of problems entirely: I moved the dotfiles to Something like: |
Thanks, but using a tool to manage dotfiles is cheesy, and I doubt stow even works on windows. nested git repos are a legitimate use of git, so tools built on git should be able to handle it. If gutentags supported projectionist, it could avoid this problem. |
I myself use some ad-hoc install/uninstall scripts (both on Mac/Linux and Windows), because it's frankly not much to write, has no dependencies, and I can do funky stuff like generate an Anyway, back to @justinmk's original issue: If I understand this correctly, you have your whole home directory under Git, which is why you don't want to generate tags for it because it's super big? I have some changes coming up that add the ability to specify things like |
@ludovicchabant https://github.com/tpope/vim-projectionist is a general solution to project "root finding" (and other things). It would be ideal if I could tell gutentags to not try to find a root, and only build tags if |
@ludovicchabant Any luck on the |
Here is a workaround I'm using to avoid this issue until it gets fixed properly. 😅 diff --git a/autoload/gutentags/ctags.vim b/autoload/gutentags/ctags.vim
index cf5a576..6292068 100644
--- a/autoload/gutentags/ctags.vim
+++ b/autoload/gutentags/ctags.vim
@@ -36,6 +36,12 @@ function! gutentags#ctags#init(project_root) abort
endfunction
function! gutentags#ctags#generate(proj_dir, tags_file, write_mode) abort
+ " Don't treat user's (massive) home directory as a project!
+ " https://github.com/ludovicchabant/vim-gutentags/issues/13
+ if a:proj_dir == $HOME
+ return
+ endif
+
" Get to the tags file directory because ctags is finicky about
" these things.
let l:prev_cwd = getcwd() |
Oh my, sorry, I totally forgot about this (I think I have too many projects going on :) feel free to submit pull requests if anyone wants to fix it themselves though ;) ) Anyway, turns out that the |
Perfect! 👍 The |
Good! |
@ludovicchabant Cool, thanks! |
Tell it to fuck off with ~/.notags ludovicchabant/vim-gutentags#13 (comment)
To automate 🚀 this workaround, I wrote this snippet in my vimrc: " prevent gutentags from indexing the entire home directory
" https://github.com/ludovicchabant/vim-gutentags/issues/13
let s:notags = expand('~/.notags')
if !filereadable(s:notags)
call writefile([], s:notags)
endif Cheers! 🍰 |
@sunaku You could just commit |
💡 Great idea! 👍 |
I have a
~/.git/
folder for managing dotfiles. I don't want this to trigger gutentags. Is there a way to avoid this, while still enabling gutentags in~/foo/.git
subdirectories, which doesn't involve me setting up a bunch of autocmds and manually managingg:gutentags_enabled
?Thanks for this project, I like the choices you have made.
The text was updated successfully, but these errors were encountered: