Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion autoload/wiki/fzf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ function! wiki#fzf#tags() abort "{{{1
endfor
endfor

let l:fzf_opts = join([
\ '-d": |:\d+$" ',
\ '--expect=ctrl-l --prompt "WikiTags> " ',
\ g:wiki_fzf_tags_opts,
\])

" Feed tags to FZF
call fzf#run(fzf#wrap({
\ 'source': l:results,
\ 'sink*': funcref('s:accept_tag'),
\ 'options': '--expect=ctrl-l --prompt "WikiTags> " '
\ 'options': l:fzf_opts
\}))
endfunction

Expand Down
17 changes: 16 additions & 1 deletion doc/wiki.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,24 @@ OPTIONS *wiki-config-options*
A string with additional user options for |WikiFzfPages|. This can be used
e.g. to add a previewer. Users should be aware that the page candidates are
"prettified" with the `--with-nth=1` and `-d` options for fzf, so to obtain
the page path in a previewer option one must use the field index expression 1.
the page path in a previewer option one must use the field index expression `1`.
E.g.: >vim

let g:wiki_fzf_pages_opts = '--preview "cat {1}"'
<
Default: `''`

*g:wiki_fzf_tags_opts*
A string with additional user options for |WikiFzfTags|. This can be used
e.g. to add a previewer. Users should be aware that the page candidates are
"prettified" with the `-d` option for fzf, so to obtain the page path in a
previewer option one must use the field index expression `2..`.
E.g.: >vim

let g:wiki_fzf_tags_opts = '--preview "bat --color=always {2..}"'
<
Default: `''`

*g:wiki_global_load*
|wiki.vim| is inherently agnostic in that it assumes any recognized filetype
specifies a wiki. However, some people might want to load |wiki.vim| for
Expand Down Expand Up @@ -1390,6 +1401,10 @@ the commands are also available as mappings of the form `<plug>(wiki-[name])`.
*WikiFzfTags*
Open |fzf| and search for tags.

One may pass additional options to fzf with the |g:wiki_fzf_tags_opts|
option. This allows more fine grained control of fzf, e.g. to add
a previewer.

*<plug>(wiki-fzf-toc)*
*WikiFzfToc*
Open |fzf| and list table of contents entries for the current wiki page.
Expand Down