From ec335aa1956ff0071d96c24039333d6770fae961 Mon Sep 17 00:00:00 2001 From: Luat Hoang Date: Fri, 25 Dec 2020 20:59:01 +0700 Subject: [PATCH] Allow user custom fzf-tags's prompt (#9) * Allow user custom fzf tags prompt * Move default prompt to top --- README.md | 6 ++++++ autoload/fzf_tags.vim | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d1794..75dc9bf 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,9 @@ Additionally, `fzf-tags` exposes a fuzzy `:tselect`. To replace the default `:ts ```vim noreabbrev ts getcmdtype() == ":" && getcmdline() == 'ts' ? 'FZFTselect' : 'ts' ``` + +To replace the default prompt `🔎`: + +```vim +let g:fzf_tags_prompt = "Gd " +``` diff --git a/autoload/fzf_tags.vim b/autoload/fzf_tags.vim index 9569641..06033d4 100644 --- a/autoload/fzf_tags.vim +++ b/autoload/fzf_tags.vim @@ -1,5 +1,9 @@ scriptencoding utf-8 +if !exists('g:fzf_tags_prompt') + let g:fzf_tags_prompt = ' 🔎 ' +endif + let s:actions = { \ 'ctrl-t': 'tab split', \ 'ctrl-x': 'split', @@ -35,7 +39,7 @@ function! fzf_tags#Find(identifier) call fzf#run({ \ 'source': source_lines, \ 'sink*': function('s:sink', [identifier]), - \ 'options': '--expect=' . expect_keys . ' --ansi --no-sort --tiebreak index --prompt " 🔎 \"' . identifier . '\" > "', + \ 'options': '--expect=' . expect_keys . ' --ansi --no-sort --tiebreak index --prompt "' . g:fzf_tags_prompt . '\"' . identifier . '\" > "', \ 'down': '40%', \ }) endif