bashrc-all 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. if [ -f ~/.wal_alias ]; then
  2. . ~/.wal_alias
  3. fi
  4. [ -f ~/.fzf.bash ] && source ~/.fzf.bash
  5. # Cargo config
  6. [ -f ~/.cargo ] && source "$HOME/.cargo/env"
  7. CAT_PATH=$(which cat --skip-alias)
  8. if [ -f ~/.cache/wal/sequences ]; then
  9. $CAT_PATH ~/.cache/wal/sequences
  10. fi
  11. export EDITOR=$(which vim)
  12. BPYTOP_PATH=$(which bpytop)
  13. if [ ! -z "$BPYTOP_PATH" ]; then
  14. alias htop="bpytop -b \"cpu mem net proc\""
  15. fi
  16. EXA_PATH=$(which exa)
  17. if [ ! -z "$EXA_PATH" ]; then
  18. alias ls="$EXA_PATH"
  19. alias ll="$EXA_PATH -lahg"
  20. alias lg="$EXA_PATH -lahg --git"
  21. fi
  22. BAT_PATH=$(which bat)
  23. if [ ! -z "$BAT_PATH" ]; then
  24. export MANPAGER="$BAT_PATH"
  25. alias cat="$BAT_PATH"
  26. fi
  27. # Platform agnostic aliases
  28. export TMUX_PATH=$(which tmux --skip-alias)
  29. alias tmuxn="$TMUX_PATH new -s $1"
  30. alias tmuxa="$TMUX_PATH attach -t $1"
  31. alias tmuxl="$TMUX_PATH ls"
  32. alias tmuxq="echo $TMUX"
  33. alias httpserver="python -m SimpleHTTPServer"
  34. if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
  35. then
  36. PATH="$HOME/.local/bin:$HOME/bin:$PATH"
  37. fi
  38. export PATH
  39. # HN Helper functions
  40. # Pull up comments for number
  41. export HN_PATH=$(which hn)
  42. hnc() {
  43. if [ ! -z "$HN_PATH" ]; then
  44. hn view -c $1 | $BAT_PATH
  45. else
  46. echo "hn not in path"
  47. fi
  48. }
  49. export HIMALAYA_PATH=$(which himalaya)
  50. if [ ! -z $HIMALAYA_PATH ]; then
  51. . ~/Repos/dotfiles/himalaya/himalaya_shell_ui.sh
  52. fi
  53. # Case defines platform specific configs
  54. # Platform agnostic configs above
  55. case $(hostname) in
  56. Simons-MacBook-Pro.local)
  57. export PS1="\w λ > \[$(tput sgr0)\]"
  58. # Mac aliases
  59. alias shorten-ps1="PS1='λ > '"
  60. alias default-ps1='PS1="\w λ > \[$(tput sgr0)\]"'
  61. alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs"
  62. # PATH setups
  63. PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/swatson/.fzf/bin:/Users/swatson/Library/Python/3.8/bin'
  64. default-ps1
  65. clear
  66. echo "Loaded MacM1 config"
  67. ;;
  68. swatson-casana)
  69. export TERM=xterm-256color # This fixes some vim issues
  70. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  71. # function to set terminal title
  72. function set-title() {
  73. if [[ -z "$ORIG" ]]; then
  74. ORIG=$PS1
  75. fi
  76. TITLE="\[\e]2;$*\a\]"
  77. PS1=${ORIG}${TITLE}
  78. }
  79. alias ssh-old="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1"
  80. alias sleep-open="sudo zzz && slock"
  81. echo "Loaded Void Work Config"
  82. ;;
  83. void)
  84. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  85. alias shorten-ps1="PS1='λ > '"
  86. echo "Loaded Void config"
  87. esac