From 528cb479dc98ad30c17fa4fbac275604216e4a28 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 10 Jan 2019 19:07:17 +0300 Subject: [PATCH] more generic wrappers --- rc/fzf.kak | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rc/fzf.kak b/rc/fzf.kak index a25ee9c..5bb573e 100644 --- a/rc/fzf.kak +++ b/rc/fzf.kak @@ -63,34 +63,34 @@ Best used with mapping like: " \ fzf-mode %{ try %{ evaluate-commands 'enter-user-mode fzf' } } -define-command -hidden fzf-vertical -params 2 %{ +define-command -hidden fzf-vertical -params .. %{ try %{ - tmux-terminal-vertical kak -c %val{session} -e "%arg{1} %arg{2}" + tmux-terminal-vertical kak -c %val{session} -e "%arg{@}" } catch %{ - tmux-new-vertical "%arg{1} %arg{2}" + tmux-new-vertical "%arg{@}" } } -define-command -hidden fzf-horizontal -params 2 %{ +define-command -hidden fzf-horizontal -params .. %{ try %{ - tmux-terminal-horizontal kak -c %val{session} -e "%arg{1} %arg{2}" + tmux-terminal-horizontal kak -c %val{session} -e "%arg{@}" } catch %{ - tmux-new-horizontal "%arg{1} %arg{2}" + tmux-new-horizontal "%arg{@}" } } -define-command -hidden fzf-window -params 2 %{ +define-command -hidden fzf-window -params .. %{ try %sh{ if [ -n "$kak_client_env_TMUX" ]; then - printf "%s\n" 'tmux-terminal-window kak -c %val{session} -e "%arg{1} %arg{2}"' + printf "%s\n" 'tmux-terminal-window kak -c %val{session} -e "%arg{@}"' else - printf "%s\n" 'x11-terminal kak -c %val{session} -e "%arg{1} %arg{2}"' + printf "%s\n" 'x11-terminal kak -c %val{session} -e "%arg{@}"' fi } catch %sh{ if [ -n "$kak_client_env_TMUX" ]; then - printf "%s\n" 'tmux-new-window "%arg{1} %arg{2}"' + printf "%s\n" 'tmux-new-window "%arg{@}"' else - printf "%s\n" 'x11-new "%arg{1} %arg{2}"' + printf "%s\n" 'x11-new "%arg{@}"' fi } }