.dotfiles/bash/.bashrc
2024-12-18 20:51:10 -05:00

62 lines
1.8 KiB
Bash
Executable file

# Load bash completion
if [[ -f /etc/bash_completion ]]; then
. /etc/bash_completion
fi
# Check for WSL and adjust accordingly
if grep -q Microsoft /proc/version; then
# WSL-specific configuration
# Set path to Windows executables for easy access
export PATH="/mnt/c/Windows/System32:$PATH"
export PATH="/mnt/c/Program Files:$PATH"
export PATH="/mnt/c/Windows:$PATH"
# Use Windows Notepad or other executables from WSL
alias notepad="notepad.exe"
alias explorer="explorer.exe"
else
# Unix-specific configuration (Linux or macOS)
# You can add Unix-specific tools and paths here if needed
# For example, add custom Linux paths if they are different from default
export PATH="/usr/local/bin:$PATH"
fi
# Custom aliases
alias python="python3"
alias grep="grep --color=auto"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# Load custom check_aliases if it exists
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 BASH_COMPLETION if not already included
if [[ ! "$BASH_COMPLETION" =~ (^|:)${HOME}/.local/bin/eza/completions/bash(:|$) ]]; then
export BASH_COMPLETION="$HOME/.local/bin/eza/completions/bash:$BASH_COMPLETION"
fi
# Initialize zoxide
if command -v zoxide &>/dev/null; then
eval "$(zoxide init bash)"
fi
# Initialize Starship
if command -v starship &>/dev/null; then
eval "$(starship init bash)"
fi
# Optionally, initialize other tools for Unix and WSL environments
if command -v wslpath &>/dev/null; then
# Adjust paths between WSL and Windows if necessary
export PATH="$(wslpath 'C:\Program Files'):$PATH"
export PATH="/mnt/c/Program Files/neovim/bin:$PATH"
fi