Commit 23c64c0
Changed files (9)
.config
.oh-my-zsh
custom
themes
.config/zsh/aliases.zsh
@@ -4,6 +4,7 @@ alias la="ls -a"
alias vim="nvim"
alias ccat="bat --color=always"
alias decompress="tar -xf"
+alias grep='rg'
if command -v eza &> /dev/null; then
alias ls='eza -lah --group-directories-first --icons=auto --no-user --no-filesize --no-permissions --time-style=long-iso'
@@ -45,7 +46,7 @@ sync-config() {
ff() {
local files
files=$(fzf --layout=reverse --multi --preview="bat --color=always {}" --exit-0) || return
- [ -n "$files" ] && vim "${(@f)files}"
+ [ -n "$files" ] && "$EDITOR" "${(@f)files}"
}
#--------------------------------------------------------------------------------
.config/zsh/exports.zsh
@@ -1,6 +1,5 @@
export DEV="$HOME/dev"
-export ZSH="$HOME/.oh-my-zsh"
export EDITOR='nvim'
export FZF_DEFAULT_OPTS="--layout=reverse --height=40%"
export WRAITH_BIN="$HOME/.wraith/bin"
-export PATH="$PATH:$WRAITH_BIN"
\ No newline at end of file
+export PATH="$PATH:$WRAITH_BIN"
.config/zsh/init.zsh
@@ -1,5 +1,20 @@
-eval "$(zoxide init --cmd cd zsh)"
+# Completions
+autoload -Uz compinit
+compinit
+autoload -U +X bashcompinit && bashcompinit
+zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
+zstyle ':completion:*' menu select
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
+zstyle ':completion:*' special-dirs true
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path ~/.cache/zsh_cache
+
+# Prompts
+autoload -U colors && colors
+PROMPT='%{${fg_bold[blue]}%}%{$fg_bold[green]%}%{$fg[cyan]%}%c%{$fg_bold[red]%} ➜%{$fg_bold[blue]%} % %{$reset_color%}'
-eval "$(keychain -q --ssh-agent-socket $HOME/.ssh/agent.sock --eval github homelab)"
eval "$($HOME/.local/bin/mise activate zsh)"
+eval "$(zoxide init --cmd cd zsh)"
+eval "$(keychain -q --ssh-agent-socket $HOME/.ssh/agent.sock --eval github homelab aur)"
+
.config/zsh/keybinds.zsh
@@ -0,0 +1,21 @@
+# Use Emacs-style keybindings
+bindkey -e
+
+# Ctrl + Arrow word navigation
+bindkey '^[[1;5C' forward-word
+bindkey '^[[1;5D' backward-word
+
+# History prefix search with arrow keys
+autoload -U up-line-or-beginning-search
+zle -N up-line-or-beginning-search
+bindkey '^[[A' up-line-or-beginning-search
+
+autoload -U down-line-or-beginning-search
+zle -N down-line-or-beginning-search
+bindkey '^[[B' down-line-or-beginning-search
+
+# Edit command in $EDITOR
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '^X^E' edit-command-line
+
.config/zsh/options.zsh
@@ -0,0 +1,28 @@
+setopt autocd
+setopt autopushd
+setopt pushdignoredups
+setopt pushdminus
+
+setopt extendedhistory
+setopt histignoredups
+setopt histignorespace
+setopt histexpiredupsfirst
+setopt histverify
+setopt sharehistory
+setopt histignorealldups
+
+setopt interactivecomments
+setopt promptsubst
+setopt completeinword
+setopt automenu
+
+setopt alwaystoend
+setopt longlistjobs
+setopt noflowcontrol
+
+# History Setup
+HISTFILE="${HISTFILE:-$HOME/.zsh_history}"
+HISTSIZE=$(( HISTSIZE < 50000 ? 50000 : HISTSIZE ))
+SAVEHIST=$(( SAVEHIST < 10000 ? 10000 : SAVEHIST ))
+
+
.config/zsh/plugins.zsh
@@ -0,0 +1,11 @@
+#fzf
+source <(fzf --zsh)
+
+ZSH_AUTOSUGGEST_DIR="$ZSH/plugins/zsh-autosuggestions"
+
+if [[ ! -d "$ZSH_AUTOSUGGEST_DIR" ]]; then
+ echo "Installing zsh-autosuggestions..."
+ git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_AUTOSUGGEST_DIR"
+fi
+
+source "$ZSH_AUTOSUGGEST_DIR/zsh-autosuggestions.zsh"
.oh-my-zsh/custom/themes/wraith.zsh-theme
@@ -1,19 +0,0 @@
-# with time and git prompt
-#PROMPT='%{${fg_bold[blue]}%}[%t% ]%{$fg_bold[green]%} %{$fg[cyan]%}%c%{$fg_bold[red]%} ➜%{$fg_bold[blue]%} % %{$reset_color%}'
-
-PROMPT='%{${fg_bold[blue]}%}%{$fg_bold[green]%}%{$fg[cyan]%}%c%{$fg_bold[red]%} ➜%{$fg_bold[blue]%} % %{$reset_color%}'
-
-# ZSH_THEME_GIT_PROMPT_PREFIX="("
-# ZSH_THEME_GIT_PROMPT_SUFFIX=")"
-# ZSH_THEME_GIT_PROMPT_DIRTY=""
-# ZSH_THEME_GIT_PROMPT_CLEAN=""
-#
-# RPROMPT='$(git_prompt_status) %{$fg_bold[red]%}$(git_prompt_info)%{$reset_color%}'
-#
-# ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
-# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✱"
-# ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✱"
-# ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%} ✱"
-# ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
-# ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
-
.gitignore
@@ -1,4 +1,3 @@
-states/
.config/tmux/plugins/
-.local/state/
*.cache
+/.config/zsh/plugins/zsh-autosuggestions
.zshrc
@@ -1,11 +1,10 @@
-# Oh My Zsh Configuration
-ZSH_THEME="wraith"
-zstyle ':omz:update' mode reminder
-plugins=(zsh-autosuggestions)
+export ZSH="$HOME/.config/zsh"
+source $ZSH/exports.zsh
-# Source additional configuration files
-source $HOME/.config/zsh/exports.zsh
-source $ZSH/oh-my-zsh.sh
-source <(fzf --zsh)
-source $HOME/.config/zsh/init.zsh
-source $HOME/.config/zsh/aliases.zsh
+if [[ -o interactive ]]; then
+ source $ZSH/options.zsh
+ source $ZSH/init.zsh
+ source $ZSH/keybinds.zsh
+ source $ZSH/aliases.zsh
+ source $ZSH/plugins.zsh
+fi