Made bash config reflect zsh config

This commit is contained in:
Jeremie Fraeys 2024-08-20 01:26:31 -04:00
parent d18692b13d
commit 4a7b82cf28
2 changed files with 15 additions and 50 deletions

View file

@ -7,7 +7,7 @@ path_print_clean() {
local p
# Read PATH into an array
IFS=: read -r -a arr <<< "${!var}:"
IFS=: read -r -a arr <<<"${!var}:"
# Declare an associative array to keep track of seen paths
declare -A seen
@ -53,16 +53,6 @@ path_clean() {
export PATH="$path"
}
# Auto-update and other bash settings
DISABLE_UPDATE_PROMPT=true
# Miscellaneous configurations
# Uncomment to use case-sensitive completion
# CASE_SENSITIVE="true"
# Uncomment to use hyphen-insensitive completion
# HYPHEN_INSENSITIVE="true"
# Load bash completion
if [[ -f /etc/bash_completion ]]; then
. /etc/bash_completion
@ -70,35 +60,19 @@ fi
# Custom aliases
alias python="python3"
alias v="nvim"
alias cat="bat --paging=never"
alias grep="grep --color=auto"
alias ls='eza --group-directories-first --color=auto'
alias la='eza -la --group-directories-first --color=auto'
alias ll='eza -l --group-directories-first --color=auto'
alias lt='eza -lt modified --sort newest'
alias lS='eza -lS --group-directories-first --color=auto'
alias tree='eza --tree --level=3'
alias lg='eza --git'
alias bathelp='bat --plain --language=help'
help() {
"$@" --help 2>&1 | bathelp
}
# Custom Apt udpate and upgrade
alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade'
# Overwriting -h and --help with bat highlights
alias -g :h='-h 2>&1 | bat --language=help --style=plain'
alias -g :help='--help 2>&1 | bat --language=help --style=plain'
if [[ -f "$HOME/.local/bin/scripts/check_aliases" ]]; then
. "$HOME/.local/bin/scripts/check_aliases"
fi
# Set the default editor
export EDITOR='nvim'
# Add eza completions to FPATH
[[ ! "$FPATH" =~ (^|:)${HOME}/.local/bin/eza/completions/bash(:|$) ]] && export FPATH="$HOME/.local/bin/eza/completions/bash:$FPATH"
# Add eza completions to BASH_COMPLETION
[[ ! "$BASH_COMPLETION" =~ (^|:)${HOME}/.local/bin/eza/completions/bash(:|$) ]] && export BASH_COMPLETION="$HOME/.local/bin/eza/completions/bash:$BASH_COMPLETION"
# Initialize zoxide (replace with bash equivalent if necessary)
# Initialize zoxide
eval "$(zoxide init bash)"
path_clean

View file

@ -117,10 +117,10 @@ plugins=(
docker
zsh-syntax-highlighting
zsh-autosuggestions
colored-man-pages
macos
autoupdate
zoxide
eza
)
export ZSH_AUTOSUGGEST_STRATEGY=(
history
@ -161,24 +161,15 @@ fi
# Custom aliases
alias python="python3"
alias v="nvim"
alias cat="bat --paging=never"
alias grep="grep --color=auto"
alias ls='eza --group-directories-first --color=auto'
alias la='eza -la --group-directories-first --color=auto'
alias ll='eza -l --group-directories-first --color=auto'
alias lt='eza -lt modified --sort newest'
alias lS='eza -lS --group-directories-first --color=auto'
alias tree='eza --tree --level=3'
alias lg='eza --git'
alias bathelp='bat --plain --language=help'
help() {
"$@" --help 2>&1 | bathelp
}
# Overwriting -h and --help with bat highlights
alias -g :h='-h 2>&1 | bat --language=help --style=plain'
alias -g :help='--help 2>&1 | bat --language=help --style=plain'
alias update_omz="omz update && update_oh_my_zsh_custom"
if [[ -f ~/.local/bin/scripts/check_aliases ]]; then
source ~/.local/bin/scripts/check_aliases
fi
# Add eza completions to FPATH
[[ ! "$FPATH" =~ (^|:)${HOME}/.local/bin/eza/completions/zsh(:|$) ]] && export FPATH="$HOME/.local/bin/eza/completions/zsh:$FPATH"