summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'zsh')
-rw-r--r--zsh/profile/zprofile.G3N21
-rw-r--r--zsh/profile/zprofile.voidx2501
-rw-r--r--zsh/zprofile30
-rwxr-xr-xzsh/zscripts/aliasrc.G3N2.zsh6
-rwxr-xr-xzsh/zscripts/aliasrc.librex60.zsh7
-rwxr-xr-xzsh/zscripts/aliasrc.voidx250.zsh8
-rwxr-xr-xzsh/zscripts/aliasrc.zsh11
-rwxr-xr-xzsh/zscripts/colors.G3N2.zsh7
-rwxr-xr-xzsh/zscripts/keybindrc.zsh34
-rwxr-xr-xzsh/zscripts/lfub.zsh6
-rwxr-xr-xzsh/zshrc22
11 files changed, 51 insertions, 82 deletions
diff --git a/zsh/profile/zprofile.G3N2 b/zsh/profile/zprofile.G3N2
index 4bc5886..afe7c77 100644
--- a/zsh/profile/zprofile.G3N2
+++ b/zsh/profile/zprofile.G3N2
@@ -1,5 +1,6 @@
#!/usr/bin/env zsh
export ZPLUGINS="/home/timmy/.local/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
+export JAVA_HOME=/usr/lib/jvm/openjdk-bin-11
source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/profile/zprofile.voidx250 b/zsh/profile/zprofile.voidx250
index d590c9e..733bf92 100644
--- a/zsh/profile/zprofile.voidx250
+++ b/zsh/profile/zprofile.voidx250
@@ -1,6 +1,7 @@
#!/usr/bin/env zsh
export ZPLUGINS="/home/timmy/.local/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
+
export XDG_DATA_DIRS="/var/lib/flatpak/exports/share:$XDG_DATA_DIRS"
source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/zprofile b/zsh/zprofile
index ab2d1d9..1576f84 100644
--- a/zsh/zprofile
+++ b/zsh/zprofile
@@ -1,40 +1,40 @@
#!/usr/bin/env zsh
# Default programs:
-export EDITOR="nvim"
-export TERMINAL="st"
-export BROWSER="launch brave"
+export EDITOR='nvim'
+export TERMINAL='st'
+export BROWSER='launch brave'
# Clean up home directory
export XDG_CACHE_HOME="$HOME/.cache"
-export XAUTHORITY="$XDG_CACHE_HOME/x11/Xauthority"
+export XAUTHORITY="$XDG_CACHE_HOME/Xauthority"
export XDG_CONFIG_HOME="$HOME/.config"
-export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
+export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
export INPUTRC="$XDG_CONFIG_HOME/zsh/inputrc"
export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config"
export NOTMUCH_COFIG="$XDG_CONFIG_HOME/notmuch/config"
-export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
+export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" # User env
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
-export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
export XDG_DATA_HOME="$HOME/.local/share"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
-export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_DATA_HOME/java"
+export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_DATA_HOME/java"
+export ZDATADIR="$XDG_DATA_HOME/zsh" # User env
-export LESSHISTFILE="-"
+export LESSHISTFILE='-'
# Path
-for dir in keyboard launch misc sync video x11; do
- export PATH="/home/timmy/.local/bin/$dir:$PATH";
-done
-
+for lbin in "$HOME/.local/bin"{/,/*/}; do export PATH="${lbin%/}:$PATH"; done # Add ~/.local/bin and all sub dirs
export PATH="$CARGO_HOME/bin:$PATH"
# Theming
-export QT_QPA_PLATFORMTHEME="qt5ct"
+export QT_QPA_PLATFORMTHEME='qt5ct'
+
+# Misc Zsh setup
+mkdir -p "$ZDATADIR"
# Autostart X after login
-if [[ -z $DISPLAY ]] && [[ "$(id -u)" != 0 ]] && ( [[ $(tty) = /dev/tty1 ]] || [[ $(tty) = /dev/ttyC0 ]] ); then startx $XINITRC; fi
+[ -z $DISPLAY ] && [[ "$(id -u)" != 0 ]] && [[ $TTY =~ /dev/tty(1|C0) ]] && startx $XINITRC
diff --git a/zsh/zscripts/aliasrc.G3N2.zsh b/zsh/zscripts/aliasrc.G3N2.zsh
deleted file mode 100755
index 8e8d2a5..0000000
--- a/zsh/zscripts/aliasrc.G3N2.zsh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# Package Management
-alias \
- e="sudo emerge" \
-
diff --git a/zsh/zscripts/aliasrc.librex60.zsh b/zsh/zscripts/aliasrc.librex60.zsh
deleted file mode 100755
index 87f7e08..0000000
--- a/zsh/zscripts/aliasrc.librex60.zsh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# Package Management
-alias \
- p="sudo pacman" \
- pq="sudo pacman -Ss" \
-
diff --git a/zsh/zscripts/aliasrc.voidx250.zsh b/zsh/zscripts/aliasrc.voidx250.zsh
deleted file mode 100755
index 4681ace..0000000
--- a/zsh/zscripts/aliasrc.voidx250.zsh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# Replacement programs
-alias \
- xi="sudo xbps-install" \
- xq="xbps-query -R --search" \
- xr="sudo xbps-remove" \
-
diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh
index f9822b7..cd77a71 100755
--- a/zsh/zscripts/aliasrc.zsh
+++ b/zsh/zscripts/aliasrc.zsh
@@ -11,7 +11,7 @@ alias \
open="xdg-open" \
smci="sudo make clean install" \
smi="sudo make install" \
- su="sudo su" \
+ su="sudo su -l" \
# Quick navigate to directories / open specific files
alias \
@@ -32,28 +32,29 @@ alias \
# Colorize command output
alias \
+ bat="bat --theme='Monokai Extended'" \
diff="diff --color=auto" \
exa="exa --icons -a --group-directories-first" \
grep="grep --color=auto -I --ignore-case --line-number" \
+ ip="ip --color=auto" \
ls="ls -vAhN --color=auto --group-directories-first" \
- bat="bat --theme=Monokai\ Extended" \
# (Non)-Verbosity
alias \
- br="br -h" \
cp="cp -iv" \
+ dd="sudo dd status=progress bs=4M"
ffmpeg="ffmpeg -hide_banner" \
ffprobe="ffprobe -hide_banner" \
mkd="mkdir -p" \
mv="mv -iv" \
rm="rm -v" \
-# Default formatting
+# Miscellaneous
alias \
yt-dlp="yt-dlp -o '%(uploader)s - %(title)s.%(ext)s'" \
# Clean home directory
alias \
- startdwm="\startx $XDG_CONFIG_HOME/x11/xinitdwmrc" \
+ startdwm="startx $XDG_CONFIG_HOME/x11/xinitdwmrc" \
startx="startx $XINITRC" \
diff --git a/zsh/zscripts/colors.G3N2.zsh b/zsh/zscripts/colors.G3N2.zsh
deleted file mode 100755
index f6c1a90..0000000
--- a/zsh/zscripts/colors.G3N2.zsh
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ -n "$DISPLAY" ]; then
- declare col{br,at}=57
- declare col{name,host}=13
- coldir=129
-else
- declare col{br,name,at,host,dir}=magenta
-fi
diff --git a/zsh/zscripts/keybindrc.zsh b/zsh/zscripts/keybindrc.zsh
index 90c1e16..29913ae 100755
--- a/zsh/zscripts/keybindrc.zsh
+++ b/zsh/zscripts/keybindrc.zsh
@@ -8,20 +8,24 @@ export KEYTIMEOUT=1
#bindkey -r "^U" "^W" "^G" "^J" "^Q" "^R" "^[[200~"
# Keybindings
-#autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
-#bindkey "^E" edit-command-line # Ctrl-e - edit line in Vim buffer
-bindkey "^[[H" beginning-of-line # Home Key
-bindkey "^[[4~" end-of-line # End Key
-bindkey "^[[P" delete-char # Delete Key
-bindkey "^[[4h" overwrite-mode # Insert Key
-bindkey "^D" kill-whole-line # Ctrl-d - delete line
-bindkey "^X" clear-screen # Ctrl-x - clear screen
-bindkey "^H" backward-delete-word # Ctrl-Backspace - delete entire word behind cursor
-bindkey "^[[M" delete-word # Ctrl-Delete - delete currect word in front of the cursor
-bindkey "^[[1;5D" emacs-backward-word # Ctrl-Right - go back one word
-bindkey "^[[1;3D" emacs-backward-word # Alt-Right - go back one word
-bindkey "^[[1;5C" emacs-forward-word # Ctrl-Left - go forward one word
-bindkey "^[[1;3C" emacs-forward-word # Alt-Left - go forward one word
+autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
+bindkey '^E' edit-command-line # Ctrl-e - edit line in Vim buffer
+bindkey '^[[H' beginning-of-line # Home Key
+bindkey '^[[4~' end-of-line # End Key
+bindkey '^[[P' delete-char # Delete Key
+bindkey '^[[4h' overwrite-mode # Insert Key
+bindkey '^D' kill-whole-line # Ctrl-d - delete line
+bindkey '^X' clear-screen # Ctrl-x - clear screen
+bindkey '^H' backward-delete-word # Ctrl-Backspace - delete entire word behind cursor
+bindkey '^[[M' delete-word # Ctrl-Delete - delete currect word in front of the cursor
+# History completion
+bindkey '\e[A' history-search-backward # Up arrow - seach history backwards
+bindkey '\e[B' history-search-forward # Down arrow - seach history forwards
+# Ctrl-vi keys emulate arrow keys
+bindkey '^H' emacs-backward-word # Ctrl-L - go back one word
+bindkey '^J' history-search-forward # Ctrl-J - seach history backwards
+bindkey '^K' history-search-backward # Ctrl-K - seach history forwards
+bindkey '^L' emacs-forward-word # Ctrl-H - go forward one word
# Basic auto/tab complete
autoload -U compinit
@@ -30,7 +34,7 @@ zmodload zsh/complist
compinit -d "$XDG_CACHE_HOME/zcompdump" # Change where .zcompdump is stored
_comp_options+=(globdots) # Include hidden files.
-# Use ctrl+vi keys in tab complete menu
+# Use ctrl-vi keys in tab complete menu
bindkey -M menuselect '^h' vi-backward-char
bindkey -M menuselect '^k' vi-up-line-or-history
bindkey -M menuselect '^l' vi-forward-char
diff --git a/zsh/zscripts/lfub.zsh b/zsh/zscripts/lfub.zsh
index 309a0dc..83b00c1 100755
--- a/zsh/zscripts/lfub.zsh
+++ b/zsh/zscripts/lfub.zsh
@@ -9,14 +9,14 @@ cleanuplf() {
}
lfub() {
- dircache=/tmp/lflastdir
+ dircache=/tmp/$USER-lflastdir
lfopt="--last-dir-path=$dircache"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
lf "$lfopt" "$@"
else
export FIFO_UEBERZUG="/tmp/ueberzug-$$"
mkfifo "$FIFO_UEBERZUG"
- (ueberzug layer -s <"$FIFO_UEBERZUG" -p json &) >/dev/null 2>&1
+ ueberzug layer -s <"$FIFO_UEBERZUG" -p json &
exec 3>"$FIFO_UEBERZUG"
trap cleanuplf HUP INT QUIT TERM PWR EXIT
lf "$lfopt" "$@" 3>&-
@@ -24,4 +24,4 @@ lfub() {
[ -f "$dircache" ] && dir="$(cat "$dircache")" && [ -d "$dir" ] && cd "$dir"
}
-alias "lf=lfub"
+alias lf="lfub"
diff --git a/zsh/zshrc b/zsh/zshrc
index 648ea3c..8272e56 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,25 +1,15 @@
#!/usr/bin/env zsh
# Zsh scripts
-zscripts="$XDG_CONFIG_HOME/zsh/zscripts"
-source $zscripts/aliasrc.zsh # General aliases
-source $zscripts/keybindrc.zsh # Zsh keybindings
-source $zscripts/lfub.zsh # lf + ueberzug configuration
-source $zscripts/vicursor.zsh # Change cursor for different vi modes
-# Host specific scripts
-for zscript in $zscripts/*.$HOST.zsh; do
- source $zscript
-done
+for zscript in "$XDG_CONFIG_HOME/zsh/zscripts"{/[^\!]*.zsh,/hosts/*.$HOST.zsh,/!*.zsh}; do source "$zscript"; done
# Colors! + Prompt
autoload -U colors && colors
PS1="%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "
# History settings
-HISTDIR="$XDG_DATA_HOME/zsh/"
-mkdir -p "$HISTDIR"
-HISTFILE="$HISTDIR/zhistory"
-HISTSIZE=200 # Max lines of history loaded into memory
+HISTFILE="$ZDATADIR/zhistory"
+HISTSIZE=500 # Max lines of history loaded into memory
SAVEHIST=10000000 # Max lines of history saved to the histfile
setopt INC_APPEND_HISTORY # Create entries after each command, not after zsh exits
setopt SHARE_HISTORY # Share history between zsh sessions
@@ -31,7 +21,7 @@ setopt EXTENDED_HISTORY # Save superfluous info with command to reduce disk wri
# Other settings
setopt autocd # 'cd' is implied
+"/home/timmy/.local/opt/shell-color-scripts/colorscripts/$(ls /home/timmy/.local/opt/shell-color-scripts/colorscripts | shuf -n1)"
+
# Load zsh plugins; should be last
-for plugin in ${=ZPLUGINS}; do
- source $plugin
-done
+for plugin in ${=ZPLUGINS}; do source "$plugin"; done