Advertisement
Guest User

Untitled

a guest
Jan 1st, 2025
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.33 KB | None | 0 0
  1. # If you come from bash you might have to change your $PATH.
  2. # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
  3.  
  4. # Path to your Oh My Zsh installation.
  5. export ZSH="$HOME/.oh-my-zsh"
  6.  
  7. # Set name of the theme to load --- if set to "random", it will
  8. # load a random theme each time Oh My Zsh is loaded, in which case,
  9. # to know which specific one was loaded, run: echo $RANDOM_THEME
  10. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  11. ZSH_THEME="robbyrussell"
  12.  
  13. # Set list of themes to pick from when loading at random
  14. # Setting this variable when ZSH_THEME=random will cause zsh to load
  15. # a theme from this variable instead of looking in $ZSH/themes/
  16. # If set to an empty array, this variable will have no effect.
  17. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  18.  
  19. # Uncomment the following line to use case-sensitive completion.
  20. # CASE_SENSITIVE="true"
  21.  
  22. # Uncomment the following line to use hyphen-insensitive completion.
  23. # Case-sensitive completion must be off. _ and - will be interchangeable.
  24. # HYPHEN_INSENSITIVE="true"
  25.  
  26. # Uncomment one of the following lines to change the auto-update behavior
  27. # zstyle ':omz:update' mode disabled  # disable automatic updates
  28. # zstyle ':omz:update' mode auto      # update automatically without asking
  29. # zstyle ':omz:update' mode reminder  # just remind me to update when it's time
  30.  
  31. # Uncomment the following line to change how often to auto-update (in days).
  32. # zstyle ':omz:update' frequency 13
  33.  
  34. # Uncomment the following line if pasting URLs and other text is messed up.
  35. # DISABLE_MAGIC_FUNCTIONS="true"
  36.  
  37. # Uncomment the following line to disable colors in ls.
  38. # DISABLE_LS_COLORS="true"
  39.  
  40. # Uncomment the following line to disable auto-setting terminal title.
  41. # DISABLE_AUTO_TITLE="true"
  42.  
  43. # Uncomment the following line to enable command auto-correction.
  44. # ENABLE_CORRECTION="true"
  45.  
  46. # Uncomment the following line to display red dots whilst waiting for completion.
  47. # You can also set it to another string to have that shown instead of the default red dots.
  48. # e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
  49. # Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
  50. # COMPLETION_WAITING_DOTS="true"
  51.  
  52. # Uncomment the following line if you want to disable marking untracked files
  53. # under VCS as dirty. This makes repository status check for large repositories
  54. # much, much faster.
  55. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  56.  
  57. # Uncomment the following line if you want to change the command execution time
  58. # stamp shown in the history command output.
  59. # You can set one of the optional three formats:
  60. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  61. # or set a custom format using the strftime function format specifications,
  62. # see 'man strftime' for details.
  63. # HIST_STAMPS="mm/dd/yyyy"
  64.  
  65. # Would you like to use another custom folder than $ZSH/custom?
  66. # ZSH_CUSTOM=/path/to/new-custom-folder
  67.  
  68. # Which plugins would you like to load?
  69. # Standard plugins can be found in $ZSH/plugins/
  70. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  71. # Example format: plugins=(rails git textmate ruby lighthouse)
  72. # Add wisely, as too many plugins slow down shell startup.
  73. plugins=(git zsh-fzf-history-search)
  74.  
  75. source $ZSH/oh-my-zsh.sh
  76.  
  77. # User configuration
  78.  
  79. # export MANPATH="/usr/local/man:$MANPATH"
  80.  
  81. # You may need to manually set your language environment
  82. # export LANG=en_US.UTF-8
  83.  
  84. # Preferred editor for local and remote sessions
  85. # if [[ -n $SSH_CONNECTION ]]; then
  86. #   export EDITOR='vim'
  87. # else
  88. #   export EDITOR='mvim'
  89. # fi
  90.  
  91. # Compilation flags
  92. # export ARCHFLAGS="-arch $(uname -m)"
  93.  
  94. # Set personal aliases, overriding those provided by Oh My Zsh libs,
  95. # plugins, and themes. Aliases can be placed here, though Oh My Zsh
  96. # users are encouraged to define aliases within a top-level file in
  97. # the $ZSH_CUSTOM folder, with .zsh extension. Examples:
  98. # - $ZSH_CUSTOM/aliases.zsh
  99. # - $ZSH_CUSTOM/macos.zsh
  100. # For a full list of active aliases, run `alias`.
  101. #
  102. # Example aliases
  103. # alias zshconfig="mate ~/.zshrc"
  104. # alias ohmyzsh="mate ~/.oh-my-zsh"
  105.  
  106. # NVM_DIR
  107.   export NVM_DIR="$HOME/.nvm"
  108.   [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  109.   [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion
  110.  
  111. # pnpm
  112. export PNPM_HOME="/Users/haithammaryan/Library/pnpm"
  113. case ":$PATH:" in
  114.   *":$PNPM_HOME:"*) ;;
  115.   *) export PATH="$PNPM_HOME:$PATH" ;;
  116. esac
  117. # pnpm end
  118. export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
  119. export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
  120.  
  121. # zsh-fzf-history-search
  122. zinit ice lucid wait'0'
  123. zinit light joshskidmore/zsh-fzf-history-search
  124.  
  125. ### Added by Zinit's installer
  126. if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
  127.     print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
  128.     command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
  129.     command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
  130.         print -P "%F{33} %F{34}Installation successful.%f%b" || \
  131.         print -P "%F{160} The clone has failed.%f%b"
  132. fi
  133.  
  134. source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
  135. autoload -Uz _zinit
  136. (( ${+_comps} )) && _comps[zinit]=_zinit
  137. ### End of Zinit's installer chunk
  138.  
  139. # Created by `pipx` on 2024-08-12 16:26:15
  140. export PATH="$PATH:/Users/haithammaryan/.local/bin"
  141.  
  142. # bun completions
  143. [ -s "/Users/haithammaryan/.bun/_bun" ] && source "/Users/haithammaryan/.bun/_bun"
  144.  
  145. # bun
  146. export BUN_INSTALL="$HOME/.bun"
  147. export PATH="$BUN_INSTALL/bin:$PATH"
  148.  
  149.  
  150. # =============================================================================
  151. #
  152. # Utility functions for zoxide.
  153. #
  154.  
  155. # pwd based on the value of _ZO_RESOLVE_SYMLINKS.
  156. function __zoxide_pwd() {
  157.     \builtin pwd -L
  158. }
  159.  
  160. # cd + custom logic based on the value of _ZO_ECHO.
  161. function __zoxide_cd() {
  162.     # shellcheck disable=SC2164
  163.     \builtin cd -- "$@"
  164. }
  165.  
  166. # =============================================================================
  167. #
  168. # Hook configuration for zoxide.
  169. #
  170.  
  171. # Hook to add new entries to the database.
  172. function __zoxide_hook() {
  173.     # shellcheck disable=SC2312
  174.     \command zoxide add -- "$(__zoxide_pwd)"
  175. }
  176.  
  177. # Initialize hook.
  178. # shellcheck disable=SC2154
  179. if [[ ${precmd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]] && [[ ${chpwd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]]; then
  180.     chpwd_functions+=(__zoxide_hook)
  181. fi
  182.  
  183. # =============================================================================
  184. #
  185. # When using zoxide with --no-cmd, alias these internal functions as desired.
  186. #
  187.  
  188. # Jump to a directory using only keywords.
  189. function __zoxide_z() {
  190.     # shellcheck disable=SC2199
  191.     if [[ "$#" -eq 0 ]]; then
  192.         __zoxide_cd ~
  193.     elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
  194.         __zoxide_cd "$1"
  195.     elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then
  196.         __zoxide_cd "$2"
  197.     else
  198.         \builtin local result
  199.         # shellcheck disable=SC2312
  200.         result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" && __zoxide_cd "${result}"
  201.    fi
  202. }
  203.  
  204. # Jump to a directory using interactive search.
  205. function __zoxide_zi() {
  206.    \builtin local result
  207.    result="$(\command zoxide query --interactive -- "$@")" && __zoxide_cd "${result}"
  208. }
  209.  
  210. # =============================================================================
  211. #
  212. # Commands for zoxide. Disable these using --no-cmd.
  213. #
  214.  
  215. function z() {
  216.    __zoxide_z "$@"
  217. }
  218.  
  219. function zi() {
  220.    __zoxide_zi "$@"
  221. }
  222.  
  223. # Completions.
  224. if [[ -o zle ]]; then
  225.    __zoxide_result=''
  226.  
  227.    function __zoxide_z_complete() {
  228.        # Only show completions when the cursor is at the end of the line.
  229.        # shellcheck disable=SC2154
  230.        [[ "${#words[@]}" -eq "${CURRENT}" ]] || return 0
  231.  
  232.        if [[ "${#words[@]}" -eq 2 ]]; then
  233.            # Show completions for local directories.
  234.            _cd -/
  235.  
  236.        elif [[ "${words[-1]}" == '' ]]; then
  237.            # Show completions for Space-Tab.
  238.            # shellcheck disable=SC2086
  239.            __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \builtin true)" --interactive -- ${words[2,-1]})" || __zoxide_result=''
  240.  
  241.            # Set a result to ensure completion doesn't re-run
  242.            compadd -Q ""
  243.  
  244.            # Bind '\e[0n' to helper function.
  245.            \builtin bindkey '\e[0n' '__zoxide_z_complete_helper'
  246.            # Sends query device status code, which results in a '\e[0n' being sent to console input.
  247.            \builtin printf '\e[5n'
  248.  
  249.            # Report that the completion was successful, so that we don't fall back
  250.            # to another completion function.
  251.            return 0
  252.        fi
  253.    }
  254.  
  255.    function __zoxide_z_complete_helper() {
  256.        if [[ -n "${__zoxide_result}" ]]; then
  257.            # shellcheck disable=SC2034,SC2296
  258.            BUFFER="z ${(q-)__zoxide_result}"
  259.            __zoxide_result=''
  260.            \builtin zle reset-prompt
  261.            \builtin zle accept-line
  262.        else
  263.            \builtin zle reset-prompt
  264.        fi
  265.    }
  266.    \builtin zle -N __zoxide_z_complete_helper
  267.  
  268.    [[ "${+functions[compdef]}" -ne 0 ]] && \compdef __zoxide_z_complete z
  269. fi
  270. eval "$(rbenv init -)"
  271.  
  272.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement