bashrc-all 2.2 KB

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