Implement :VimwikiSearchTags to look up tag instances in a wiki
This commit is contained in:
parent
df91772d7e
commit
a62bebceb2
@ -2109,6 +2109,15 @@ endfunction " }}}
|
|||||||
|
|
||||||
" Command completion functions {{{
|
" Command completion functions {{{
|
||||||
|
|
||||||
|
" vimwiki#base#complete_tags
|
||||||
|
function! vimwiki#base#complete_tags(ArgLead, CmdLine, CursorPos) abort " {{{
|
||||||
|
" We can safely ignore args if we use -custom=complete option, Vim engine
|
||||||
|
" will do the job of filtering.
|
||||||
|
let metadata = vimwiki#base#load_tags_metadata()
|
||||||
|
let taglist = vimwiki#base#get_tags(metadata)
|
||||||
|
return join(taglist, "\n")
|
||||||
|
endfunction " }}}
|
||||||
|
|
||||||
" vimwiki#base#complete_links_escaped
|
" vimwiki#base#complete_links_escaped
|
||||||
function! vimwiki#base#complete_links_escaped(ArgLead, CmdLine, CursorPos) abort " {{{
|
function! vimwiki#base#complete_links_escaped(ArgLead, CmdLine, CursorPos) abort " {{{
|
||||||
" We can safely ignore args if we use -custom=complete option, Vim engine
|
" We can safely ignore args if we use -custom=complete option, Vim engine
|
||||||
|
@ -708,6 +708,10 @@ il A single list item.
|
|||||||
Iterates over all files in a current wiki and rebuilds tags metadata (to
|
Iterates over all files in a current wiki and rebuilds tags metadata (to
|
||||||
enable tags related commands).
|
enable tags related commands).
|
||||||
|
|
||||||
|
*:VimwikiSearchTags*
|
||||||
|
Searches over the pages in current wiki and finds all locations of a given
|
||||||
|
tag. Supports |cmdline-completion|.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. Wiki syntax *vimwiki-syntax*
|
5. Wiki syntax *vimwiki-syntax*
|
||||||
|
|
||||||
|
@ -304,6 +304,8 @@ command! -buffer VimwikiDiaryPrevDay call vimwiki#diary#goto_prev_day()
|
|||||||
|
|
||||||
" tags commands
|
" tags commands
|
||||||
command! -buffer VimwikiRebuildTags call vimwiki#base#update_tags(1)
|
command! -buffer VimwikiRebuildTags call vimwiki#base#update_tags(1)
|
||||||
|
command! -buffer -nargs=* -complete=custom,vimwiki#base#complete_tags
|
||||||
|
\ VimwikiSearchTags VimwikiSearch /:<args>:/
|
||||||
|
|
||||||
" COMMANDS }}}
|
" COMMANDS }}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user