zshrc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Lines configured by zsh-newuser-install
  2. HISTFILE=~/.histfile
  3. HISTSIZE=1000
  4. SAVEHIST=1000
  5. setopt appendhistory autocd extendedglob nomatch
  6. bindkey -e
  7. # End of lines configured by zsh-newuser-install
  8. # The following lines were added by compinstall
  9. zstyle :compinstall filename '/home/josh/.zshrc'
  10. autoload -Uz compinit
  11. compinit
  12. # End of lines added by compinstall
  13. # Use prompt colors (green for regular user, red for root)
  14. autoload -U colors && colors
  15. if [ "$(id -u)" != "0" ]; then
  16. PROMPT="%{$fg_bold[green]%}%n@%m %1~ $%{$reset_color%} "
  17. RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"
  18. else
  19. PROMPT="%{$fg_bold[red]%}%n@%m %1~ #%{$reset_color%} "
  20. RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"
  21. fi
  22. # ls pleasantness
  23. alias l='\ls --color=auto'
  24. alias ls='ls --color=auto'
  25. alias lsa='ls -a --color=auto'
  26. alias lls='ls -alh --color=auto'
  27. # apt-get aliases
  28. alias update='sudo apt-get update && sudo apt-get dist-upgrade'
  29. alias clean='sudo apt-get clean'
  30. # grep the entirety of the history
  31. alias hg='history 1 | grep'
  32. # Use vim as the default text editor
  33. export VISUAL=vim
  34. # Used to keep steam from throwing errors
  35. export SWT_GTK3=0
  36. # Home and End keysjump the the beginning/end of the command
  37. bindkey "^[OH" beginning-of-line
  38. bindkey "^[OF" end-of-line
  39. # Ctrl-Left and Ctrl-Right keys move between words
  40. bindkey ";5C" forward-word
  41. bindkey "^[[C" forward-word
  42. bindkey ";5D" backward-word
  43. bindkey "^[[D" backward-word
  44. # bind UP and DOWN arrow keys
  45. bindkey '^[[A' history-substring-search-up
  46. bindkey '^[[B' history-substring-search-down
  47. # Used for X forwarding in Cygwin
  48. if [[ "$(uname -o)" != "GNU/Linux" ]]; then
  49. DISPLAY=:1.0
  50. fi
  51. # local folder in PATH for UE4
  52. export PATH=$HOME/bin:$PATH
  53. # Flags used for CS243 "Mechanics of Programming"
  54. alias gcc='gcc -std=c99 -Wall -ggdb -Wextra -pedantic'
  55. # Functions for converting between hex and decimal
  56. h2d(){
  57. echo "ibase=16; $@"|bc
  58. }
  59. d2h(){
  60. echo "obase=16; $@"|bc
  61. }
  62. # devkitPro/devkitPPC sources
  63. export DEVKITPRO=/home/josh/devkitPro/
  64. export DEVKITPPC=/home/josh/devkitPro//devkitPPC
  65. # alias for vim muscle memory when quitting
  66. alias :q='exit'
  67. # eval used by thefuck
  68. if hash fuck 2>/dev/null; then
  69. eval $(thefuck --alias)
  70. fi
  71. # For playing raw data
  72. alias playdata='aplay -c 2 -f S16_LE -r 44100'
  73. # zsh-syntax-highlighting (MUST BE AT THE BOTTOM OF THIS FILE)
  74. source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  75. # zsh-history-substring-search (MUST BE BELOW SYNTAX HIGHLIGHTING)
  76. source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh