feat(zsh): use LSD only, LS_COLORS via vivid, bat

This commit is contained in:
winston 2022-12-07 09:30:04 +01:00
parent d0188fdde4
commit 5c1dc69b05
Signed by: winston
GPG key ID: 3786770EDBC2B481

View file

@ -47,37 +47,35 @@ export SAVEHIST=10000
setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_DUPS
# fuck if available # use fuck if available
[[ -x "$(command -v thefuck)" ]] && eval $(thefuck --alias) [[ -x "$(command -v thefuck)" ]] && eval $(thefuck --alias)
# credit to locotay
function bitch() {
[ "$1" = "you" ] && [ "$2" = "better" ] && sudo "${@:3}"
}
# }}} # }}}
### aliases & functions {{{ ### aliases & functions {{{
## basics {{{ ## basics {{{
# use exa+lsd to list directories, if available, falling back to ls aliases if [ -x "$(command -v vivid)" ]; then
if [ -x "$(command -v lsd)" ] && [ -x "$(command -v exa)" ]; then export LS_COLORS="$(vivid generate catppuccin-mocha)"
fi
if [ -x "$(command -v lsd)" ]; then
# add a bit more space between the file icon & name # add a bit more space between the file icon & name
export EXA_ICON_SPACING=1
# lsd is the better drop-in replacement
alias ls='lsd' alias ls='lsd'
# only exa can do this, atm alias l='lsd'
alias l='exa --icons --group-directories-first' alias ll='lsd -l'
alias ll='exa --icons --group-directories-first --git -l' alias la='lsd -la'
alias la='exa --icons --group-directories-first --git -la' alias lt='lsd -l --total-size' alias lat='lsd -lA --total-size'
# only lsd can do this, atm alias tree='lsd --tree'
alias lt='lsd -l --total-size'
alias lat='lsd -lA --total-size'
else else
alias l='ls' alias l='ls'
alias ll='ls -l' alias ll='ls -l'
alias la='ls -lA' alias la='ls -lA'
fi fi
if [ -x "$(command -v bat)" ]; then # both names for bat
export BAT_THEME="catppuccin-mocha"
if [ -x "$(command -v batcat)" ]; then
alias cat='batcat'
elif [ -x "$(command -v bat)" ]; then
alias cat='bat' alias cat='bat'
fi fi
@ -88,10 +86,6 @@ if [[ -x "$(command -v nvim)" ]]; then
alias wiki='nvim -c VimwikiIndex' alias wiki='nvim -c VimwikiIndex'
fi fi
if [[ -x "$(command -v newsboat)" ]]; then
alias nb='newsboat -C ~/.config/newsboat/config -u ~/.config/newsboat/urls'
fi
[[ -x "$(command -v taskwarrior-tui)" ]] && alias tt='taskwarrior-tui' [[ -x "$(command -v taskwarrior-tui)" ]] && alias tt='taskwarrior-tui'
# switch between yubikeys for the same GPG key # switch between yubikeys for the same GPG key
@ -125,6 +119,7 @@ function twm() {
} }
alias sbks='launchctl kickstart -k "gui/${UID}/homebrew.mxcl.sketchybar"' alias sbks='launchctl kickstart -k "gui/${UID}/homebrew.mxcl.sketchybar"'
alias onefetch='onefetch --true-color=never' alias onefetch='onefetch --true-color=never'
alias mbsync='mbsync --config ~/.config/mbsyncrc'
function icat() { function icat() {
if [ "$TERM_PROGRAM" = "WezTerm" ]; then if [ "$TERM_PROGRAM" = "WezTerm" ]; then
wezterm imgcat "$@" wezterm imgcat "$@"
@ -161,6 +156,13 @@ alias cmrm='chezmoi remove'
alias cmst='chezmoi status' alias cmst='chezmoi status'
alias cmup='chezmoi update' alias cmup='chezmoi update'
## }}} ## }}}
function debugnvim() {
cd $(mktemp -d)
export XDG_DATA_HOME=$PWD XDG_CACHE_HOME=$PWD XDG_CONFIG_HOME=$PWD
mkdir nvim
nvim nvim/init.lua
}
### }}} ### }}}
### languages & frameworks {{{ ### languages & frameworks {{{