bashrc-all 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. # open submission in browser
  46. # Case defines platform specific configs
  47. # Platform agnostic configs above
  48. case $(hostname) in
  49. Simons-MacBook-Pro.local)
  50. export PS1="\w λ > \[$(tput sgr0)\]"
  51. # Mac aliases
  52. alias shorten-ps1="PS1='λ > '"
  53. alias default-ps1='PS1="\w λ > \[$(tput sgr0)\]"'
  54. alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs"
  55. # PATH setups
  56. 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'
  57. default-ps1
  58. clear
  59. echo "Loaded MacM1 config"
  60. ;;
  61. swatson-casana)
  62. export TERM=xterm-256color # This fixes some vim issues
  63. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  64. # function to set terminal title
  65. function set-title() {
  66. if [[ -z "$ORIG" ]]; then
  67. ORIG=$PS1
  68. fi
  69. TITLE="\[\e]2;$*\a\]"
  70. PS1=${ORIG}${TITLE}
  71. }
  72. alias ssh-old="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1"
  73. echo "Loaded Void Work Config"
  74. ;;
  75. void)
  76. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  77. alias shorten-ps1="PS1='λ > '"
  78. echo "Loaded Void config"
  79. esac