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.

103 lines
2.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
3 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. PROMPT="%{$fg[blue]%}%1~ %{$fg[green]%}>%{$reset_color%} "
  11. # Automatically cd into typed directory.
  12. setopt autocd
  13. # Useful support for interacting with Terminal.app or other terminal programs
  14. [ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
  15. # Load Git completion
  16. zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
  17. fpath=(~/.zsh $fpath)
  18. # vi mode
  19. bindkey -v
  20. export KEYTIMEOUT=1
  21. # Use vim keys in tab complete menu:
  22. bindkey -M menuselect 'h' vi-backward-char
  23. bindkey -M menuselect 'k' vi-up-line-or-history
  24. bindkey -M menuselect 'l' vi-forward-char
  25. bindkey -M menuselect 'j' vi-down-line-or-history
  26. bindkey -v '^?' backward-delete-char
  27. # Edit line in vim with ctrl-e:
  28. autoload edit-command-line; zle -N edit-command-line
  29. bindkey '^e' edit-command-line
  30. # Go up directory structures
  31. up () {
  32. cd $(printf "%0.0s../" $(seq 1 $1));
  33. }
  34. function cdv () {
  35. if [[ $(uname) == 'Darwin' ]]; then
  36. cd $(pbpaste)
  37. return
  38. fi
  39. cd $(xclip -selection clipboard -o)
  40. }
  41. function cdf () {
  42. cd $(find . -type d -print | fzf)
  43. }
  44. # Load aliases
  45. source ~/.config/aliasrc
  46. export EDITOR=nvim
  47. export GIT_EDITOR=nvim
  48. # Save command history
  49. HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
  50. HISTSIZE=99999999
  51. SAVEHIST=$HISTSIZE
  52. export PATH="~/.local/bin/:$PATH"
  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. export PHPCS_STANDARD=~/.config/phpcs.xml
  71. if [[ $(uname) == 'Darwin' ]]; then
  72. export HOMEBREW_NO_AUTO_UPDATE=1
  73. export PATH="/opt/homebrew/lib/ruby/gems/3.3.0:$PATH"
  74. export PATH="/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0:$PATH"
  75. eval "$(rbenv init - zsh)"
  76. fi