# FZF - search for the tag under cursor

**URL:** <https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914>\
**Category:** Help\
**Tags:** fzf, plugins\
**Created:** [March 13, 2020, 2:50pm UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914 "2020-03-13T14:50:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrOneTwo](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/mronetwo/32/448_2.png) [@MrOneTwo](https://discuss.kakoune.com/u/MrOneTwo)\
**Post date:** [March 13, 2020, 2:50pm UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/1 "2020-03-13T14:50:21Z")

</div>

Hello,

I’m trying to add a functionality which would allow me to just press one hotkey:

- the selection would expand around the word
- that word would be piped into FZF
- FZF would ask me about what type of a tag is that word
- a typical list of that type of tags would show up (via FZF)

This is the attempt:

```auto
map global normal <c-y> '<a-a>w<ret>:fzf -fzf-impl "fzf -i -q ${kak_selection}"'

```

Obviously it’s far from what I’m trying to get:

- I don’t know how to properly start the `fzf-mode` with the `-q` argument
- I don’t know how to insert the current selection into this command

Help would be appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![andreyorst](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/andreyorst/32/29_2.png) [@andreyorst](https://discuss.kakoune.com/u/andreyorst)\
**Post date:** [March 13, 2020, 3:53pm UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/2 "2020-03-13T15:53:34Z")

</div>

so you want a default input in fzf to be your selection. I’ll see if can add this to `fzf.kak`

@MrOneTwo please check latest update for fzf.kak

---

<div class="post-metadata">

**Author:** ![MrOneTwo](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/mronetwo/32/448_2.png) [@MrOneTwo](https://discuss.kakoune.com/u/MrOneTwo)\
**Post date:** [March 14, 2020, 10:21am UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/3 "2020-03-14T10:21:55Z")

</div>

@andreyorst Cool, thank you. Works well and seems to be pretty useful.

---

<div class="post-metadata">

**Author:** ![TeddyDD](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/teddydd/32/21_2.png) [@TeddyDD](https://discuss.kakoune.com/u/TeddyDD)\
**Post date:** [April 7, 2020, 11:45am UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/4 "2020-04-07T11:45:53Z")

</div>

Can this feature be disabled by option?

---

<div class="post-metadata">

**Author:** ![andreyorst](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/andreyorst/32/29_2.png) [@andreyorst](https://discuss.kakoune.com/u/andreyorst)\
**Post date:** [April 7, 2020, 1:28pm UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/5 "2020-04-07T13:28:48Z")

</div>

I’ll add `fzf_use_main_selection` later today. Do you think this should be set to `true` by default or not?

@TeddyDD, I find this feature quite useful, so I’ve decided that it will default to `true`. You now can disable it with the option I’ve listed above, so please update

---

<div class="post-metadata">

**Author:** ![TeddyDD](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/teddydd/32/21_2.png) [@TeddyDD](https://discuss.kakoune.com/u/TeddyDD)\
**Post date:** [April 8, 2020, 8:40am UTC](https://discuss.kakoune.com/t/fzf-search-for-the-tag-under-cursor/914/6 "2020-04-08T08:40:09Z")

</div>

Thanks a lot!
