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.

109 lines
2.7 KiB

4 years ago
4 years ago
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. export CASE_SENSITIVE="true"
  8. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
  9. # Load colors
  10. autoload -U colors && colors
  11. PROMPT="%{$fg[blue]%}%1~ %{$fg[green]%}>%{$reset_color%} "
  12. # Automatically cd into typed directory.
  13. setopt autocd
  14. # Useful support for interacting with Terminal.app or other terminal programs
  15. [ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
  16. # Load Git completion
  17. zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
  18. fpath=(~/.zsh $fpath)
  19. # vi mode
  20. bindkey -v
  21. export KEYTIMEOUT=1
  22. # Use vim keys in tab complete menu:
  23. # bindkey -M menuselect 'h' vi-backward-char
  24. # bindkey -M menuselect 'k' vi-up-line-or-history
  25. # bindkey -M menuselect 'l' vi-forward-char
  26. # bindkey -M menuselect 'j' vi-down-line-or-history
  27. # bindkey -v '^?' backward-delete-char
  28. # Edit line in vim with ctrl-e:
  29. autoload edit-command-line; zle -N edit-command-line
  30. bindkey '^e' edit-command-line
  31. # Go up directory structures
  32. up () {
  33. cd $(printf "%0.0s../" $(seq 1 $1));
  34. }
  35. function cdv () {
  36. if [[ $(uname) == 'Darwin' ]]; then
  37. cd $(pbpaste)
  38. return
  39. fi
  40. cd $(xclip -selection clipboard -o)
  41. }
  42. function cdf () {
  43. cd $(find . -type d -print | fzf)
  44. }
  45. # Load aliases
  46. source ~/.config/aliasrc
  47. export EDITOR=nvim
  48. export GIT_EDITOR=nvim
  49. # Save command history
  50. HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
  51. HISTSIZE=99999999
  52. SAVEHIST=$HISTSIZE
  53. if [[ $(uname) == 'Darwin' ]]; then
  54. fi
  55. export ANDROID_HOME="$HOME/Android/Sdk"
  56. if [[ $(uname) == 'Darwin' ]]; then
  57. export ANDROID_HOME="$HOME/Library/Android/sdk"
  58. export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
  59. fi
  60. export PATH="${PATH}:${ANDROID_HOME}/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin"
  61. # FNM variables
  62. export PATH="/run/user/1000/fnm_multishells/20590_1663546026606/bin":$PATH
  63. export FNM_MULTISHELL_PATH="/run/user/1000/fnm_multishells/20590_1663546026606"
  64. export FNM_VERSION_FILE_STRATEGY="local"
  65. export FNM_DIR="/home/tovi/.local/share/fnm"
  66. export FNM_LOGLEVEL="info"
  67. export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist"
  68. export FNM_ARCH="x64"
  69. rehash
  70. if [[ $(uname) == 'Darwin' ]]; then
  71. export HOMEBREW_NO_AUTO_UPDATE=1
  72. export PATH="/opt/homebrew/lib/ruby/gems/3.3.0:$PATH"
  73. export PATH="/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0:$PATH"
  74. eval "$(rbenv init - zsh)"
  75. fi
  76. export PATH="${HOME}/.local/bin/:${HOME}/go/bin:${HOME}/.cargo/bin:${PATH}"
  77. source <(fzf --zsh)
  78. export NVM_DIR="$HOME/.nvm"
  79. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  80. [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion