diff options
| -rwxr-xr-x | options.zsh | 12 | ||||
| -rwxr-xr-x | plugins-customization.zsh.bak.bak | 168 | ||||
| -rwxr-xr-x | plugins-customization.zsh.bak.bak.bak | 190 |
3 files changed, 367 insertions, 3 deletions
diff --git a/options.zsh b/options.zsh index c15444c..06dff00 100755 --- a/options.zsh +++ b/options.zsh @@ -27,10 +27,14 @@ zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath' # switch group using `,` and `.` zstyle ':fzf-tab:*' switch-group ',' '.' +# zinit plugins +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" + # History -#HISTFILE="$XDG_CACHE_HOME/zsh/.zhistory" -#HISTSIZE=10000 -#SAVEHIST=10000 +HISTSIZE=999999999 +SAVEHIST=$HISTSIZE +HISTFILE=~/.zsh_history +HISTDUP=erase # Autosuggestion ZSH_AUTOSUGGEST_USE_ASYNC="true" @@ -63,6 +67,8 @@ HIST_IGNORE_SPACE HIST_NO_FUNCTIONS HIST_EXPIRE_DUPS_FIRST HIST_SAVE_NO_DUPS +HIST_FIND_NO_DUPS +HIST_IGNORE_DUPS HIST_REDUCE_BLANKS EOF diff --git a/plugins-customization.zsh.bak.bak b/plugins-customization.zsh.bak.bak new file mode 100755 index 0000000..6117ba6 --- /dev/null +++ b/plugins-customization.zsh.bak.bak @@ -0,0 +1,168 @@ +## +## Plugins +## + +# zinit plugin manager +#ZINIT_HOME="${ZINIT_HOME:-${XDG_DATA_HOME:-${HOME}/.local/share}/zinit}" +#source "${ZINIT_HOME}/zinit.git/zinit.zsh" + +# zinit plugins +#zinit ice wait'3' lucid +#zinit light zsh-users/zsh-history-substring-search + +#zinit ice wait'2' lucid +#zinit light zdharma-continuum/history-search-multi-word + +# FZF +#zinit ice from"gh-r" as"command" +#zinit light junegunn/fzf-bin + +# EXA +#zinit ice wait lucid from"gh-r" as"program" mv"bin/exa* -> exa" +#zinit light ogham/exa + +# BAT +#zinit ice wait lucid from"gh-r" as"program" mv"*/bat -> bat" atload"export BAT_THEME='Nord'" +#zinit light sharkdp/bat + +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust \ + romkatv/powerlevel10k \ + zsh-users/zsh-syntax-highlighting \ + zsh-users/zsh-completions \ + zsh-users/zsh-autosuggestions \ + +autoload -U compinit && compinit -u + + +ENABLE_CORRECTION="true" + +COMPLETION_WAITING_DOTS="true" + +zshcache_time="$(date +%s%N)" + +add-zsh-hook -Uz precmd rehash_precmd + +# You can manually run `z4h update` to update everything. +#zstyle ':z4h:' auto-update 'no' +# Ask whether to auto-update this often; has no effect if auto-update is 'no'. +#zstyle ':z4h:' auto-update-days '28' + +# Keyboard type: 'mac' or 'pc'. +#zstyle ':z4h:bindkey' keyboard 'pc' + +# Don't start tmux. +#zstyle ':z4h:' start-tmux no + +# Mark up shell's output with semantic information. +#zstyle ':z4h:' term-shell-integration 'yes' + +# Right-arrow key accepts one character ('partial-accept') from +# command autosuggestions or the whole thing ('accept')? +#zstyle ':z4h:autosuggestions' forward-char 'accept' + +# Recursively traverse directories when TAB-completing files. +#zstyle ':z4h:fzf-complete' recurse-dirs 'no' + +# Enable direnv to automatically source .envrc files. +#zstyle ':z4h:direnv' enable 'no' +# Show "loading" and "unloading" notifications from direnv. +#zstyle ':z4h:direnv:success' notify 'yes' + +# Enable ('yes') or disable ('no') automatic teleportation of z4h over +# SSH when connecting to these hosts. +#zstyle ':z4h:ssh:example-hostname1' enable 'yes' +#zstyle ':z4h:ssh:*.example-hostname2' enable 'no' +# The default value if none of the overrides above match the hostname. +#zstyle ':z4h:ssh:*' suspend enable 'no' + +# Send these files over to the remote host when connecting over SSH to the +# enabled hosts. +#zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh' + +# Clone additional Git repositories from GitHub. +# +# This doesn't do anything apart from cloning the repository and keeping it +# up-to-date. Cloned files can be used after `z4h init`. This is just an +# example. If you don't plan to use Oh My Zsh, delete this line. +#z4h install ohmyzsh/ohmyzsh || return + +# Install or update core components (fzf, zsh-autosuggestions, etc.) and +# initialize Zsh. After this point console I/O is unavailable until Zsh +# is fully initialized. Everything that requires user interaction or can +# perform network I/O must be done above. Everything else is best done below. +#z4h init || return + +# thefuck +#eval $(thefuck --alias) + +# autojump +#source $HOME/.autojump/etc/profile.d/autojump.sh + +# homebrew +# [ -d /home/linuxbrew/.linuxbrew ] && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) +# eval "$(/usr/local/linuxbrew/bin/brew shellenv)" +eval "$(/opt/homebrew/bin/brew shellenv)" + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +#__conda_setup="$('/mnt/DATA/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +#if [ $? -eq 0 ]; then +# eval "$__conda_setup" +#else +# if [ -f "/mnt/DATA/anaconda3/etc/profile.d/conda.sh" ]; then +# . "/mnt/DATA/anaconda3/etc/profile.d/conda.sh" +# else +# export PATH="/mnt/DATA/anaconda3/bin:$PATH" +# fi +#fi +#unset __conda_setup +# <<< conda initialize <<< + + +# ngrok +#eval "$(/usr/bin/ngrok completion)" # no use + +autoload -Uz add-zsh-hook + +rehash_precmd() { + if [[ -a /var/cache/zsh/pacman ]]; then + local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" + if (( zshcache_time < paccache_time )); then + rehash + zshcache_time="$paccache_time" + fi + fi +} + +# so omz plugin works properly +#source $ZSH/custom/plugins/zsh-autosuggestions/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +#source $ZSH/custom/plugins/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh +#source $ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh +#source $ZSH/custom/plugins/sudo/sudo.plugin.zsh +#source $ZSH/custom/plugins/web-search/web-search.plugin.zsh +#source $ZSH/custom/plugins/copybuffer/copybuffer.plugin.zsh +#source $ZSH/custom/plugins/dirhistory/dirhistory.plugin.zsh + +#source /usr/share/nvm/init-nvm.sh + +# nix +if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer +eval "$(zoxide init zsh --cmd cd)" diff --git a/plugins-customization.zsh.bak.bak.bak b/plugins-customization.zsh.bak.bak.bak new file mode 100755 index 0000000..6a68bd1 --- /dev/null +++ b/plugins-customization.zsh.bak.bak.bak @@ -0,0 +1,190 @@ +## +## Plugins +## + +# zinit plugin manager +#ZINIT_HOME="${ZINIT_HOME:-${XDG_DATA_HOME:-${HOME}/.local/share}/zinit}" +#source "${ZINIT_HOME}/zinit.git/zinit.zsh" + +# zinit plugins +#zinit ice wait'3' lucid +#zinit light zsh-users/zsh-history-substring-search + +#zinit ice wait'2' lucid +#zinit light zdharma-continuum/history-search-multi-word + +# FZF +#zinit ice from"gh-r" as"command" +#zinit light junegunn/fzf-bin + +# EXA +#zinit ice wait lucid from"gh-r" as"program" mv"bin/exa* -> exa" +#zinit light ogham/exa + +# BAT +#zinit ice wait lucid from"gh-r" as"program" mv"*/bat -> bat" atload"export BAT_THEME='Nord'" +#zinit light sharkdp/bat + +plugins=( + #git + #zsh-cwd-history + zsh-autosuggestions + #zsh-autocomplete + zsh-history-substring-search + zsh-syntax-highlighting + sudo + web-search + copybuffer + dirhistory + #fzf-tab +) + +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# source ~/.oh-my-zsh/oh-my-zsh.sh + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust \ + zsh-users/zsh-syntax-highlighting \ + zsh-users/zsh-completions \ + zsh-users/zsh-autosuggestions \ + zsh-users/zsh-history-substring-search \ + +# marlonrichert/zsh-autocomplete \ +# ericfreese/zsh-cwd-history \ + + + + +zinit snippet OMZP::git +zinit snippet OMZP::sudo +zinit snippet OMZP::copybuffer +zinit snippet OMZP::dirhistory + +autoload -U compinit && compinit -u + +ENABLE_CORRECTION="true" + +COMPLETION_WAITING_DOTS="true" + +# You can manually run `z4h update` to update everything. +#zstyle ':z4h:' auto-update 'no' +# Ask whether to auto-update this often; has no effect if auto-update is 'no'. +#zstyle ':z4h:' auto-update-days '28' + +# Keyboard type: 'mac' or 'pc'. +#zstyle ':z4h:bindkey' keyboard 'pc' + +# Don't start tmux. +#zstyle ':z4h:' start-tmux no + +# Mark up shell's output with semantic information. +#zstyle ':z4h:' term-shell-integration 'yes' + +# Right-arrow key accepts one character ('partial-accept') from +# command autosuggestions or the whole thing ('accept')? +#zstyle ':z4h:autosuggestions' forward-char 'accept' + +# Recursively traverse directories when TAB-completing files. +#zstyle ':z4h:fzf-complete' recurse-dirs 'no' + +# Enable direnv to automatically source .envrc files. +#zstyle ':z4h:direnv' enable 'no' +# Show "loading" and "unloading" notifications from direnv. +#zstyle ':z4h:direnv:success' notify 'yes' + +# Enable ('yes') or disable ('no') automatic teleportation of z4h over +# SSH when connecting to these hosts. +#zstyle ':z4h:ssh:example-hostname1' enable 'yes' +#zstyle ':z4h:ssh:*.example-hostname2' enable 'no' +# The default value if none of the overrides above match the hostname. +#zstyle ':z4h:ssh:*' suspend enable 'no' + +# Send these files over to the remote host when connecting over SSH to the +# enabled hosts. +#zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh' + +# Clone additional Git repositories from GitHub. +# +# This doesn't do anything apart from cloning the repository and keeping it +# up-to-date. Cloned files can be used after `z4h init`. This is just an +# example. If you don't plan to use Oh My Zsh, delete this line. +#z4h install ohmyzsh/ohmyzsh || return + +# Install or update core components (fzf, zsh-autosuggestions, etc.) and +# initialize Zsh. After this point console I/O is unavailable until Zsh +# is fully initialized. Everything that requires user interaction or can +# perform network I/O must be done above. Everything else is best done below. +#z4h init || return + +# thefuck +#eval $(thefuck --alias) + +# autojump +#source $HOME/.autojump/etc/profile.d/autojump.sh + +# homebrew +# [ -d /home/linuxbrew/.linuxbrew ] && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) +# eval "$(/usr/local/linuxbrew/bin/brew shellenv)" +eval "$(/opt/homebrew/bin/brew shellenv)" + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +#__conda_setup="$('/mnt/DATA/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +#if [ $? -eq 0 ]; then +# eval "$__conda_setup" +#else +# if [ -f "/mnt/DATA/anaconda3/etc/profile.d/conda.sh" ]; then +# . "/mnt/DATA/anaconda3/etc/profile.d/conda.sh" +# else +# export PATH="/mnt/DATA/anaconda3/bin:$PATH" +# fi +#fi +#unset __conda_setup +# <<< conda initialize <<< + + +# ngrok +#eval "$(/usr/bin/ngrok completion)" # no use + +autoload -Uz add-zsh-hook + +rehash_precmd() { + if [[ -a /var/cache/zsh/pacman ]]; then + local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" + if (( zshcache_time < paccache_time )); then + rehash + zshcache_time="$paccache_time" + fi + fi +} + +# so omz plugin works properly +#source $ZSH/custom/plugins/zsh-autosuggestions/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +#source $ZSH/custom/plugins/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh +#source $ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh +#source $ZSH/custom/plugins/sudo/sudo.plugin.zsh +#source $ZSH/custom/plugins/web-search/web-search.plugin.zsh +#source $ZSH/custom/plugins/copybuffer/copybuffer.plugin.zsh +#source $ZSH/custom/plugins/dirhistory/dirhistory.plugin.zsh + +#source /usr/share/nvm/init-nvm.sh + +# nix +if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer +eval "$(zoxide init zsh --cmd cd)" |
