mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 00:53:42 -05:00
Updated Examples (vim) (markdown)
@@ -101,6 +101,9 @@ command! -bar Tags if !empty(tagfiles()) | call fzf#run({
|
|||||||
This version better handles same tags across different files.
|
This version better handles same tags across different files.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
" Tags
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
function! s:tags_sink(line)
|
function! s:tags_sink(line)
|
||||||
let parts = split(a:line, '\t\zs')
|
let parts = split(a:line, '\t\zs')
|
||||||
let excmd = matchstr(parts[2:], '^.*\ze;"\t')
|
let excmd = matchstr(parts[2:], '^.*\ze;"\t')
|
||||||
@@ -119,7 +122,8 @@ function! s:tags()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call fzf#run({
|
call fzf#run({
|
||||||
\ 'source': 'grep -v ^! '.join(map(tagfiles(), 'fnamemodify(v:val, ":S")')),
|
\ 'source': 'cat '.join(map(tagfiles(), 'fnamemodify(v:val, ":S")')).
|
||||||
|
\ '| grep -v ^!',
|
||||||
\ 'options': '+m -d "\t" --with-nth 1,4.. -n 1 --tiebreak=index',
|
\ 'options': '+m -d "\t" --with-nth 1,4.. -n 1 --tiebreak=index',
|
||||||
\ 'down': '40%',
|
\ 'down': '40%',
|
||||||
\ 'sink': function('s:tags_sink')})
|
\ 'sink': function('s:tags_sink')})
|
||||||
|
|||||||
Reference in New Issue
Block a user