92 lines
2.9 KiB
Bash
92 lines
2.9 KiB
Bash
# Enable Powerlevel10k instant prompt
|
|
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
|
|
|
|
export ZSH="$HOME/.oh-my-zsh"
|
|
|
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
|
|
|
# Plugins
|
|
plugins=(
|
|
git
|
|
sudo
|
|
z
|
|
colored-man-pages
|
|
command-not-found
|
|
zsh-autosuggestions
|
|
zsh-syntax-highlighting
|
|
zsh-completions
|
|
fzf-tab
|
|
)
|
|
|
|
# History
|
|
HISTSIZE=10000
|
|
SAVEHIST=10000
|
|
HISTFILE=~/.zsh_history
|
|
setopt HIST_IGNORE_DUPS
|
|
setopt HIST_IGNORE_SPACE
|
|
setopt SHARE_HISTORY
|
|
setopt AUTO_PUSHD
|
|
setopt PUSHD_IGNORE_DUPS
|
|
|
|
# Autosuggestions
|
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#585b70"
|
|
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
# Syntax highlighting (Catppuccin Mocha) — must be after sourcing omz
|
|
ZSH_HIGHLIGHT_STYLES[command]='fg=#89b4fa,bold'
|
|
ZSH_HIGHLIGHT_STYLES[alias]='fg=#cba6f7,bold'
|
|
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#89dceb,bold'
|
|
ZSH_HIGHLIGHT_STYLES[function]='fg=#a6e3a1,bold'
|
|
ZSH_HIGHLIGHT_STYLES[path]='fg=#cdd6f4'
|
|
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#f38ba8,bold'
|
|
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#a6e3a1'
|
|
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#a6e3a1'
|
|
|
|
# Completion
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
|
zstyle ':completion:*' menu no
|
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza --color=always --icons $realpath'
|
|
zstyle ':fzf-tab:*' fzf-flags \
|
|
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8,fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc,marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8
|
|
|
|
# Aliases
|
|
alias ls='eza --color=always --icons --group-directories-first'
|
|
alias ll='eza -la --color=always --icons --group-directories-first --git'
|
|
alias lt='eza --tree --color=always --icons --level=2'
|
|
alias cat='bat --style=plain --paging=never'
|
|
alias grep='grep --color=auto'
|
|
alias cp='cp -iv'
|
|
alias mv='mv -iv'
|
|
alias rm='rm -iv'
|
|
alias mkdir='mkdir -pv'
|
|
alias ..='cd ..'
|
|
alias ...='cd ../..'
|
|
alias ....='cd ../../..'
|
|
alias update='sudo apt update && sudo apt upgrade -y'
|
|
alias cls='clear'
|
|
|
|
# Man pages via bat
|
|
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
export MANROFFOPT="-c"
|
|
|
|
# FZF (Catppuccin Mocha)
|
|
export FZF_DEFAULT_OPTS="\
|
|
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
|
|
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
|
|
--color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \
|
|
--color=selected-bg:#45475a \
|
|
--height=50% --layout=reverse --border=rounded"
|
|
|
|
export FZF_CTRL_T_OPTS="--preview 'bat --color=always --style=plain {}'"
|
|
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always --icons {}'"
|
|
|
|
[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
|
|
[ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh
|
|
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|