From 57bed2a06dc8f9d8ae8415a56e1c6db0dcba7538 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 2 Aug 2022 11:12:47 +0200 Subject: [PATCH] Revert "kak: Usar kakoune.cr en vez de fzf.kak" This reverts commit c4c5b5fc9a0afd9eb4a8d5759809d3f15017168f. --- .config/kak/kakrc | 48 ++++++++++++++++++++--------------------------- .readme.md | 10 +--------- 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 08a167c..3b53c41 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -57,26 +57,11 @@ hook global WinSetOption filetype=go %{ # Usar Foot # ------------ -eval %sh{ - # https://github.com/alexherbo2/kakoune.cr/issues/33#issuecomment-1112160325 - if test -n "$TMUX"; then echo " - define-command tmux-terminal-popup -params 1.. -shell-completion -docstring ' - tmux-terminal-popup []: create a new terminal as a tmux popup - The program passed as argument will be executed in the new popup' \ - %{ - tmux-terminal-impl 'display-popup -E -h 75% -w 75% -d #{pane_current_path}' %arg{@} - } - alias global terminal-popup tmux-terminal-popup - " - elif test -n "$WAYLAND_DISPLAY"; then echo ' - hook global KakBegin .* %{ set-option global termcmd "footclient sh -c" } - define-command terminal-popup -params 1.. -shell-completion %{ - set-option global termcmd "footclient --app-id=fzf sh -c" - wayland-terminal %arg{@} - set-option global termcmd "footclient sh -c" - } - ' - fi +hook global KakBegin .* %{ set-option global termcmd "footclient sh -c" } +define-command fzf-terminal -params 1.. -shell-completion %{ + set-option global termcmd "footclient --app-id=fzf sh -c" + wayland-terminal %arg{@} + set-option global termcmd "footclient sh -c" } # ------------ @@ -117,18 +102,25 @@ hook -group sleuth global BufOpenFile .* %{ sleuth } hook -group sleuth global BufWritePost .* %{ sleuth } # ------------ -# Kakoune.cr +# FZF # ------------ +source "%val{config}/plugins/fzf.kak/rc/fzf.kak" evaluate-commands %sh{ - kcr init kakoune + find -L "$kak_config/plugins/fzf.kak/rc/modules/" -type f -name '*.kak' -exec printf 'source "%s"\n' {} \; } - -map -docstring 'new client' global normal ': new' -map -docstring 'terminal' global normal ': connect terminal' -map -docstring 'file picker' global normal ': connect terminal-popup kcr fzf files -- -H' -map -docstring 'buffer picker' global normal ': connect terminal-popup kcr fzf buffers' -map -docstring 'grep picker' global normal ': connect terminal-popup kcr fzf grep' +hook global ModuleLoaded fzf %{ + set-option global fzf_terminal_command 'fzf-terminal kak -c %val{session} -e "%arg{@}"' +} +hook global ModuleLoaded fzf-file %{ + set-option global fzf_file_command 'rg -L --hidden --files --glob !.git' +} +hook global ModuleLoaded fzf-grep %{ + set-option global fzf_grep_command 'rg' +} +map -docstring 'search files' global user f ': fzf-modef' +map -docstring 'search buffers' global user b ': fzf-modeb' +map -docstring 'grep files' global user g ': fzf-modeg' # ------------ # Buffer switching diff --git a/.readme.md b/.readme.md index bab5b09..a0f70d2 100644 --- a/.readme.md +++ b/.readme.md @@ -28,13 +28,5 @@ Probablemente incompleto. ### Alpine ```sh -apk add zsh zsh-vcs fzf kak -``` - -#### Para editor mejorado - -(requiere tmux o Wayland+foot) - -```sh -apk add kakoune-cr kakoune-cr-commands bat fd +apk add zsh zsh-vcs fzf vis ```