# Moving aliases and other setup to non-shell-specific # file ~/.profile # === OSX === if [ "$(uname -s)" = "Darwin" ]; then # Make bash more posix compliant if [ $SHELL = "/bin/bash" ] || [ $SHELL = "/opt/homebrew/bin/bash" ] || [ $SHELL = "/opt/local/bin/bash" ] ; then set -o posix # OSX-specific bash warning export BASH_SILENCE_DEPRECATION_WARNING=1 fi # MacPorts setup if [ -d '/opt/local' ]; then export PATH="/opt/local/bin:/opt/local/sbin:$PATH" export MANPATH=/opt/local/share/man:$MANPATH fi # Brew (OSX) specifics if [ -f '/opt/homebrew/bin/brew' ]; then export HOMEBREW_PREFIX="/opt/homebrew" export HOMEBREW_CELLAR="/opt/homebrew/Cellar" export HOMEBREW_REPOSITORY="/opt/homebrew" export HOMEBREW_FORCE_BREWED_CURL=1 export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/curl/bin${PATH+:$PATH}" export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" if [ -f "/opt/homebrew/etc/bash_completion.d/git-completion.bash" ]; then source /opt/homebrew/etc/bash_completion.d/git-completion.bash; fi fi if [ $(command -v python3) ]; then export PATH=$(python3 -m site --user-base)/bin:$PATH fi # Load config from filesystem export AWS_SDK_LOAD_CONFIG=1 # Add Local bin export PATH=$PATH:/Users/tydavis/.local/bin # Unlock Keychain cli alias unlock='security unlock-keychain ~/Library/Keychains/login.keychain' #upcode alias for quickly updating code where gitrect cannot if [ "$(command -v fd)" ]; then alias upcode="fd -H -t d -E mod -E vendor '.git$' ~/.code -x fetchgit" else alias upcode="find ~/.code -name \".git\" |xargs -n1 fetchgit " fi fi # === END OSX === # Go setup if [ -d "$HOME/.golang" ]; then ### Just in case it's missing mkdir -p ~/.golang/path # Go in the homedir export GOROOT_BOOTSTRAP=$HOME/.golang/bootstrap_go export GOROOT=$HOME/.golang/go export GOPATH=$HOME/.golang/path # Disable broken caching by proxy.golang export GOPROXY=direct export GOSUMDB=off export GOPRIVATE=github.com/hpe-hcss export PATH=$HOME/.golang/go/bin:$PATH:$HOME/.cargo/bin:$HOME/.golang/path/bin:$HOME/.local/bin fi # == Editors == # Vim not detected? Use vi as a fallback if [ ! "$(command -v vim)" ]; then alias vim=vi fi # Ensure less always uses the one-page, raw control characters, and no-init settings export LESS=FRX # Defaults alias ls='/bin/ls -F' ## Zstd always uses all cores if [ "$(command -v zstd)" ]; then alias zstd='zstd -T0' fi # == Rust Tools ==# # Add Rust paths if present if [ -f "$HOME/.cargo/env" ]; then export PATH=$HOME/.cargo/bin:$PATH fi if [ "$(command -v eza)" ]; then alias ls='eza -G --color never -a -s type -F --time-style=long-iso' alias ll='eza -l --color never -a -s type -F --time-style=long-iso' elif [ "$(command -v exa)" ]; then alias ls='exa -G --color never -a -s type -F --time-style=long-iso' alias ll='exa -l --color never -a -s type -F --time-style=long-iso' fi if [ "$(command -v bat)" ]; then alias cat='bat -pp' export BAT_THEME="ansi" fi if [ "$(command -v ncdu)" ]; then alias ncdu="ncdu --color=off" fi if [ "$(command -v btm)" ]; then alias btm="btm -m -l --mem_as_value " fi # Must put these after OSX setup so brew is part of the $PATH # Colima / Podman if [ $(command -v colima) ]; then alias docker='colima nerdctl --profile default -- ' alias nerdctl='colima nerdctl --profile default -- ' elif [ "$(command -v podman)" ]; then alias docker=podman # User-hosted podman socket export DOCKER_HOST="unix:$XDG_RUNTIME_DIR/podman/podman.sock" fi # Presrving these for future use #alias psc='ps xawf -eo pid,user,cgroup,args' #alias gdb='gdb -tui' #if [ "$TERM" = "tmux-256color" ]; then export TERM=xterm-256color; fi # == END TOOLS == ## == DOTFILES == # To load files # git clone --bare git@git.sr.ht:~tydavis/dotfiles $HOME/.dotfiles #shorten the git dotfiles management alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' # Ignore files that aren't relevant # dotfiles config --local status.showUntrackedFiles no ## == END DOTFILES == # Prompt USER=$(id -un) HOSTNAME=$(uname -n) export PS1='$USER@$HOSTNAME:$PWD/\$ ' if [ ! $(echo $SHELL|grep -q "bash") ]; then if [ -f "$HOME/.bashrc" ]; then . $HOME/.bashrc; fi fi