summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorxAlpharax <42233094+xAlpharax@users.noreply.github.com>2025-03-07 00:22:08 +0200
committerxAlpharax <42233094+xAlpharax@users.noreply.github.com>2025-03-07 00:22:08 +0200
commit6e968354e4f9cad9f94b592e61a09b17a8e06210 (patch)
treedf0f341fd9332b53a39aa72c4be17cdd0f7cd1c4 /zsh
parent40577b3f22f677c45525e7439f689a482eedbf69 (diff)
Great new changes to X11, allacrity(just for testing), btop, nsxiv
(added key exec handler), nvim, tmux niceness, zathura configuration massive zsh improvements. Overall a solid update, install script is still dead tho. REGARDLESS: Changes to be committed: modified: X11/xinit new file: alacritty/alacritty.toml modified: btop/btop.conf new file: nsxiv/exec/key-handler modified: nvim/init.vim new file: sxiv modified: tmux/tmux.conf modified: zathura/zathurarc modified: zsh/aliases modified: zsh/env modified: zsh/zshrc
Diffstat (limited to 'zsh')
-rw-r--r--zsh/aliases3
-rw-r--r--zsh/env12
-rw-r--r--zsh/zshrc40
3 files changed, 36 insertions, 19 deletions
diff --git a/zsh/aliases b/zsh/aliases
index a35005d..3fda239 100644
--- a/zsh/aliases
+++ b/zsh/aliases
@@ -61,12 +61,13 @@ alias vis='python $scriptdir/vis.py'
# aesthetic
alias filmelematrix='cmatrix -C red -a'
-alias colorfetch='neofetch --block_range 0 15'
+#alias colorfetch='neofetch --block_range 0 15'
alias change-bg='feh --bg-fill --no-fehbg'
alias clock='tty-clock -Dc -C 4'
alias sens='watch -n 0.1 sensors'
alias htopr='htop -C -U'
alias sxiv='sxiv -bpqra'
+alias nsxiv='sxiv -bpqra'
# tools
alias zathura='zathura 2>/dev/null'
diff --git a/zsh/env b/zsh/env
index 5e75cf6..a76825f 100644
--- a/zsh/env
+++ b/zsh/env
@@ -8,10 +8,12 @@ export EDITOR="nvim"
export VISUAL="nvim"
export COLORTERM="truecolor"
export BROWSER="brave"
+export TERMBROWSER="brave"
export CHROME_EXECUTABLE="chromium"
-export TERM="st-256color"
-export TERMINAL="st-256color"
-export TERMINAL_PROG="st-256color"
+export TERM="st"
+export TERMINAL="st"
+export TERMINAL_PROG="st"
+export READER="zathura"
export BAT_THEME="base16"
@@ -76,7 +78,7 @@ export QT_STYLE_OVERRIDE=kvantum
# default aim is 1024/48000 21.33 ms and my system defaults to aim to 4/48000 0.08 ms
### cuda & ML ###
-export PATH=$PATH:/usr/local/cuda-11.7/bin
-export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/cuda-11.7/lib64:/usr/lib/qt6/lib
+export PATH=$PATH:/usr/local/cuda-12.4/bin
+export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/cuda-12.4/bin:/usr/lib/qt6/lib
TORCH_CUDA_ARCH_LIST="8.6"
diff --git a/zsh/zshrc b/zsh/zshrc
index e3c4aad..b58499c 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,44 +1,61 @@
+# Ensure this zshrc is only sourced in interactive shells
+[[ $- != *i* ]] && return
+
# Add deno completions to search path
if [[ ":$FPATH:" != *":/home/alphara/.zsh/completions:"* ]]; then export FPATH="/home/alphara/.zsh/completions:$FPATH"; fi
+
+# Completion settings
zstyle ':completion:*' menu select
zstyle :compinstall filename '~/.zshrc'
+zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' # More forgiving completion matching
autoload -Uz compinit
zmodload zsh/complist
-
compinit
_comp_options+=(globdots)
+# History settings
HISTFILE=~/.histfile
HISTSIZE=1000000
SAVEHIST=1000000
+setopt appendhistory hist_ignore_all_dups extendedglob autocd
+unsetopt beep # Disable beep
-setopt appendhistory hist_ignore_dups extendedglob autocd
-
-unsetopt beep
-
-bindkey -v
+# --- Keybindings ---
+bindkey -v # Enable vi keybindings
+# Vi-mode navigation in menu completion
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
+bindkey -v '^?' backward-delete-char # Fix backspace in vi mode
+bindkey -s '^z' 'fg\n' # Ctrl+Z to bring background job to foreground
+bindkey -M vicmd 'L' edit-command-line # 'L' in vi command mode to edit command line
+
+# --- Aliases and Environment Variables ---
source $HOME/.config/zsh/aliases
source $HOME/.config/zsh/env
+# --- Prompt ---
autoload -Uz promptinit
PROMPT_EOL_MARK=""
promptinit
-
PROMPT='%B%F{3}%n@%m %~>%b%f '
+# --- Plugins ---
+# History substring search with / in normal mode, like in Vim
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
-############################################
+# Auto-Completion + Syntax highlighting (comment if not needed)
+source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
+source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=blue' # Highlight unknown tokens in blue (red in my colorscheme)
+ZSH_HIGHLIGHT_STYLES[arg0]='fg=green,bold' # Highlight the first argument in bold green (blue in my colorscheme)
+############################################
# vi mode
-
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # beam
@@ -46,18 +63,15 @@ function zle-keymap-select () {
esac
}
zle -N zle-keymap-select
-
############################################
stty tabs
+# --- Version Managers and Tools ---
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
-# slow af
-#eval "$(gh copilot alias -- zsh)"
-
eval "$(zoxide init zsh)"
. "/home/alphara/.deno/env"