# HG changeset patch # User Ludovic Chabant # Date 1459918695 25200 # Node ID 2838af9ff9804b7559b87ab4701afa8d4899cd53 # Parent df3b0ca480139292e5a6524d264889cc045d0a07 Add `g:gutentags_exclude_project_root`. diff -r df3b0ca48013 -r 2838af9ff980 autoload/gutentags.vim --- a/autoload/gutentags.vim Fri Mar 25 20:41:38 2016 -0700 +++ b/autoload/gutentags.vim Tue Apr 05 21:58:15 2016 -0700 @@ -100,6 +100,15 @@ \1) call gutentags#throw("Marker found at root, aborting.") endif + for ign in g:gutentags_exclude_project_root + if l:proj_dir == ign + call gutentags#trace( + \"Ignoring project root '" . l:proj_dir . + \"' because it is in the list of ignored" . + \" projects.") + call gutentags#throw("Ignore project: " . l:proj_dir) + endif + endfor return l:proj_dir endif endfor @@ -180,7 +189,7 @@ call call("gutentags#".module."#init", [b:gutentags_root]) endfor catch /^gutentags\:/ - call gutentags#trace("Can't figure out what tag file to use... no gutentags support.") + call gutentags#trace("No gutentags support for this buffer.") return endtry diff -r df3b0ca48013 -r 2838af9ff980 doc/gutentags.txt --- a/doc/gutentags.txt Fri Mar 25 20:41:38 2016 -0700 +++ b/doc/gutentags.txt Tue Apr 05 21:58:15 2016 -0700 @@ -243,6 +243,18 @@ the user-defined ones: ['.git', '.hg', '.bzr', '_darcs']. + *gutentags_exclude_project_root* +g:gutentags_exclude_project_root + A list of project roots to generally ignore. If a file + is opened inside one of those projects, Gutentags + won't be activated. This is similar to placing + a `.notags` file in the root of those projects, but + can be useful when you don't want to, or can't, place + such a file there. + Defaults to ['/usr/local'], which is the folder where + Homebrew is known to create a Git directory by default + on MacOS. + *gutentags_exclude* g:gutentags_exclude A list of file patterns to pass to the diff -r df3b0ca48013 -r 2838af9ff980 plugin/gutentags.vim --- a/plugin/gutentags.vim Fri Mar 25 20:41:38 2016 -0700 +++ b/plugin/gutentags.vim Tue Apr 05 21:58:15 2016 -0700 @@ -64,6 +64,10 @@ let g:gutentags_exclude = [] endif +if !exists('g:gutentags_exclude_project_root') + let g:gutentags_exclude_project_root = ['/usr/local'] +endif + if !exists('g:gutentags_resolve_symlinks') let g:gutentags_resolve_symlinks = 0 endif