Skip to content

Commit

Permalink
Allow user custom fzf-tags's prompt (#9)
Browse files Browse the repository at this point in the history
* Allow user custom fzf tags prompt

* Move default prompt to top
  • Loading branch information
luathn authored Dec 25, 2020
1 parent ca47831 commit ec335aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ Additionally, `fzf-tags` exposes a fuzzy `:tselect`. To replace the default `:ts
```vim
noreabbrev <expr> ts getcmdtype() == ":" && getcmdline() == 'ts' ? 'FZFTselect' : 'ts'
```

To replace the default prompt `🔎`:

```vim
let g:fzf_tags_prompt = "Gd "
```
6 changes: 5 additions & 1 deletion autoload/fzf_tags.vim
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec335aa

Please sign in to comment.