From 1ccf3d5c1d2ee7ff8ec97488c0b15b8316fb29f9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 12 Jun 2026 20:33:09 +0530 Subject: Clipboard actions + grep selection --- autoload/files.kak | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'autoload/files.kak') diff --git a/autoload/files.kak b/autoload/files.kak index ce380ba..121460d 100644 --- a/autoload/files.kak +++ b/autoload/files.kak @@ -6,8 +6,13 @@ def file-manager -params .. %{ terminal-singleton files env "DAFFM_PATH_RELATIVE_TO=%val{client_env_PWD}" daffm -c @kak %arg{@} } -def findfzf %{ - terminal-singleton fzf sh -c 'kcr edit $(fd -t f --hidden --color=never -E .git | fzf --prompt='':find '' --multi --min-height=100 --preview=''bat --color=always {}'')' +def findfzf -params .. %{ + terminal-singleton fzf sh -c 'kcr edit $(fd -t f --hidden --color=never -E .git | fzf --prompt='':find '' --multi --min-height=100 --preview=''bat --color=always {}'' $@)' findfzf-cmd %arg{@} +} + +def findfzf-filtered -params 1 %{ + terminal-singleton fzf sh -c \ + 'kcr edit $(fd -t f --hidden --color=never -E .git | grep -E ''''$1'''' | fzf --prompt='':find# '' --multi --min-height=100 --preview=''bat --color=always {}'')' findfzf-cmd %arg{1} } declare-user-mode file @@ -15,6 +20,7 @@ map global user f ': enter-user-mode file' -docstring 'File mode' map global file F ': find ' -docstring 'Find files' map global file n ': file-manager %val{buffile}' -docstring 'File manager' map global file f ': findfzf' -docstring 'Fzf' +map global file ': findfzf -q %val{selection}' -docstring 'Fzf selection' declare-user-mode buffer map global user b ': enter-user-mode-with-count buffer' -docstring 'Buffer mode' -- cgit v1.3.1