From 47a6eea3b0b9a2e1095ee92d891ca401089b09e9 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Mon, 28 Sep 2020 09:44:21 -0500 Subject: [PATCH] add nicer instructions for kak integration --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5988df3..1f71f2c 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,19 @@ See the docs for `fzf#run` for more customization options. ### Adding to Kakoune -You can look in `dotfiles/kakoune.nix` in to see how to use in [kakoune](https://kakoune.org). -I use [connect.kak](https://github.com/alexherbo2/connect.kak) to spawn a terminal window with about the same command line as in the vim config above. +Assuming you're using tmux as your window manager, integration looks something like this: + +``` +define-command -docstring 'open files named similarly to the current buffer' open-similar %{ + tmux-terminal-horizontal sh -c %{ + set -euo pipefail + FILE="$(git ls-files --others --cached --exclude-standard | similar-sort $1 | grep -v $1 | fzf --tiebreak index)" + printf "evaluate-commands -client %s edit %s\n" "$2" "$FILE" | kak -p $3 + } -- %val{bufname} %val{client} %val{session} +} +``` + +I have this bound to `-` with `map global normal ': open-similar'`. ## License