zshrc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 ";5D" backward-word
  42. # bind UP and DOWN arrow keys
  43. bindkey '^[[A' history-substring-search-up
  44. bindkey '^[[B' history-substring-search-down
  45. # Used for X forwarding in Cygwin
  46. if [[ "$(uname -o)" != "GNU/Linux" ]]; then
  47. DISPLAY=:1.0
  48. fi
  49. # local folder in PATH for UE4
  50. export PATH=$HOME/bin:$PATH
  51. # Flags used for CS243 "Mechanics of Programming"
  52. alias gcc='gcc -std=c99 -Wall -ggdb -Wextra -pedantic'
  53. # Functions for converting between hex and decimal
  54. h2d(){
  55. echo "ibase=16; $@"|bc
  56. }
  57. d2h(){
  58. echo "obase=16; $@"|bc
  59. }
  60. # devkitPro/devkitPPC sources
  61. export DEVKITPRO=/home/josh/devkitPro/
  62. export DEVKITPPC=/home/josh/devkitPro//devkitPPC
  63. # alias for vim muscle memory when quitting
  64. alias :q='exit'
  65. # eval used by thefuck
  66. if hash fuck 2>/dev/null; then
  67. eval $(thefuck --alias)
  68. fi
  69. # zsh-syntax-highlighting (MUST BE AT THE BOTTOM OF THIS FILE)
  70. source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  71. # zsh-history-substring-search (MUST BE BELOW SYNTAX HIGHLIGHTING)
  72. source ~/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh