You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. #!/bin/zsh
  2. if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
  3. setopt COMBINING_CHARS
  4. fi
  5. # Disable the log builtin, so we don't conflict with /usr/bin/log
  6. disable log
  7. # Save command history
  8. HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
  9. HISTSIZE=99999999
  10. SAVEHIST=$HISTSIZE
  11. # Variables
  12. export CASE_SENSITIVE="true"
  13. export EDITOR=nvim
  14. export GIT_EDITOR=nvim
  15. export PATH="${HOME}/.local/bin/:${HOME}/go/bin:${HOME}/.cargo/bin:${PATH}"
  16. if [[ $(uname) == 'Darwin' ]]; then
  17. export HOMEBREW_NO_AUTO_UPDATE=1
  18. export PATH="/opt/homebrew/lib/ruby/gems/3.3.0:$PATH"
  19. export PATH="/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0:$PATH"
  20. eval "$(rbenv init - zsh)"
  21. fi
  22. # Auto complete case insensitive
  23. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
  24. # Load colors
  25. autoload -U colors && colors
  26. # Automatically cd into typed directory.
  27. setopt autocd
  28. # Useful support for interacting with Terminal.app or other terminal programs
  29. [ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
  30. # Load Git completion
  31. zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
  32. fpath=(~/.zsh $fpath)
  33. # vi mode
  34. bindkey -v
  35. export KEYTIMEOUT=1
  36. # Edit line in vim with ctrl-e:
  37. autoload edit-command-line; zle -N edit-command-line
  38. bindkey '^e' edit-command-line
  39. # Go up directory structures
  40. up () {
  41. cd $(printf "%0.0s../" $(seq 1 $1));
  42. }
  43. function cdf () {
  44. cd $(find . -type d -print | fzf)
  45. }
  46. # Android dev config
  47. export ANDROID_HOME="$HOME/Android/Sdk"
  48. if [[ $(uname) == 'Darwin' ]]; then
  49. export ANDROID_HOME="$HOME/Library/Android/sdk"
  50. export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
  51. fi
  52. export PATH="${PATH}:${ANDROID_HOME}/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin"
  53. export NVM_DIR="$HOME/.nvm"
  54. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  55. [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
  56. # Load external
  57. source ~/.config/aliasrc
  58. source <(fzf --zsh)
  59. eval "$(oh-my-posh init zsh --config $HOME/.config/oh-my-posh/zen.toml)"