Comments (15)
Perfect! 👍 The .notags
file solves the problem for me. 🙇
from vim-gutentags.
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 .tagsignore
thing I mentioned is only a partial solution since it's more about being able to specify gutentags_exclude
per project (kinda like a .gitignore
/.hgignore
but for ctags). It could solve the OP's problem, but not if you really want zero tags support in a given project. For that, I just added with 7316197 the ability to create a .notags
file at the root of the project. It just flat out disables Gutentags for that project. I hope it helps!
from vim-gutentags.
Perhaps by abusing g:gutentags_exclude
? (Supposedly meant to supply file extensions à la *.dll
but perhaps accepting full paths as well)
from vim-gutentags.
g:gutentags_exclude
just gets passed to ctags -x
(which seems totally redundant with ~/.ctags
). And as far as I know there's no good way to specify a -x
pattern such that it will ignore a certain directory, yet not ignore subdirectories.
from vim-gutentags.
@justinmk Off topic: I used to have a ~/.git
to manage my dotfiles and I had problems similar to yours. Various tools that are supposed to find the root of the project would find the home directory.
This was annoying, so I changed my setup to avoid this class of problems entirely: I moved the dotfiles to ~/.dotfiles
and use GNU Stow to symlink them to ~
.
Something like:
http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html
from vim-gutentags.
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.
from vim-gutentags.
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 .hgrc
file instead of linking to one, because I also need to bring in other local stuff with absolute paths, and I don't want to assume anything about where I cloned my dotfiles
repo. See here: https://bitbucket.org/ludovicchabant/dotfiles/src/8b6ca7e40f371f9eea323aded0dfb1c66e8bdd43/install.sh?at=default
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 .tagsignore
files and other things like that in the root directory (I'm not set yet on the design), which would let you ignore things more easily per-project. Stay tuned :)
from vim-gutentags.
@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 projectionist#path()
(the project root) is non-empty.
from vim-gutentags.
@ludovicchabant Any luck on the .tagsignore
file? My CPU is pegged at 100% while this plugin attempts to index my entire homedir just because I happen to have a ~/.git
folder. 😱
from vim-gutentags.
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()
from vim-gutentags.
Good!
FYI everyone, I also closed issue 17 which lets you write a standard .ctags
options file at the root of your project, which lets you among other things specify --exclude
rules for your project (so it makes the whole .tagsignore
thing moot).
from vim-gutentags.
@ludovicchabant Cool, thanks!
from vim-gutentags.
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! 🍰
from vim-gutentags.
@sunaku You could just commit ~/.notags
to your git repo, if you source-control your home dir. That's what I did: https://github.com/justinmk/config/blob/master/.notags
from vim-gutentags.
💡 Great idea! 👍
from vim-gutentags.
Related Issues (20)
- ctags_recursive.options permissions HOT 6
- ERROR: Invalid value for argument cmd and update_gtags.sh is not executable HOT 4
- E117: Unknown function: gutentags#on_vim_leave
- Tags stop working for specific file (path disappears from tags option) after manually setting tags once in that file
- Cannot generate the GTAGS at windows platform HOT 5
- Does it support different ctags file chosen dynamically? HOT 2
- Error code 122 & 139 HOT 7
- please support the usage of `vim -t symbol` HOT 9
- use gtags failed HOT 2
- update_gtags.sh lost execution permission
- How do I use different tag files for different directories of a same workspace HOT 1
- Is there a way to force gutentags to generate only one tag file?
- Keep tags values when opening the quickfix
- nvim 0.9 remove cscope how to HOT 1
- Guttentags does not support any file? HOT 1
- Option to generate tags for open windows or buffers only? HOT 3
- the use of .guttags file HOT 1
- Whitelisting instead of blacklisting HOT 2
- Bug in update_scopedb.cmd file prevents creation of cscope.out.files correctly HOT 1
- Very large tags file generated ( > 10GB) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-gutentags.