diff options
author | Tyler Davis <tyler@gluecode.net> | 2024-05-16 01:44:34 +0000 |
---|---|---|
committer | Tyler Davis <tyler@gluecode.net> | 2024-05-16 01:44:34 +0000 |
commit | ea855bf657ba5c540e8c322714d432697bf09343 (patch) | |
tree | 4bf0cab871bf011c2a2f2a359506a3dd45e7d4f1 /.profile | |
parent | a248a002fd084b5c38e738811f242509fd661b5c (diff) | |
download | dotfiles-ea855bf657ba5c540e8c322714d432697bf09343.tar.gz dotfiles-ea855bf657ba5c540e8c322714d432697bf09343.zip |
sh: adapt to BSD
Diffstat (limited to '.profile')
-rw-r--r-- | .profile | 60 |
1 files changed, 15 insertions, 45 deletions
@@ -1,9 +1,8 @@ # Moving aliases and other setup to non-shell-specific # file ~/.profile -# === OSX === -if [ "$(uname -s)" = "Darwin" ]; then - # Make bash more posix compliant +case $(uname) in +Darwin) if [ $SHELL = "/bin/bash" ] || [ $SHELL = "/opt/homebrew/bin/bash" ] || [ $SHELL = "/opt/local/bin/bash" ] ; then set -o posix # OSX-specific bash warning @@ -44,12 +43,19 @@ if [ "$(uname -s)" = "Darwin" ]; then alias unlock='security unlock-keychain ~/Library/Keychains/login.keychain' alias ls='/bin/ls -F -h -A -D "%F %H:%M:%S"' alias ll='/bin/ls -F -h -A -D "%F %H:%M:%S" -l' -else - # Linux alias is likely busybox or gnu, which doesn't have the -D argument option - alias ls='/bin/ls --color=never -F -h -A ' - alias ll='/bin/ls --color=never -F -h -A -l' -fi -# === END OSX === + ;; +Linux) + alias ls="/bin/ls --color=never -F -h -A " + alias ll="/bin/ls --color=never -F -h -A -l" + ;; +*BSD) + alias ls="/bin/ls -F -h -A " + alias ll="/bin/ls -F -h -A -l" + set -o emacs + set -o tabcomplete + export PATH=$PATH:$HOME/.local/bin + ;; +esac # Go setup if [ -d "$HOME/.golang" ]; then @@ -75,10 +81,6 @@ fi if [ "$(command -v code)" ] && [ "$(env | grep VSCODE)" ]; then export EDITOR="code" export VISUAL="code" -elif [ -d "$HOME/.config/doom" ] && [ "$(command -v emacs)" ]; then - export EDITOR="emacs" - export VISUAL="emacs" - export PATH=$PATH:$HOME/.config/emacs/bin elif [ "$(command -v hx)" ]; then export EDITOR="hx" export VISUAL="hx" @@ -91,9 +93,7 @@ fi export LESS=FRX # Defaults - alias dua='du -h -d 1 | sort -h' - alias upcode="find ~/.code -name \".git\" -exec fetchgit {} \;" ## Zstd always uses all cores @@ -110,34 +110,7 @@ if [ -d "$HOME/.cargo/bin" ]; then export PATH=$HOME/.cargo/bin:$PATH 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 - -# 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' - alias gc_all="find ~/.code -name \".git\" | xargs -I {} -n 1 bash -c \"cd {}; echo {}; git gc --aggressive;\" " - -#if [ "$TERM" = "tmux-256color" ]; then export TERM=xterm-256color; fi # == END TOOLS == ## == DOTFILES == @@ -158,6 +131,3 @@ export HISTFILE=~/.history export HISTSIZE=10000 export PS1='\$ ' -if [ ! $(echo $SHELL|grep -q "bash") ]; then - if [ -f "$HOME/.bashrc" ]; then . $HOME/.bashrc; fi -fi |