diff --git a/rc/fzf.kak b/rc/fzf.kak index 7f12c55..21ab66d 100644 --- a/rc/fzf.kak +++ b/rc/fzf.kak @@ -222,9 +222,9 @@ fzf -params .. %{ evaluate-commands %sh{ ( while read -r line; do case ${line} in - ("${kak_opt_fzf_window_map:-}") wincmd="fzf-window" ;; - ("${kak_opt_fzf_vertical_map:-}") wincmd="fzf-vertical" ;; - ("${kak_opt_fzf_horizontal_map:-}") wincmd="fzf-horizontal" ;; + ("${kak_opt_fzf_window_map:-ctrl-w}") wincmd="fzf-window" ;; + ("${kak_opt_fzf_vertical_map:-ctrl-v}") wincmd="fzf-vertical" ;; + ("${kak_opt_fzf_horizontal_map:-ctrl-s}") wincmd="fzf-horizontal" ;; (*) item=${line} ;; esac if [ -n "${item}" ]; then diff --git a/rc/modules/VCS/fzf-bzr.kak b/rc/modules/VCS/fzf-bzr.kak index a25c8fa..c24ed6c 100644 --- a/rc/modules/VCS/fzf-bzr.kak +++ b/rc/modules/VCS/fzf-bzr.kak @@ -24,8 +24,8 @@ define-command -hidden fzf-bzr %{ evaluate-commands %sh{ (bzr) cmd="(cd $repo_root && bzr ls -R --versioned)" ;; (*) cmd=$kak_opt_fzf_bzr_command ;; esac - [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -filter %{perl -pe \"if (/$kak_opt_fzf_window_map|$kak_opt_fzf_vertical_map|$kak_opt_fzf_horizontal_map|^$/) {} else {print \\\"$repo_root/\\\"}\"}" + [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags} -filter %{perl -pe \"if (/${kak_opt_fzf_window_map:-ctrl-w}|${kak_opt_fzf_vertical_map:-ctrl-v}|${kak_opt_fzf_horizontal_map:-ctrl-s}|^$/) {} else {print \\\"$repo_root/\\\"}\"}" }} § diff --git a/rc/modules/VCS/fzf-git.kak b/rc/modules/VCS/fzf-git.kak index d1e878b..8227eb8 100644 --- a/rc/modules/VCS/fzf-git.kak +++ b/rc/modules/VCS/fzf-git.kak @@ -24,8 +24,8 @@ define-command -hidden fzf-git %{ evaluate-commands %sh{ (git) cmd='git ls-tree --full-tree --name-only -r HEAD' ;; (*) cmd=$kak_opt_fzf_git_command ;; esac - [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -filter %{perl -pe \"if (/$kak_opt_fzf_window_map|$kak_opt_fzf_vertical_map|$kak_opt_fzf_horizontal_map|^$/) {} else {print \\\"$(git rev-parse --show-toplevel)/\\\"}\"}" + [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags} -filter %{perl -pe \"if (/${kak_opt_fzf_window_map:-ctrl-w}|${kak_opt_fzf_vertical_map:-ctrl-v}|${kak_opt_fzf_horizontal_map:-ctrl-s}|^$/) {} else {print \\\"$(git rev-parse --show-toplevel)/\\\"}\"}" }} § diff --git a/rc/modules/VCS/fzf-hg.kak b/rc/modules/VCS/fzf-hg.kak index 9ce5e9c..8dcdbb7 100644 --- a/rc/modules/VCS/fzf-hg.kak +++ b/rc/modules/VCS/fzf-hg.kak @@ -24,8 +24,8 @@ define-command -hidden fzf-hg %{ evaluate-commands %sh{ (hg) cmd="hg locate -f" ;; (hg*) cmd=$kak_opt_fzf_hg_command ;; esac - [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}" + [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags}" }} § diff --git a/rc/modules/VCS/fzf-svn.kak b/rc/modules/VCS/fzf-svn.kak index 01812a1..9fb42da 100644 --- a/rc/modules/VCS/fzf-svn.kak +++ b/rc/modules/VCS/fzf-svn.kak @@ -25,8 +25,8 @@ define-command -hidden fzf-svn %{ evaluate-commands %sh{ (svn) cmd="svn list -R $repo_root | grep -v '$/'" ;; (svn*) cmd=$kak_opt_fzf_svn_command ;; esac - [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{cd $repo_root; edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -post-action %{cd $current_path}" + [ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{cd $repo_root; edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags} -post-action %{cd $current_path}" }} § diff --git a/rc/modules/fzf-buffer.kak b/rc/modules/fzf-buffer.kak index b318c01..f42ebbc 100644 --- a/rc/modules/fzf-buffer.kak +++ b/rc/modules/fzf-buffer.kak @@ -20,14 +20,14 @@ $buffers" message="Set buffer to edit in current client. : switch to selected buffer. -${kak_opt_fzf_window_map:?}: open buffer in new window" +${kak_opt_fzf_window_map:-ctrl-w}: open buffer in new window" [ -n "${kak_client_env_TMUX:-}" ] && tmux_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open buffer in horizontal split -${kak_opt_fzf_vertical_map:-}: open buffer in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open buffer in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open buffer in vertical split" printf "%s\n" "info -title 'fzf buffer' '$message$tmux_keybindings'" - [ -n "${kak_client_env_TMUX:-}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" + [ -n "${kak_client_env_TMUX:-}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" - printf "%s\n" "fzf -kak-cmd %{buffer} -items-cmd %{printf \"%s\n\" \"$buffers\"} -fzf-args %{--expect $kak_opt_fzf_window_map $additional_flags}" + printf "%s\n" "fzf -kak-cmd %{buffer} -items-cmd %{printf \"%s\n\" \"$buffers\"} -fzf-args %{--expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags}" }} define-command -hidden fzf-delete-buffer %{ evaluate-commands %sh{ @@ -42,7 +42,7 @@ $buffers" message="Delete buffer. : delete selected buffer." printf "%s\n" "info -title 'fzf delete-buffer' '$message'" - printf "%s\n" "fzf -kak-cmd %{delete-buffer} -multiple-cmd %{delete-buffer} -items-cmd %{printf \"%s\n\" \"$buffers\"} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:?} ${additional_flags:-}}" + printf "%s\n" "fzf -kak-cmd %{delete-buffer} -multiple-cmd %{delete-buffer} -items-cmd %{printf \"%s\n\" \"$buffers\"} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} ${additional_flags:-}}" }} § diff --git a/rc/modules/fzf-ctags.kak b/rc/modules/fzf-ctags.kak index af5f062..0ddb5c2 100644 --- a/rc/modules/fzf-ctags.kak +++ b/rc/modules/fzf-ctags.kak @@ -928,17 +928,17 @@ define-command -hidden fzf-tag -params ..2 %{ evaluate-commands %sh{ message="Jump to a symbol''s definition : open tag in new buffer -${kak_opt_fzf_window_map:?}: open tag in new terminal" +${kak_opt_fzf_window_map:-ctrl-w}: open tag in new terminal" [ -n "${kak_client_env_TMUX:?}" ] && tmux_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open tag in horizontal split -${kak_opt_fzf_vertical_map:-}: open tag in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open tag in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open tag in vertical split" printf "%s\n" "info -title 'fzf tag' '$message$tmux_keybindings'" - [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" + [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" printf "%s\n" "set-option -add window ctagsfiles %{$path/$kak_opt_fzf_tag_file_name}" - printf "%s\n" "fzf -kak-cmd %{ctags-search} -items-cmd %{$cmd | awk '!a[\$0]++'} -fzf-args %{--expect $kak_opt_fzf_window_map $additional_flags}" + printf "%s\n" "fzf -kak-cmd %{ctags-search} -items-cmd %{$cmd | awk '!a[\$0]++'} -fzf-args %{--expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags}" }} § diff --git a/rc/modules/fzf-file.kak b/rc/modules/fzf-file.kak index a1449e9..6b51a9c 100644 --- a/rc/modules/fzf-file.kak +++ b/rc/modules/fzf-file.kak @@ -50,15 +50,15 @@ define-command -hidden fzf-file %{ evaluate-commands %sh{ cmd="$cmd 2>/dev/null" message="Open single or multiple files. : open file in new buffer. -${kak_opt_fzf_window_map:?}: open file in new terminal" +${kak_opt_fzf_window_map:-ctrl-w}: open file in new terminal" [ -n "${kak_client_env_TMUX:-}" ] && tmux_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open file in horizontal split -${kak_opt_fzf_vertical_map:-}: open file in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open file in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open file in vertical split" printf "%s\n" "info -title 'fzf file' '$message$tmux_keybindings'" - [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" + [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" [ "${kak_opt_fzf_file_preview:-}" = "true" ] && preview_flag="-preview" - printf "%s\n" "fzf $preview_flag -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}" + printf "%s\n" "fzf $preview_flag -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags}" }} § diff --git a/rc/modules/fzf-grep.kak b/rc/modules/fzf-grep.kak index e3a2de2..3f23704 100644 --- a/rc/modules/fzf-grep.kak +++ b/rc/modules/fzf-grep.kak @@ -35,14 +35,14 @@ define-command -hidden fzf-grep %{ evaluate-commands %sh{ title="fzf grep" message="grep through contents of all files recursively. : open search result in new buffer. -${kak_opt_fzf_window_map:?}: open search result in new terminal" +${kak_opt_fzf_window_map:-ctrl-w}: open search result in new terminal" [ -n "${kak_client_env_TMUX:-}" ] && tmux_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open search result in horizontal split -${kak_opt_fzf_vertical_map:-}: open search result in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open search result in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open search result in vertical split" printf "%s\n" "info -title '${title}' '${message}${tmux_keybindings}'" - [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{evaluate-commands} -fzf-args %{--expect $kak_opt_fzf_window_map $additional_flags --delimiter=':' -n'3..'} -items-cmd %{$cmd} -filter %{sed -E 's/([^:]+):([^:]+):.*/edit -existing \1; execute-keys \2gvc/'}" + [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{evaluate-commands} -fzf-args %{--expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags --delimiter=':' -n'3..'} -items-cmd %{$cmd} -filter %{sed -E 's/([^:]+):([^:]+):.*/edit -existing \1; execute-keys \2gvc/'}" }} § diff --git a/rc/modules/fzf-vcs.kak b/rc/modules/fzf-vcs.kak index 21a5085..e3e323f 100644 --- a/rc/modules/fzf-vcs.kak +++ b/rc/modules/fzf-vcs.kak @@ -39,11 +39,11 @@ bzr status" vcs=$(printf "%s\n" "$cmd" | awk '{print $1}') title="fzf $vcs" [ -n "${kak_client_env_TMUX:-}" ] && additional_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open file in horizontal split -${kak_opt_fzf_vertical_map:-}: open file in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open file in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open file in vertical split" message="Open single or multiple files from git tree. : open file in new buffer. -${kak_opt_fzf_window_map:?}: open file in new terminal $additional_keybindings" +${kak_opt_fzf_window_map:-ctrl-w}: open file in new terminal $additional_keybindings" printf "%s\n" "info -title %{$title} %{$message}" printf "%s\n" "fzf-$vcs" exit diff --git a/rc/modules/sk-grep.kak b/rc/modules/sk-grep.kak index 3e541ab..1105d97 100644 --- a/rc/modules/sk-grep.kak +++ b/rc/modules/sk-grep.kak @@ -29,14 +29,14 @@ define-command -hidden fzf-sk-grep %{ evaluate-commands %sh{ title="skim interactive grep" message="Interactively grep pattern from current directory : open search result in new buffer. -${kak_opt_fzf_window_map:?}: open search result in new terminal" +${kak_opt_fzf_window_map:-ctrl-w}: open search result in new terminal" [ -n "${kak_client_env_TMUX:-}" ] && tmux_keybindings=" -${kak_opt_fzf_horizontal_map:-}: open search result in horizontal split -${kak_opt_fzf_vertical_map:-}: open search result in vertical split" +${kak_opt_fzf_horizontal_map:-ctrl-s}: open search result in horizontal split +${kak_opt_fzf_vertical_map:-ctrl-v}: open search result in vertical split" printf "%s\n" "info -title '${title}' '${message}${tmux_keybindings}'" - [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map" - printf "%s\n" "fzf -kak-cmd %{fzf-sk-grep-handler} -fzf-impl %{sk --ansi -m -i -c '${kak_opt_fzf_sk_grep_command:-} {}'} -fzf-args %{--expect $kak_opt_fzf_window_map $additional_flags} -multiple-cmd %{fzf-sk-populate-grep} -post-action %{buffer %opt{fzf_sk_first_file}}" + [ -n "${kak_client_env_TMUX}" ] && additional_flags="--expect ${kak_opt_fzf_vertical_map:-ctrl-v} --expect ${kak_opt_fzf_horizontal_map:-ctrl-s}" + printf "%s\n" "fzf -kak-cmd %{fzf-sk-grep-handler} -fzf-impl %{sk --ansi -m -i -c '${kak_opt_fzf_sk_grep_command:-} {}'} -fzf-args %{--expect ${kak_opt_fzf_window_map:-ctrl-w} $additional_flags} -multiple-cmd %{fzf-sk-populate-grep} -post-action %{buffer %opt{fzf_sk_first_file}}" }} define-command -hidden fzf-sk-grep-handler -params 1 %{