From 3afa0e893008be14d40276351ce1544b81db239f Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 13 Dec 2020 16:40:42 -0800 Subject: [PATCH] Add config for bat --- bash/.config/bash/bashrc.d/aliases.sh | 5 ----- bat/.config/bash/bashrc.d/bat.sh | 5 +++++ bat/.config/profile/env.d/bat.env | 4 ++++ bat/.config/profile/profile.d/bat.sh | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 bat/.config/bash/bashrc.d/bat.sh create mode 100644 bat/.config/profile/env.d/bat.env create mode 100644 bat/.config/profile/profile.d/bat.sh diff --git a/bash/.config/bash/bashrc.d/aliases.sh b/bash/.config/bash/bashrc.d/aliases.sh index 7b09463..6152e48 100644 --- a/bash/.config/bash/bashrc.d/aliases.sh +++ b/bash/.config/bash/bashrc.d/aliases.sh @@ -29,8 +29,3 @@ if [[ $(uname) == Linux ]]; then alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi - -if command -v bat &> /dev/null ; then - alias bat='bat --plain --theme zenburn' - alias cat='bat --style=plain --pager=never' -fi diff --git a/bat/.config/bash/bashrc.d/bat.sh b/bat/.config/bash/bashrc.d/bat.sh new file mode 100644 index 0000000..ad27953 --- /dev/null +++ b/bat/.config/bash/bashrc.d/bat.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if command -v bat &> /dev/null ; then + alias cat='bat --pager=never' +fi diff --git a/bat/.config/profile/env.d/bat.env b/bat/.config/profile/env.d/bat.env new file mode 100644 index 0000000..f7f5376 --- /dev/null +++ b/bat/.config/profile/env.d/bat.env @@ -0,0 +1,4 @@ +#shellcheck disable=SC2034 +BAT_THEME=zenburn +BAT_STYLE=plain +MANPAGER="sh -c 'col -bx | bat -l man -p'" diff --git a/bat/.config/profile/profile.d/bat.sh b/bat/.config/profile/profile.d/bat.sh new file mode 100644 index 0000000..f15c739 --- /dev/null +++ b/bat/.config/profile/profile.d/bat.sh @@ -0,0 +1,3 @@ +batdiff () { + git diff --name-only --diff-filter=d | xargs bat --diff +}