Remove omz, go to p10k over starship, add lots of fzf stuff, change from zap to zinit and more stuff, this was based on the config from Dreams of Autonomy
This commit is contained in:
parent
34515f29df
commit
5d824ff6a7
1 changed files with 85 additions and 26 deletions
111
home/.zshrc
111
home/.zshrc
|
|
@ -1,17 +1,53 @@
|
||||||
# Created by Zap installer
|
# Display neofetch on shell startup (make sure to run this before p10k instant prompt)
|
||||||
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
|
fastfetch
|
||||||
plug "zsh-users/zsh-autosuggestions"
|
|
||||||
plug "zap-zsh/supercharge"
|
|
||||||
plug "zap-zsh/zap-prompt"
|
|
||||||
plug "zsh-users/zsh-syntax-highlighting"
|
|
||||||
plug "jeffreytse/zsh-vi-mode"
|
|
||||||
|
|
||||||
# Load and initialise completion system
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||||
autoload -Uz compinit
|
# Initialization code that may require console input (password prompts, [y/n]
|
||||||
compinit
|
# 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
|
||||||
|
|
||||||
# Neovim
|
# Make homebrew installed packages available in the path on macOS
|
||||||
export PATH=$HOME/local/nvim/bin:$PATH
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Paths
|
||||||
|
export PATH=$HOME/.local/nvim/bin:$PATH # Nightly neovim
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Load Zinit
|
||||||
|
source "${ZINIT_HOME}/zinit.zsh"
|
||||||
|
|
||||||
|
# Add powerlevel10k prompt
|
||||||
|
zinit ice depth=1; zinit light romkatv/powerlevel10k
|
||||||
|
|
||||||
|
# Add in zsh plugins
|
||||||
|
zinit light zsh-users/zsh-syntax-highlighting
|
||||||
|
zinit light zsh-users/zsh-completions
|
||||||
|
zinit light zsh-users/zsh-autosuggestions
|
||||||
|
zinit light jeffreytse/zsh-vi-mode
|
||||||
|
zinit light Aloxaf/fzf-tab
|
||||||
|
|
||||||
|
# Add snippets
|
||||||
|
zinit snippet OMZP::git
|
||||||
|
zinit snippet OMZP::sudo
|
||||||
|
zinit snippet OMZP::archlinux
|
||||||
|
zinit snippet OMZP::command-not-found
|
||||||
|
|
||||||
|
# Load zsh-completions
|
||||||
|
autoload -U compinit && compinit
|
||||||
|
|
||||||
|
zinit cdreplay -q
|
||||||
|
|
||||||
# Catppuccin for zsh-syntax-highlighting
|
# Catppuccin for zsh-syntax-highlighting
|
||||||
source ~/.zsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh
|
source ~/.zsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh
|
||||||
|
|
@ -20,33 +56,56 @@ export FZF_DEFAULT_OPTS=" \
|
||||||
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
|
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
|
||||||
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
|
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
|
||||||
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
|
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
|
||||||
# Make sure to use the nightly version of Neovim in user space (still running pacman install as root)
|
|
||||||
export PATH="$HOME/.local/nvim/bin:$PATH"
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||||
|
|
||||||
|
# History settings
|
||||||
|
HISTFILE=~/.zsh_history
|
||||||
|
HISTSIZE=5000
|
||||||
|
SAVEHIST=$HISTSIZE
|
||||||
|
HISTDUP=erase
|
||||||
|
setopt appendhistory
|
||||||
|
setopt sharehistory
|
||||||
|
setopt hist_ignore_space
|
||||||
|
setopt hist_ignore_all_dups
|
||||||
|
setopt hist_ignore_dups
|
||||||
|
setopt hist_save_no_dups
|
||||||
|
setopt hist_find_no_dups
|
||||||
|
|
||||||
|
# Keybindings
|
||||||
|
bindkey '^p' history-search-backward
|
||||||
|
bindkey '^n' history-search-forward
|
||||||
|
bindkey '^[[A' history-search-backward
|
||||||
|
bindkey '^[[B' history-search-forward
|
||||||
|
|
||||||
|
# Completion styling
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{z-z}={A-Za-z}'
|
||||||
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||||
|
zstyle ':completion:*' menu no
|
||||||
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
||||||
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
## Eza
|
alias vim="nvim"
|
||||||
|
alias c="clear"
|
||||||
|
alias s="source"
|
||||||
|
alias sz="source ~/.zshrc"
|
||||||
alias ls="eza -a"
|
alias ls="eza -a"
|
||||||
alias ll="eza --long --header -a"
|
alias ll="eza --long --header -a"
|
||||||
alias tree="eza --tree --level=2"
|
alias tree="eza --tree --level=2"
|
||||||
## Neovim
|
|
||||||
alias vim="nvim"
|
|
||||||
## Lazygit
|
|
||||||
alias lgit="lazygit"
|
alias lgit="lazygit"
|
||||||
## Fastfetch
|
|
||||||
alias neofetch="fastfetch"
|
alias neofetch="fastfetch"
|
||||||
## Bat
|
|
||||||
alias cat="bat"
|
alias cat="bat"
|
||||||
## fzf
|
|
||||||
alias fzf='fzf --preview "bat --color=always --style=numbers --line-range=:500 {}"'
|
alias fzf='fzf --preview "bat --color=always --style=numbers --line-range=:500 {}"'
|
||||||
## wl-copy
|
|
||||||
alias wlc="wl-copy"
|
alias wlc="wl-copy"
|
||||||
alias wlp="wl-paste"
|
alias wlp="wl-paste"
|
||||||
|
|
||||||
eval "$(zoxide init zsh --cmd cd)"
|
# Shell integration
|
||||||
eval "$(starship init zsh)"
|
eval "$(fzf --zsh)"
|
||||||
|
eval "$(zoxide init --cmd cd zsh)"
|
||||||
fastfetch
|
|
||||||
|
|
||||||
|
# Make sure that zellij isn't recursively started on shell startup
|
||||||
if [[ -z $ZELLIJ ]]; then
|
if [[ -z $ZELLIJ ]]; then
|
||||||
zellij
|
zellij
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue