From 207b8520c27c67ad9e2c91534c0ae2d44efe0c92 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Fri, 8 Nov 2013 17:27:34 +1300 Subject: [PATCH] Allow ignoring specific files, closes #169 --- autoload/tagbar.vim | 5 +++++ doc/tagbar.txt | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index b3b0366..edb7ebd 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3590,6 +3590,11 @@ function! s:IsValidFile(fname, ftype) abort return 0 endif + if getbufvar(a:fname, 'tagbar_ignore') == 1 + call s:LogDebugMessage('File is marked as ignored') + return 0 + endif + if &previewwindow call s:LogDebugMessage('In preview window') return 0 diff --git a/doc/tagbar.txt b/doc/tagbar.txt index 8800cbb..cf29602 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -21,6 +21,7 @@ Contents *tagbar* *tagbar-contents* Highlight colours ............. |tagbar-highlight| Automatically opening Tagbar .. |tagbar-autoopen| Show current tag in statusline |tagbar-statusline| + Ignoring specific files ....... |tagbar-ignore| 6. Extending Tagbar ................ |tagbar-extend| 7. Troubleshooting & Known issues .. |tagbar-issues| 8. History ......................... |tagbar-history| @@ -739,6 +740,15 @@ Note that if there is an error when processing the current file no error message will be shown in order to not disrupt the statusline. If the function doesn't seem to work right open the Tagbar window to see any error messages. +------------------------------------------------------------------------------ +IGNORING SPECIFIC FILES *tagbar-ignore* + +You can ignore specific files by setting the |buffer-variable| +"b:tagbar_ignore" to 1. This is best done with an |autocommand|: +> + autocmd BufNewFile,BufReadPost foo.cpp let b:tagbar_ignore = 1 +< + ============================================================================== 6. Extending Tagbar *tagbar-extend*