changeset 47:7b419abf7fba

Add ability to disable Gutentags if a `.notags` file is at the root.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 09 Apr 2015 21:14:18 -0700
parents c0f56e4d52bd
children c1b33dc55b1c
files autoload/gutentags.vim doc/gutentags.txt
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Thu Apr 09 21:02:25 2015 -0700
+++ b/autoload/gutentags.vim	Thu Apr 09 21:14:18 2015 -0700
@@ -99,6 +99,11 @@
     call gutentags#trace("Scanning buffer '" . bufname('%') . "' for gutentags setup...")
     try
         let b:gutentags_root = gutentags#get_project_root(expand('%:h'))
+        if filereadable(b:gutentags_root . '/.notags')
+            call gutentags#trace("'notags' file found... no gutentags support.")
+            return
+        endif
+
         let b:gutentags_files = {}
         for module in g:gutentags_modules
             call call("gutentags#".module."#init", [b:gutentags_root])
--- a/doc/gutentags.txt	Thu Apr 09 21:02:25 2015 -0700
+++ b/doc/gutentags.txt	Thu Apr 09 21:14:18 2015 -0700
@@ -102,6 +102,10 @@
 known project markers), Gutentags is disabled for that buffer, and the
 following commands and remarks don't apply.
 
+If you want to force-disable Gutentags for a given project even though it does
+match one of the items in |gutentags_project_root|, create a file named
+"`.notags`" at the root of the project.
+
 The tag file that Gutentags creates and manages will be named after
 |gutentags_tagfile|, relative to the project's root directory. When Gutentags
 finds a valid project root, it will prepend the tag file's path to 'tags',