use separate scripts for bat and fzf

This commit is contained in:
lelgenio 2020-11-14 16:58:18 -03:00
parent e768243ad6
commit 901b06cd69
3 changed files with 23 additions and 17 deletions

View File

@ -39,9 +39,9 @@ command -qs trash &&
command -qs exa &&
alias ls 'exa --git'
{%@@ set bat_command = "bat " + ("--theme GitHub" * (color.type == "light")) @@%}
command -qs bat &&
alias cat "{{@@ bat_command @@}}"
bat --version &>/dev/null &&
alias cat bat
command -qs zoxide &&
zoxide init fish | source
@ -343,19 +343,5 @@ set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")
set -xU LESS_TERMCAP_ue (printf "\e[0m")
set -xU LESS_TERMCAP_us (printf "\e[01;32m")
#}}}
# Fzf settings{{{
set -x FZF_DEFAULT_OPTS "\
--preview '{{@@ bat_command @@}} --style=numbers --color=always {}' \
--color='\
bg+:{{@@ color.bg_light @@}},\
hl+:{{@@ color.normal.green @@}},\
gutter:{{@@ color.bg @@}},\
prompt:{{@@ accent_color @@}},\
pointer:{{@@ accent_color @@}},\
spinner:{{@@ accent_color @@}}\
'"
#}}}
# vim:foldmethod=marker

7
dotfiles/scripts/bat Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
exec /usr/bin/bat {%@@ if color_type == "light" @@%}
"--theme GitHub"
{%@@ else @@%}
{%@@ endif @@%}
$@

13
dotfiles/scripts/fzf Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
{%@@ set bat_command = "bat " + ("--theme GitHub" * (color_type == "light")) @@%}
exec /usr/bin/fzf --preview '{{@@ bat_command @@}} --style=numbers --color=always {}' \
--color="\
bg+:{{@@ color.bg_light @@}},\
hl+:{{@@ color.normal.green @@}},\
gutter:{{@@ color.bg @@}},\
prompt:{{@@ accent_color @@}},\
pointer:{{@@ accent_color @@}},\
spinner:{{@@ accent_color @@}}\
" $@