From b499dae41824f2da283bf8e8e0907f06ff3aa618 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 29 Mar 2015 04:02:04 +0900 Subject: [PATCH] Fix FZFTag --- Examples-(vim).md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Examples-(vim).md b/Examples-(vim).md index e624e9d..8892fd7 100644 --- a/Examples-(vim).md +++ b/Examples-(vim).md @@ -66,18 +66,13 @@ command! FZFMru call fzf#run({ \}) ``` -### Jump to tags (@atn34) +### Jump to tags -```vimL -function! TagCommand() - return substitute('awk _!/^!/ { print \$1 }_ ', '_', "'", 'g') - \ . join(tagfiles(), ' ') -endfunction - -command! FZFTag call fzf#run({ -\ 'source' : TagCommand(), -\ 'sink' : 'tag', -\ }) +```vim +command! FZFTag if !empty(tagfiles()) | call fzf#run({ +\ 'source': "sed '/^\\!/d;s/\t.*//' " . join(tagfiles()) . ' | uniq', +\ 'sink': 'tag', +\ }) | else | echo 'No tags' | endif ``` ### Search lines in all open vim buffers