.zshrc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. bindkey -v # activate vi mode
  2. setopt prompt_subst # needs to be on so I can get the time updated on each recalculation of the prompt
  3. setopt cdablevars # be able to cd to strings contained in variables
  4. setopt histignorespace # if a command starts with a space, it is not added to the history
  5. setopt ignoreeof # do not exit with Ctrl-D
  6. setopt autopushd pushdminus pushdsilent pushdtohome # pushes the current directory to the directory stack
  7. setopt noauto_remove_slash
  8. DIRSTACKSIZE=10 # maximum amount of items in the directory stack
  9. HISTSIZE=10000
  10. SAVEHIST=10000
  11. HISTFILE=~/.zsh_history
  12. # escaped color codes
  13. TURQUOISE=""
  14. GREEN=""
  15. WHITE=""
  16. RED="" # I'd prefer a lighter shade of red, but whatever
  17. # functions
  18. get_git_branch() {
  19. git branch --list 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ ($RED\1$WHITE)/"
  20. }
  21. PS1='[$GREEN${$(date -d now +'%H:%M:%S')}$WHITE] ${PWD##}${$(get_git_branch)} $ '
  22. bindkey -a k history-beginning-search-backward
  23. bindkey -a j history-beginning-search-forward
  24. alias c=clear
  25. alias q=exit
  26. alias :q=exit
  27. alias d="dirs -v" # print recently visited directories
  28. alias dup="foot & disown"
  29. alias ls="ls --color"
  30. alias la="ls -la --color"
  31. alias lah="ls -lah --color"
  32. alias grep="grep --color"
  33. alias vopenscad="~/scripts/vim-openscad.sh"
  34. alias vpov="~/scripts/vim-povray.sh"
  35. alias tags="ctags -R --exclude=.git --exclude=node_modules"
  36. # Custom autocomplete commands
  37. #completion::complete:dvips:option-o-1:files
  38. #compdef dd=less
  39. export torgglercom="~/suticlients/torgglercom/web/app/theme/chimica"
  40. # Stuff for work
  41. # Node version management
  42. export NVM_DIR="$HOME/.nvm"
  43. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"