# The Kakoune way

**URL:** <https://discuss.kakoune.com/t/the-kakoune-way/2316>\
**Category:** Recipes & Guides\
**Tags:** plugins\
**Created:** [October 14, 2023, 5:54pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316 "2023-10-14T17:54:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 14, 2023, 5:54pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/1 "2023-10-14T17:54:24Z")

</div>

I come back to kakoune from some days ago after around 4 years. I discovered lot of plug-in are now `public archive` (`kak-tree, tagbar ...and even fzf.kak` that I’m trying to make my own with color(with bat) now to find file and string( [Fzf.kak with bat and line numbers - #7 by lauccode](https://discuss.kakoune.com/t/fzf-kak-with-bat-and-line-numbers/2308/7) ). Can we continue to use them or should we use another one ?

Kakoune is particular for me. Because we can really connect to another tools. But for me `kamp, kks, kakoune.cr` are obscure plugins. I didn’t start to use them. It is a new concept for me. Do we need to use those new plugins to use Kakoune as an IDE ? Could you explain how are the usefull cases ? I need to use them to use `fzf` with Kakoune rather than `fzf.kak` ?

I have poor knows in shell and it seems it is really needed to take advantage of Kakoune. Is there some tutos to start to be able to catch well kakrc+shell and to be able to really improve kakoune the way we want ?

---

<div class="post-metadata">

**Author:** ![gustavo-hms](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/gustavo-hms/32/598_2.png) [@gustavo-hms](https://discuss.kakoune.com/u/gustavo-hms)\
**Post date:** [October 15, 2023, 12:31am UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/2 "2023-10-15T00:31:59Z")

</div>

Hi, @lauccode!

The reason the aforementioned plugins are archived is that @andreyorst stopped using Kakoune and, understandably, lose interest in maintaining them.

The good news is that, specif for `fzf.kak` there are two alternatives that come to my mind.

First, if you do want to stay with the `fzf` program, you can take a look at [popup.kak](https://discuss.kakoune.com/t/popup-kak-run-shells-and-programs-within-a-kakoune-client-info-modal/2230) by @enricozb (an amazing plugin by the way; congrats, Enrico!). By using it, filtering files with `fzf` is just a matter of calling

```plaintext
popup --title open --kak-script %{edit %opt{popup_output}} -- fzf

```

The other alternative is a plugin called [Peneira](https://github.com/gustavo-hms/peneira), developed by me. It’s a general purpose fuzzy finder you can use for many use cases: filtering files, or [lines inside a file](https://github.com/gustavo-hms/peneira#peneira-lines), or jump to [symbols in a source code](https://github.com/gustavo-hms/peneira#peneira-symbols)… you can even easily define your own custom filters, like @mbauhardt [did here](https://codeberg.org/mbauhardt/peneira-filters).

The advantage of both alternatives, compared to `fzf.kak` is that you don’t need to run Kakoune inside a `tmux` session. They are very tightly integrated in Kakoune’s UI.

I hope any one of them can be useful for you.

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 15, 2023, 11:00am UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/3 "2023-10-15T11:00:13Z")

</div>

Thanks !  
I could install and test successfully both.  
`Popup` can be used to have `fzf + ripgrep + bat` calling script and it is working very well.  
I like `Peneira` to filter in a file also with color.

---

<div class="post-metadata">

**Author:** ![arrufat](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/arrufat/32/1157_2.png) [@arrufat](https://discuss.kakoune.com/u/arrufat)\
**Post date:** [October 16, 2023, 8:43am UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/4 "2023-10-16T08:43:05Z")

</div>

Hi @lauccode I am using this simple command from fzf-tmux

```kak
map global user -docstring 'open fuzzy finder' f ': edit %sh{fzf-tmux --color=16 --preview "bat --theme=Nord --style=numbers,changes --color always {}" -}<ret>'

```

Check it in [context](https://github.com/arrufat/config/blob/38ddeccdb0c3a9b33345adcabbfd246aeafafa5d/kak/tmux.kak#L5C1-L5C161).

 ![image](https://discuss.kakoune.com/uploads/default/original/2X/a/a1f0879f355c8d9aa2ff8420868049b5543eb08b.jpeg)

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 17, 2023, 10:09am UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/5 "2023-10-17T10:09:26Z")

</div>

But you need to use fzf-tmux installed ?

---

<div class="post-metadata">

**Author:** ![arrufat](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/arrufat/32/1157_2.png) [@arrufat](https://discuss.kakoune.com/u/arrufat)\
**Post date:** [October 17, 2023, 12:51pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/6 "2023-10-17T12:51:53Z")

</div>

But that comes with `fzf`

```plaintext
$ pacman -Ql fzf | grep tmux
fzf /usr/bin/fzf-tmux
fzf /usr/share/man/man1/fzf-tmux.1.gz

```

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 17, 2023, 6:43pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/7 "2023-10-17T18:43:38Z")

</div>

Eh , Yes, you are right 😅  
I tried, this is working well.  
Do you use a similar way to search words with ripgrep ?

---

<div class="post-metadata">

**Author:** ![arrufat](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/arrufat/32/1157_2.png) [@arrufat](https://discuss.kakoune.com/u/arrufat)\
**Post date:** [October 17, 2023, 11:17pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/8 "2023-10-17T23:17:15Z")

</div>

I just use the Kakoune’s grep command with `rg`:

> <https://github.com/arrufat/config/blob/a2e341e3ac627a6d7d5ef975446449142b3efa8e/kak/kakrc#L5>

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 18, 2023, 4:27pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/9 "2023-10-18T16:27:56Z")

</div>

I thought I could search from ripgrep with fzf-tmux by adapting the script “frf” by replacing tmux by fzf-tmux :

```auto
#!/usr/bin/env bash

# 1. Search for text in files using Ripgrep
# 2. Interactively narrow down the list using fzf
# 3. Open the file in Vim
rg --color=always --line-number --no-heading --smart-case "${*:-}" |
  fzf-tmux --ansi \
      --color "hl:-1:underline,hl+:-1:underline:reverse" \
      --delimiter : \
      --preview 'batcat --color=always {1} --highlight-line {2}' \
      --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
      --bind 'enter:become(kak {1} +{2})'

```

And call it with :  
`map global user -docstring 'open fuzzy grep finder (TMUX)' g ': edit %sh{frf -}<ret>'`

But I don’t know how to adapt the end of “frf” script to open in already kakoune session and not trying to open new kak from terminal ?

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 22, 2023, 2:08pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/10 "2023-10-22T14:08:04Z")

</div>

I could adapt to open the file with :  
`--bind 'enter:become(echo {1})',`

But don’t have the line number, so I could adapt by :  
`--bind 'enter:become(echo {1} {2})',`

But prob is that I guess kak do `:e 'path_n_fileName 13'` rather that `:e path_n_fileName 13`

If someone could help ?

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [October 27, 2023, 9:55am UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/11 "2023-10-27T09:55:47Z")

</div>

> > –bind ‘enter:become(echo {1} {2})’

Is sent back `'path_n_fileName 13'` , I guess it should work with `path_n_fileName 13`.

Maybe I should ask to fzf developer or if someone know how to process the response ?

---

<div class="post-metadata">

**Author:** ![lauccode](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lauccode/32/52_2.png) [@lauccode](https://discuss.kakoune.com/u/lauccode)\
**Post date:** [March 6, 2024, 4:59pm UTC](https://discuss.kakoune.com/t/the-kakoune-way/2316/12 "2024-03-06T16:59:02Z")

</div>

I found a solution and I explain how I did here :  
[How to use kak\_selection? - Help - Kakoune Community Hub](https://discuss.kakoune.com/t/how-to-use-kak-selection/2423/5)
