From cd0e20f93b53916d51a6d18640778a1b9eb92510 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 15 Sep 2012 17:03:38 +1200 Subject: [PATCH] Add TagbarCurrentTag command, closes #109 --- doc/tagbar.txt | 4 ++++ plugin/tagbar.vim | 1 + 2 files changed, 5 insertions(+) diff --git a/doc/tagbar.txt b/doc/tagbar.txt index 710e34b..2adb476 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -271,6 +271,10 @@ COMMANDS *tagbar-commands* Open the parent folds of the current tag in the file window as much as needed for the tag to be visible in the Tagbar window. +:TagbarCurrentTag [{flags}] *:TagbarCurrentTag* + Echo the current tag in the command line. For {flags} see + |tagbar-statusline|. + :TagbarGetTypeConfig {filetype} *:TagbarGetTypeConfig* Paste the Tagbar configuration of the vim filetype {filetype} at the current cursor position (provided that filetype is supported by Tagbar) diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index c8a2bdf..ad7c3c8 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -107,6 +107,7 @@ command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj') command! -nargs=0 TagbarClose call tagbar#CloseWindow() command! -nargs=1 -bang TagbarSetFoldlevel call tagbar#SetFoldLevel(, 0) command! -nargs=0 TagbarShowTag call tagbar#highlighttag(1, 1) +command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', ) command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig() command! -nargs=? TagbarDebug call tagbar#StartDebug() command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()