aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.p10k.zsh4
-rw-r--r--.zshrc102
2 files changed, 63 insertions, 43 deletions
diff --git a/.p10k.zsh b/.p10k.zsh
index 8530266..fcab5ab 100644
--- a/.p10k.zsh
+++ b/.p10k.zsh
@@ -62,10 +62,10 @@
# Right prompt segments.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
- # command_execution_time # previous command duration
+ command_execution_time # previous command duration
# virtualenv # python virtual environment
# context # user@host
- # time # current time
+ time # current time
# =========================[ Line #2 ]=========================
# newline # \n
)
diff --git a/.zshrc b/.zshrc
index a3ebfd4..91c2d40 100644
--- a/.zshrc
+++ b/.zshrc
@@ -1,74 +1,94 @@
-typeset -g ZSHRC_START=$(date +%s%3N)
+fastfetch
+
+# Instant prompt (must stay near top)
-source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
- source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
+ source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
-fastfetch
-setopt interactivecomments
+# Environment
-eval `ssh-agent`
-export PATH="$PATH:/home/spelis/.local/bin"
-export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
-
-HISTFILE=~/.histfile
-HISTSIZE=100000
-SAVEHIST=100000
-export DEBUGINFOD_URLS="https://debuginfod.archlinux.org"
+export PATH="$PATH:$HOME/.local/bin"
-export SUDO_EDITOR="nvim"
export EDITOR="nvim"
+export SUDO_EDITOR="nvim"
-autoload add-zsh-hook
+export DEBUGINFOD_URLS="https://debuginfod.archlinux.org"
+HISTFILE="$HOME/.histfile"
+HISTSIZE=100000
+SAVEHIST=100000
+
+setopt interactivecomments
bindkey -e
-export PATH=$PATH:/home/elis/.local/bin
+# Programs
+
+# Use systemd/user-managed ssh-agent socket
+export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
-alias \
- yoink='yay -S' \
- yeet='yay -R' \
- x='exit' \
- cls='clear' \
- ls='eza -lh --group-directories-first --color=always --git --icons=auto' \
- tree='ls -T' \
- sudo='sudo -E' \
- cd='z'
+# Completion
autoload -Uz compinit
compinit
+
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes
-source <(fzf --zsh)
-# setopt extendedglob
+zstyle ':completion:*' completer \
+ _complete \
+ _ignored \
+ _approximate \
+ _list \
+ _match \
+ _prefix
-# source "$HOME/.sdkman/bin/sdkman-init.sh"
+zstyle ':completion:*' matcher-list \
+ 'm:{a-z}={A-Z}' \
+ 'm:{A-Z}={a-z}'
+
+zstyle ':completion:*' max-errors 3 prompt 'Errors: %e'
+zstyle ':completion:*' menu select=long-list select
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path ~/.zsh/cache
+zstyle ':completion:*' auto-description 'specify: %d'
+zstyle ':completion:*' accept-exact '*(N)'
+
+# Plugins
+
+source <(fzf --zsh)
eval "$(zoxide init zsh)"
+
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-zstyle ':completion:*' completer _complete _ignored _approximate _list _match _prefix
-zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'm:{A-Z}={a-z}'
-zstyle ':completion:*' max-errors 3 prompt 'Errors: %e'
-zstyle ':completion:*' menu select=long-list select
-zstyle ':completion:*' use-cache on cache-path ~/.zsh/cache
-zstyle ':completion:*' auto-description 'specify: %d' verbose yes accept-exact '*(N)'
+# Aliases
+
+alias yoink='yay -S'
+alias yeet='yay -R'
+alias x='exit'
+alias cls='clear'
+
+alias ls='eza -lh --group-directories-first --color=always --git --icons=auto'
+alias tree='eza -T -lh --group-directories-first --git --icons=auto'
+
+alias sudo='sudo -E'
+alias cd='z'
+
+# Functions
mkcd() {
mkdir -p "$1" && cd "$1"
}
-function command_title() {
- printf '\033]0;%s\007' "$1"
+command_title() {
+ printf '\033]0;%s\007' "$1"
}
+autoload -Uz add-zsh-hook
add-zsh-hook preexec command_title
-source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
+# Prompt
-typeset -g ZSHRC_END=$(date +%s%3N)
-echo ".zshrc load time: $((ZSHRC_END - ZSHRC_START)) ms"
+source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
-# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
-[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
+[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh