use 'command' instead of 'cmd' #63
This commit is contained in:
parent
7fef4973e6
commit
c5d8ca65a1
3 changed files with 10 additions and 10 deletions
|
@ -118,7 +118,7 @@ configurations below.
|
||||||
### Windowing
|
### Windowing
|
||||||
If you're using Tmux, you do not have to worry about windowing, since fzf.kak
|
If you're using Tmux, you do not have to worry about windowing, since fzf.kak
|
||||||
automatically creates all needed Tmux splits and panes for you. However in case
|
automatically creates all needed Tmux splits and panes for you. However in case
|
||||||
you're not using Tmux, fzf.kak uses `fzf_terminal_cmd` option to call windowing
|
you're not using Tmux, fzf.kak uses `fzf_terminal_command` option to call windowing
|
||||||
command to create new windows. By default it is set to use `terminal` alias:
|
command to create new windows. By default it is set to use `terminal` alias:
|
||||||
`terminal kak -c %val{session} -e "%arg{@}"`, but some terminals can provide
|
`terminal kak -c %val{session} -e "%arg{@}"`, but some terminals can provide
|
||||||
other aliases or commands, like `terminal-tab` in Kitty. You may want to edit
|
other aliases or commands, like `terminal-tab` in Kitty. You may want to edit
|
||||||
|
@ -180,7 +180,7 @@ option to `false`.
|
||||||
|
|
||||||
#### Highlighting preview window
|
#### Highlighting preview window
|
||||||
You also can highlight contents of the file displayed within preview window. To
|
You also can highlight contents of the file displayed within preview window. To
|
||||||
do so, you can specify which highlighter to use with `fzf_highlight_cmd` option.
|
do so, you can specify which highlighter to use with `fzf_highlight_command` option.
|
||||||
Supported highlighters are:
|
Supported highlighters are:
|
||||||
|
|
||||||
* [Bat][16]
|
* [Bat][16]
|
||||||
|
|
12
rc/fzf.kak
12
rc/fzf.kak
|
@ -57,7 +57,7 @@ These are default arguments for the tools above:
|
||||||
highlight: "highlight --failsafe -O ansi {}"
|
highlight: "highlight --failsafe -O ansi {}"
|
||||||
rouge: "rougify {}"
|
rouge: "rougify {}"
|
||||||
' \
|
' \
|
||||||
str fzf_highlight_cmd "highlight"
|
str fzf_highlight_command "highlight"
|
||||||
|
|
||||||
declare-option -docstring "height of fzf tmux split in screen lines or percents.
|
declare-option -docstring "height of fzf tmux split in screen lines or percents.
|
||||||
Default value: 25%%" \
|
Default value: 25%%" \
|
||||||
|
@ -87,7 +87,7 @@ str fzf_horizontal_map 'ctrl-s'
|
||||||
declare-option -docstring 'command to use to create new window when not using tmux.
|
declare-option -docstring 'command to use to create new window when not using tmux.
|
||||||
|
|
||||||
Default value: terminal kak -c %val{session} -e "%arg{@}"' \
|
Default value: terminal kak -c %val{session} -e "%arg{@}"' \
|
||||||
str fzf_terminal_cmd 'terminal kak -c %val{session} -e "%arg{@}"'
|
str fzf_terminal_command 'terminal kak -c %val{session} -e "%arg{@}"'
|
||||||
|
|
||||||
try %{ declare-user-mode fzf }
|
try %{ declare-user-mode fzf }
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ fzf-window -params .. %{ evaluate-commands %sh{
|
||||||
if [ -n "$kak_client_env_TMUX" ]; then
|
if [ -n "$kak_client_env_TMUX" ]; then
|
||||||
printf "%s\n" 'tmux-terminal-window kak -c %val{session} -e "%arg{@}"'
|
printf "%s\n" 'tmux-terminal-window kak -c %val{session} -e "%arg{@}"'
|
||||||
else
|
else
|
||||||
printf "%s\n" "$kak_opt_fzf_terminal_cmd"
|
printf "%s\n" "$kak_opt_fzf_terminal_command"
|
||||||
fi
|
fi
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -167,12 +167,12 @@ fzf -params .. %{ evaluate-commands %sh{
|
||||||
|
|
||||||
# handle preview if not defined explicitly with `-preview-cmd'
|
# handle preview if not defined explicitly with `-preview-cmd'
|
||||||
if [ ${kak_opt_fzf_preview} = "true" ] && [ -z "${preview_cmd}" ]; then
|
if [ ${kak_opt_fzf_preview} = "true" ] && [ -z "${preview_cmd}" ]; then
|
||||||
case ${kak_opt_fzf_highlight_cmd} in
|
case ${kak_opt_fzf_highlight_command} in
|
||||||
(bat) highlight_cmd="bat --color=always --style=plain {}" ;;
|
(bat) highlight_cmd="bat --color=always --style=plain {}" ;;
|
||||||
(coderay) highlight_cmd="coderay {}" ;;
|
(coderay) highlight_cmd="coderay {}" ;;
|
||||||
(highlight) highlight_cmd="highlight --failsafe -O ansi {}" ;;
|
(highlight) highlight_cmd="highlight --failsafe -O ansi {}" ;;
|
||||||
(rouge) highlight_cmd="rougify {}" ;;
|
(rouge) highlight_cmd="rougify {}" ;;
|
||||||
(*) highlight_cmd="${kak_opt_fzf_highlight_cmd}" ;;
|
(*) highlight_cmd="${kak_opt_fzf_highlight_command}" ;;
|
||||||
esac
|
esac
|
||||||
preview_cmd="--preview '(${highlight_cmd} || cat {}) 2>/dev/null | head -n ${kak_opt_fzf_preview_lines}' --preview-window=\${pos}"
|
preview_cmd="--preview '(${highlight_cmd} || cat {}) 2>/dev/null | head -n ${kak_opt_fzf_preview_lines}' --preview-window=\${pos}"
|
||||||
fi
|
fi
|
||||||
|
@ -204,7 +204,7 @@ fzf -params .. %{ evaluate-commands %sh{
|
||||||
# `terminal' doesn't support any kind of width and height parameters, so tmux panes are created by tmux itself
|
# `terminal' doesn't support any kind of width and height parameters, so tmux panes are created by tmux itself
|
||||||
cmd="nop %sh{ command tmux split-window ${measure} ${tmux_height%%%*} '${fzfcmd}' }"
|
cmd="nop %sh{ command tmux split-window ${measure} ${tmux_height%%%*} '${fzfcmd}' }"
|
||||||
else
|
else
|
||||||
cmd="${kak_opt_fzf_terminal_cmd%% *} %{${fzfcmd}}"
|
cmd="${kak_opt_fzf_terminal_command%% *} %{${fzfcmd}}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%s\n" "${cmd}"
|
printf "%s\n" "${cmd}"
|
||||||
|
|
|
@ -24,7 +24,7 @@ declare-option -docstring 'command to show list of directories in preview window
|
||||||
Default value:
|
Default value:
|
||||||
tree -d
|
tree -d
|
||||||
' \
|
' \
|
||||||
str cd_preview_cmd "tree -d {}"
|
str cd_preview_command "tree -d {}"
|
||||||
|
|
||||||
declare-option -docstring 'maximum amount of previewed directories' \
|
declare-option -docstring 'maximum amount of previewed directories' \
|
||||||
int fzf_preview_dirs '300'
|
int fzf_preview_dirs '300'
|
||||||
|
@ -43,7 +43,7 @@ current path: $(pwd)}"
|
||||||
esac
|
esac
|
||||||
if [ "$kak_opt_fzf_cd_preview" = "true" ]; then
|
if [ "$kak_opt_fzf_cd_preview" = "true" ]; then
|
||||||
preview_flag="-preview"
|
preview_flag="-preview"
|
||||||
preview="--preview '($kak_opt_cd_preview_cmd) 2>/dev/null | head -n $kak_opt_fzf_preview_dirs'"
|
preview="--preview '($kak_opt_cd_preview_command) 2>/dev/null | head -n $kak_opt_fzf_preview_dirs'"
|
||||||
fi
|
fi
|
||||||
printf "%s\n" "fzf $preview_flag -kak-cmd %{change-directory} -items-cmd %{$items_command} -preview-cmd %{$preview} -post-action %{fzf-cd}"
|
printf "%s\n" "fzf $preview_flag -kak-cmd %{change-directory} -items-cmd %{$items_command} -preview-cmd %{$preview} -post-action %{fzf-cd}"
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in a new issue