[feature] replace highlight with bat
This commit is contained in:
parent
ac47877ada
commit
cb3667ff8f
|
@ -21,9 +21,8 @@ if status is-interactive
|
||||||
# change OTHER-WRITABLE color for `ls` command
|
# change OTHER-WRITABLE color for `ls` command
|
||||||
set -gx LS_COLORS 'ow=34;42;40'
|
set -gx LS_COLORS 'ow=34;42;40'
|
||||||
|
|
||||||
# === ranger configuration
|
# === bat configuration
|
||||||
# ranger highlighting color theme
|
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||||
set -gx HIGHLIGHT_OPTIONS --style=solarized-dark
|
|
||||||
|
|
||||||
# === dict.sh configuration
|
# === dict.sh configuration
|
||||||
set -gx D_SELECTOR 'plainsel'
|
set -gx D_SELECTOR 'plainsel'
|
||||||
|
|
|
@ -10,12 +10,13 @@ case "$PM" in
|
||||||
! command -v pip3 && "$PDIR/python/install.sh"
|
! command -v pip3 && "$PDIR/python/install.sh"
|
||||||
sudo add-apt-repository ppa:fish-shell/release-3 -y
|
sudo add-apt-repository ppa:fish-shell/release-3 -y
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install fish libnotify-bin xdotool silversearcher-ag dash -y
|
sudo apt install fish libnotify-bin xdotool silversearcher-ag dash bat -y
|
||||||
[ ! -d ~/.fzf ] && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
[ ! -d ~/.fzf ] && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||||
~/.fzf/install
|
~/.fzf/install --all
|
||||||
|
lnsf /usr/bin/batcat "$HOME/.local/bin/bat"
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
sudo pacman -S --needed --needed fish xdotool fzf the_silver_searcher dash
|
sudo pacman -S --needed --needed fish xdotool fzf the_silver_searcher dash bat
|
||||||
# prevent bash upgradation relink /bin/sh
|
# prevent bash upgradation relink /bin/sh
|
||||||
sudo mkdir -p /etc/pacman.d/hooks
|
sudo mkdir -p /etc/pacman.d/hooks
|
||||||
cat <<' EOT' | sed 's/^ *//' | sudo tee /etc/pacman.d/sh-is-dash.hook
|
cat <<' EOT' | sed 's/^ *//' | sudo tee /etc/pacman.d/sh-is-dash.hook
|
||||||
|
|
|
@ -306,14 +306,15 @@ handle_mime() {
|
||||||
fi
|
fi
|
||||||
if [[ "$( tput colors )" -ge 256 ]]; then
|
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||||
local pygmentize_format='terminal256'
|
local pygmentize_format='terminal256'
|
||||||
local highlight_format='xterm256'
|
#local highlight_format='xterm256'
|
||||||
else
|
else
|
||||||
local pygmentize_format='terminal'
|
local pygmentize_format='terminal'
|
||||||
local highlight_format='ansi'
|
#local highlight_format='ansi'
|
||||||
fi
|
fi
|
||||||
env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
|
#env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
|
||||||
--out-format="${highlight_format}" \
|
#--out-format="${highlight_format}" \
|
||||||
--force -- "${FILE_PATH}" && exit 5
|
#--force -- "${FILE_PATH}" && exit 5
|
||||||
|
bat "${FILE_PATH}" --paging=never --color=always --style=numbers && exit 5
|
||||||
env COLORTERM=8bit bat --color=always --style="plain" \
|
env COLORTERM=8bit bat --color=always --style="plain" \
|
||||||
-- "${FILE_PATH}" && exit 5
|
-- "${FILE_PATH}" && exit 5
|
||||||
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
|
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
|
||||||
|
|
Loading…
Reference in New Issue
Block a user