Add configuration for bat
This commit is contained in:
parent
4400b89d5c
commit
7305eb8efc
4 changed files with 35 additions and 1 deletions
16
.config/bat/config
Normal file
16
.config/bat/config
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
--theme="ansi"
|
||||
|
||||
# See $PAGER in ~/.config/shell/env
|
||||
--pager="less --chop-long-lines --ignore-case --LONG-PROMPT --status-column --quit-if-one-screen --RAW-CONTROL-CHARS"
|
||||
|
||||
--style="numbers,changes,header"
|
||||
|
||||
# Unrecognized mappings
|
||||
|
||||
--map-syntax ".bash_history:Bourne Again Shell (bash)"
|
||||
--map-syntax "**/bash/history:Bourne Again Shell (bash)"
|
||||
--map-syntax "**/zsh/history:Bourne Again Shell (bash)"
|
||||
|
||||
--map-syntax ".flake8:INI"
|
||||
|
||||
--map-syntax "poetry.lock:TOML"
|
||||
|
|
@ -7,6 +7,11 @@
|
|||
alias dotfiles='git --git-dir=$XDG_DATA_HOME/dotfiles --work-tree=$HOME'
|
||||
|
||||
|
||||
if _command_exists batcat; then
|
||||
alias bat='batcat'
|
||||
fi
|
||||
|
||||
|
||||
# Integrate `git`
|
||||
if _command_exists git; then
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export XDG_DATA_HOME="$HOME/.local/share" # also set in ~/.local/bin/install-do
|
|||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# Make up a XDG directory for binaries (that does not exist in the standard)
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_BIN_HOME="$HOME/.local/bin" # also set in ~/.local/bin/install-dotfiles
|
||||
|
||||
|
||||
# Convenient names for various places in the system
|
||||
|
|
@ -38,9 +38,15 @@ export LC_NUMERIC=en_US.UTF-8 # 1,234.56 rather than 1.234,56
|
|||
export LC_ADDRESS=de_DE.UTF-8
|
||||
export LC_TELEPHONE=de_DE.UTF-8
|
||||
|
||||
if command -v bat >/dev/null 2>&1; then
|
||||
export MANPAGER="sh -c 'col -bx | bat --language man --plain'"
|
||||
export MANROFFOPT="-c"
|
||||
fi
|
||||
|
||||
|
||||
# Move common tools' config and cache files into XDG directories
|
||||
|
||||
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
|
||||
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|
||||
export PSQLRC="$XDG_CONFIG_HOME/psql/psqlrc"
|
||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
set -eu
|
||||
|
||||
|
||||
XDG_BIN_HOME="${XDG_BIN_HOME:-$HOME/.local/bin}" # also set in ~/.config/shell/env
|
||||
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" # also set in ~/.config/shell/env
|
||||
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" # also set in ~/.config/shell/env
|
||||
|
||||
|
|
@ -102,6 +103,12 @@ _git config --local status.showUntrackedFiles no
|
|||
_git remote set-url origin "$DOTFILES_SSH"
|
||||
|
||||
|
||||
if command -v batcat >/dev/null 2>&1 && ! command -v bat >/dev/null 2>&1; then
|
||||
mkdir -p "$XDG_BIN_HOME"
|
||||
ln -sf "$(command -v batcat)" "$XDG_BIN_HOME/bat"
|
||||
fi
|
||||
|
||||
|
||||
echo ""
|
||||
echo "The dotfiles were installed successfully (branch: $DOTFILES_BRANCH)"
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue