1
0
Fork 0

Merge pull request #19 from andreyorst/bat_support

add support for Bat - a cat clone with wings
This commit is contained in:
Andrey Orst 2018-10-14 22:50:29 +03:00 committed by GitHub
commit fb10e285e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,11 +91,13 @@ int fzf_preview_lines 100
declare-option -docstring "highlighter to use in preview window declare-option -docstring "highlighter to use in preview window
Supported tools: Supported tools:
<package>: <value>: <package>: <value>:
Bat: ""bat""
Coderay: ""coderay"" Coderay: ""coderay""
Highlight: ""highlight"" Highlight: ""highlight""
Rouge: ""rouge"" Rouge: ""rouge""
Default arguments: Default arguments:
bat: ""bat --color=always --style=header,grid,numbers {}""
coderay: ""coderay {}"" coderay: ""coderay {}""
highlight: ""highlight --failsafe -O ansi {}"" highlight: ""highlight --failsafe -O ansi {}""
rouge: ""rougify {}"" rouge: ""rougify {}""
@ -302,13 +304,15 @@ define-command -hidden fzf -params 2..3 %{ evaluate-commands %sh{
if [ "$(echo $callback | awk '{print $1}')" = "edit" ] && [ $kak_opt_fzf_preview = "true" ]; then if [ "$(echo $callback | awk '{print $1}')" = "edit" ] && [ $kak_opt_fzf_preview = "true" ]; then
case $kak_opt_fzf_highlighter in case $kak_opt_fzf_highlighter in
bat)
highlighter="bat --color=always --style=header,grid,numbers {}" ;;
coderay) coderay)
highlighter="coderay {}" ;; highlighter="coderay {}" ;;
highlight) highlight)
highlighter="highlight --failsafe -O ansi {}" ;; highlighter="highlight --failsafe -O ansi {}" ;;
rouge) rouge)
highlighter="rougify {}" ;; highlighter="rougify {}" ;;
coderay*|highlight*|rougify*) bat*|coderay*|highlight*|rougify*)
highlighter=$kak_opt_fzf_highlighter ;; highlighter=$kak_opt_fzf_highlighter ;;
*) *)
executable=$(echo $kak_opt_fzf_highlighter | awk '{print $1}'| tr '(' ' ' | cut -d " " -f 2) executable=$(echo $kak_opt_fzf_highlighter | awk '{print $1}'| tr '(' ' ' | cut -d " " -f 2)