diff --git a/Configs/.zshrc b/Configs/.zshrc index 2a5926930a..6f05094af5 100644 --- a/Configs/.zshrc +++ b/Configs/.zshrc @@ -1,12 +1,84 @@ -# Oh-my-zsh installation path -ZSH=/usr/share/oh-my-zsh/ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# Set the directory we want to store zinit and plugins +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" + +# Download Zinit, if it's not there yet +if [ ! -d "$ZINIT_HOME" ]; then + mkdir -p "$(dirname $ZINIT_HOME)" + git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" +fi + +# Source/Load zinit +source "${ZINIT_HOME}/zinit.zsh" + +# Add in Powerlevel10k +zinit ice depth=1; zinit light romkatv/powerlevel10k + +# Add in zsh plugins +zinit light chrissicool/zsh-256color +zinit light zsh-users/zsh-syntax-highlighting +zinit light zsh-users/zsh-completions +zinit light zsh-users/zsh-autosuggestions + +# Add in snippets +zinit snippet OMZP::git +zinit snippet OMZP::sudo + +# Load completions +autoload -Uz compinit && compinit -# Powerlevel10k theme path -source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme +zinit cdreplay -q + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + +# History +HISTSIZE=5000 +HISTFILE=~/.zsh_history +SAVEHIST=$HISTSIZE +setopt appendhistory +setopt sharehistory +setopt hist_ignore_space +setopt hist_ignore_all_dups +setopt hist_save_no_dups +setopt hist_ignore_dups +setopt hist_find_no_dups + +# Completion styling +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*' menu no + +# Aliases +alias c='clear' # clear terminal +alias l='eza -lh --icons=auto' # long list +alias ls='eza -1 --icons=auto' # short list +alias ll='eza -lha --icons=auto --sort=name --group-directories-first' # long list all +alias ld='eza -lhD --icons=auto' # long list dirs +alias lt='eza --icons=auto --tree' # list folder as tree +alias un='$aurhelper -Rns' # uninstall package +alias up='$aurhelper -Syu' # update system/package/aur +alias pl='$aurhelper -Qs' # list installed package +alias pa='$aurhelper -Ss' # list available package +alias pc='$aurhelper -Sc' # remove unused cache +alias po='$aurhelper -Qtdq | $aurhelper -Rns -' # remove unused packages +alias vc='code' # gui code editor + +# Directory navigation shortcuts +alias ..='cd ..' +alias ...='cd ../..' +alias .3='cd ../../..' +alias .4='cd ../../../..' +alias .5='cd ../../../../..' -# List of plugins used -plugins=() -source $ZSH/oh-my-zsh.sh +# Always mkdir a path (this doesn't inhibit functionality to make a single dir) +alias mkdir='mkdir -p' # In case a command is not found, try to find the package that has it function command_not_found_handler { @@ -57,33 +129,5 @@ function in { fi } -# Helpful aliases -alias c='clear' # clear terminal -alias l='eza -lh --icons=auto' # long list -alias ls='eza -1 --icons=auto' # short list -alias ll='eza -lha --icons=auto --sort=name --group-directories-first' # long list all -alias ld='eza -lhD --icons=auto' # long list dirs -alias lt='eza --icons=auto --tree' # list folder as tree -alias un='$aurhelper -Rns' # uninstall package -alias up='$aurhelper -Syu' # update system/package/aur -alias pl='$aurhelper -Qs' # list installed package -alias pa='$aurhelper -Ss' # list available package -alias pc='$aurhelper -Sc' # remove unused cache -alias po='$aurhelper -Qtdq | $aurhelper -Rns -' # remove unused packages, also try > $aurhelper -Qqd | $aurhelper -Rsu --print - -alias vc='code' # gui code editor - -# Directory navigation shortcuts -alias ..='cd ..' -alias ...='cd ../..' -alias .3='cd ../../..' -alias .4='cd ../../../..' -alias .5='cd ../../../../..' - -# Always mkdir a path (this doesn't inhibit functionality to make a single dir) -alias mkdir='mkdir -p' - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - # Display Pokemon pokemon-colorscripts --no-title -r 1,3,6 diff --git a/Scripts/custom_hypr.lst b/Scripts/custom_hypr.lst index 869682caf9..c640410942 100644 --- a/Scripts/custom_hypr.lst +++ b/Scripts/custom_hypr.lst @@ -68,8 +68,6 @@ code # ide text editor # --------------------------------------------------- // Shell eza|zsh # file lister for zsh -oh-my-zsh-git|zsh # plugin manager for zsh -zsh-theme-powerlevel10k-git|zsh oh-my-zsh-git # theme for zsh eza|fish # file lister for fish starship|fish # customizable shell prompt fastfetch # system information fetch tool diff --git a/Scripts/restore_cfg.lst b/Scripts/restore_cfg.lst index ab4fd24938..cdd4c47c32 100644 --- a/Scripts/restore_cfg.lst +++ b/Scripts/restore_cfg.lst @@ -1,4 +1,4 @@ -N|Y|${HOME}|.zshrc .p10k.zsh|zsh oh-my-zsh-git zsh-theme-powerlevel10k pokemon-colorscripts-git +N|Y|${HOME}|.zshrc .p10k.zsh|zsh pokemon-colorscripts-git N|Y|${HOME}/.config/Code/User|settings.json|visual-studio-code-bin N|Y|${HOME}/.config/Code - OSS/User|settings.json|code N|Y|${HOME}/.config|code-flags.conf|visual-studio-code-bin diff --git a/Scripts/restore_zsh.lst b/Scripts/restore_zsh.lst deleted file mode 100644 index d564320a57..0000000000 --- a/Scripts/restore_zsh.lst +++ /dev/null @@ -1,8 +0,0 @@ -git # alias and functions for git commands -sudo # press ESC key twice to execute command with sudo prefix -#python # alias for python -#zsh-interactive-cd # press tab to change dir with fzf -https://github.com/chrissicool/zsh-256color # enhance terminal environment with 256 colors -#https://github.com/zsh-users/zsh-completions # press tab to complete command -https://github.com/zsh-users/zsh-autosuggestions # suggests commands as you type based on history -https://github.com/zsh-users/zsh-syntax-highlighting # highlights commands as you type