summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-03-16 19:54:43 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-03-16 19:54:43 -0500
commit4e46513cb083f9473a4c9c6f87a2f43ead451cb7 (patch)
tree8f549955094e0b0ab7d7adac1d2c3e22d4d1faa0
parent73a8305b011b8d937bdbc0dea347e8b3342167db (diff)
downloaddotconfig-4e46513cb083f9473a4c9c6f87a2f43ead451cb7.tar.xz
dotconfig-4e46513cb083f9473a4c9c6f87a2f43ead451cb7.zip
zsh configuration redo
-rwxr-xr-xzsh/aliasrc57
-rwxr-xr-xzsh/aliasrc.G3N28
-rwxr-xr-xzsh/aliasrc.debx2307
-rwxr-xr-xzsh/aliasrc.librex6012
-rwxr-xr-xzsh/aliasrc.voidx2509
-rwxr-xr-xzsh/keybindrc47
-rw-r--r--zsh/lficons163
-rw-r--r--zsh/zprofile.G3N213
-rw-r--r--zsh/zprofile.base42
-rw-r--r--zsh/zprofile.debx23015
-rw-r--r--zsh/zprofile.librex6010
-rw-r--r--zsh/zprofile.openbsdx23014
-rw-r--r--zsh/zprofile.voidx25016
-rwxr-xr-xzsh/zshrc39
14 files changed, 14 insertions, 438 deletions
diff --git a/zsh/aliasrc b/zsh/aliasrc
deleted file mode 100755
index 6518cf5..0000000
--- a/zsh/aliasrc
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-# Replacement programs
-alias \
- htop="htim" \
- ls="exa --icons -a --group-directories-first" \
- mutt="neomutt" \
- sudo="doas" \
- vim="nvim" \
-
-# Shorten program names
-alias \
- open="xdg-open" \
- smci="sudo make clean install" \
- smi="sudo make install" \
- spotify="flatpak run com.spotify.Client" \
- steam="flatpak run com.valvesoftware.Steam" \
-
-# Quick navigate to directories / open specific files
-alias \
- ..="cd .." \
- cdc="cd ~/.local/src/programs" \
- cds="cd ~/.local/bin" \
- cdw="cd ~/.local/src/sites" \
- hw="cd ~/docs/school" \
- vrc="nvim ~/.config/nvim/init.vim" \
- xrc="cd ~/.config/x11" \
- zrc="cd ~/.config/zsh" \
-
-# Power scripts
-alias \
- halt="launch shutdown" \
- off="launch shutdown" \
- reboot="launch reboot" \
- zzz="launch suspend" \
-
-# Colorize command output
-alias \
- diff="diff --color=auto" \ # Does not work on OpenBSD
- grep="grep --color=auto -I --ignore-case --line-number" \
- #ls="ls -hN --color=auto --group-directories-first" \
-
-# Verbosity / non-verbosity
-alias \
- br="br -h" \
- cp="rsync -Puv" \
- ffmpeg="ffmpeg -hide_banner" \
- mkd="mkdir -p" \
- mv="mv -iv" \
- rm="rm -v" \
- #cp="cp -iv" \
-
-# Clean home directory
-alias \
- startdwm="\startx $XDG_CONFIG_HOME/x11/xinitdwmrc" \
- startx="startx $XDG_CONFIG_HOME/x11/xinitrc" \
-
diff --git a/zsh/aliasrc.G3N2 b/zsh/aliasrc.G3N2
deleted file mode 100755
index 595fee4..0000000
--- a/zsh/aliasrc.G3N2
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-## Normal Aliases ##
-# Package Management
-alias \
- e="sudo emerge" \
- eaum="sudo emerge --autounmask-continue" \
-
diff --git a/zsh/aliasrc.debx230 b/zsh/aliasrc.debx230
deleted file mode 100755
index 1258032..0000000
--- a/zsh/aliasrc.debx230
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-## Normal Aliases ##
-# Replacement programs
-alias \
- ls="ls" \
-
diff --git a/zsh/aliasrc.librex60 b/zsh/aliasrc.librex60
deleted file mode 100755
index 12d781d..0000000
--- a/zsh/aliasrc.librex60
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-## Normal Aliases ##
-# Replacement programs
-alias \
- ls="ls -a --color --group-directories-first -h -I'.' -I'..'" \
-
-# Package Management
-alias \
- p="sudo pacman" \
- pq="sudo pacman -Ss" \
-
diff --git a/zsh/aliasrc.voidx250 b/zsh/aliasrc.voidx250
deleted file mode 100755
index 96d1122..0000000
--- a/zsh/aliasrc.voidx250
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-## Normal Aliases ##
-# Replacement programs
-alias \
- xi="sudo xbps-install" \
- xq="xbps-query -R --search" \
- xr="sudo xbps-remove" \
-
diff --git a/zsh/keybindrc b/zsh/keybindrc
deleted file mode 100755
index 3d2f358..0000000
--- a/zsh/keybindrc
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/zsh
-
-# Vi mode + requirements for ALL keybindings to work correctly
-bindkey -v
-export KEYTIMEOUT=1
-
-# Keybinding functions
- #function name #function #description
-autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
-
-# Unbind some default keybindings
-bindkey -r "^U" "^W" "^G" "^J" "^Q" "^R" "^[[200~"
-
-# Keybindings
- #key #command #description
-bindkey "^E" edit-command-line # Ctrl-e to edit line in Vim buffer
-bindkey "^D" kill-whole-line # Ctrl-d to delete line
-bindkey "^X" clear-screen # Ctrl-x to clear screen
-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 "^[[1;5D" emacs-backward-word # Ctrl-Right to go back one word
-bindkey "^[[1;5C" emacs-forward-word # Ctrl-Left to go forward one word
-bindkey "^[[1;3D" emacs-backward-word # Alt-Right to go back one word
-bindkey "^[[1;3C" emacs-forward-word # Alt-Left to go forward one word
-bindkey "^[[5~" emacs-backward-word # PgUp to go back one word
-bindkey "^[[6~" emacs-forward-word # PgDn to go forward one word
-bindkey "^H" backward-delete-word # Ctrl-Backspace to delete entire word behind cursor
-bindkey "^[[M" delete-word # Ctrl-Delete to delete currect word in front of the cursor
-
-# Basic auto/tab complete:
-autoload -U compinit
-zstyle ':completion:*' menu select
-zmodload zsh/complist
-compinit
-_comp_options+=(globdots) # Include hidden files.
-
-# Use Vim 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
-bindkey -M menuselect 'j' vi-down-line-or-history
-bindkey -v '^?' backward-delete-char
-
-# Ignore ctrl-d to exit shell
-setopt ignore_eof
diff --git a/zsh/lficons b/zsh/lficons
deleted file mode 100644
index 240bae4..0000000
--- a/zsh/lficons
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/sh
-# TODO: remove icons for unused file types
-export LF_ICONS="\
-di=:\
-fi=:\
-ln=:\
-or=:\
-ex=:\
-*.vimrc=:\
-*.viminfo=:\
-*.gitignore=:\
-*.c=:\
-*.cc=:\
-*.clj=:\
-*.coffee=:\
-*.cpp=:\
-*.css=:\
-*.d=:\
-*.dart=:\
-*.erl=:\
-*.exs=:\
-*.fs=:\
-*.go=:\
-*.h=:\
-*.hh=:\
-*.hpp=:\
-*.hs=:\
-*.html=:\
-*.java=:\
-*.jl=:\
-*.js=:\
-*.json=:\
-*.lua=:\
-*.md=:\
-*.php=:\
-*.pl=:\
-*.pro=:\
-*.py=:\
-*.rb=:\
-*.rs=:\
-*.scala=:\
-*.ts=:\
-*.vim=:\
-*.cmd=:\
-*.ps1=:\
-*.sh=:\
-*.bash=:\
-*.zsh=:\
-*.fish=:\
-*.tar=:\
-*.tgz=:\
-*.arc=:\
-*.arj=:\
-*.taz=:\
-*.lha=:\
-*.lz4=:\
-*.lzh=:\
-*.lzma=:\
-*.tlz=:\
-*.txz=:\
-*.tzo=:\
-*.t7z=:\
-*.zip=:\
-*.z=:\
-*.dz=:\
-*.gz=:\
-*.lrz=:\
-*.lz=:\
-*.lzo=:\
-*.xz=:\
-*.zst=:\
-*.tzst=:\
-*.bz2=:\
-*.bz=:\
-*.tbz=:\
-*.tbz2=:\
-*.tz=:\
-*.deb=:\
-*.rpm=:\
-*.jar=:\
-*.war=:\
-*.ear=:\
-*.sar=:\
-*.rar=:\
-*.alz=:\
-*.ace=:\
-*.zoo=:\
-*.cpio=:\
-*.7z=:\
-*.rz=:\
-*.cab=:\
-*.wim=:\
-*.swm=:\
-*.dwm=:\
-*.esd=:\
-*.jpg=:\
-*.jpeg=:\
-*.mjpg=:\
-*.mjpeg=:\
-*.gif=:\
-*.bmp=:\
-*.pbm=:\
-*.pgm=:\
-*.ppm=:\
-*.tga=:\
-*.xbm=:\
-*.xpm=:\
-*.tif=:\
-*.tiff=:\
-*.png=:\
-*.svg=:\
-*.svgz=:\
-*.mng=:\
-*.pcx=:\
-*.mov=:\
-*.mpg=:\
-*.mpeg=:\
-*.m2v=:\
-*.mkv=:\
-*.webm=:\
-*.ogm=:\
-*.mp4=:\
-*.m4v=:\
-*.mp4v=:\
-*.vob=:\
-*.qt=:\
-*.nuv=:\
-*.wmv=:\
-*.asf=:\
-*.rm=:\
-*.rmvb=:\
-*.flc=:\
-*.avi=:\
-*.fli=:\
-*.flv=:\
-*.gl=:\
-*.dl=:\
-*.xcf=:\
-*.xwd=:\
-*.yuv=:\
-*.cgm=:\
-*.emf=:\
-*.ogv=:\
-*.ogx=:\
-*.aac=:\
-*.au=:\
-*.flac=:\
-*.m4a=:\
-*.mid=:\
-*.midi=:\
-*.mka=:\
-*.mp3=:\
-*.mpc=:\
-*.ogg=:\
-*.ra=:\
-*.wav=:\
-*.oga=:\
-*.opus=:\
-*.spx=:\
-*.xspf=:\
-*.pdf=:\
-*.nix=:\
-"
diff --git a/zsh/zprofile.G3N2 b/zsh/zprofile.G3N2
deleted file mode 100644
index b6dbfdf..0000000
--- a/zsh/zprofile.G3N2
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env zsh
-# vim: filetype=zsh
-export WIFIDEV="wlp2s0f0u3"
-export ETHEDEV="eno1"
-export PATH="/home/timmy/.local/bin/video:$PATH"
-export PATH="/home/timmy/.cargo/bin:$PATH"
-export PATH="/home/timmy/.local/opt:$PATH"
-export ZPLUGINS="
-/usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh
-/usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
-"
-
-source /home/timmy/.config/zsh/zprofile.base
diff --git a/zsh/zprofile.base b/zsh/zprofile.base
deleted file mode 100644
index 52089a9..0000000
--- a/zsh/zprofile.base
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env zsh
-
-# Default programs:
-export EDITOR="nvim"
-export TERMINAL="st"
-export BROWSER="launch brave"
-
-# Clean up home directory
-export XDG_CACHE_HOME="$HOME/.cache"
-
-export XDG_CONFIG_HOME="$HOME/.config"
-export XAUTHORITY="$XDG_CONFIG_HOME/x11/Xauthority"
-export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
-export INPUTRC="$XDG_CONFIG_HOME/zsh/inputrc"
-export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
-export NOTMUCH_COFIG="$XDG_CONFIG_HOME/notmuch/config"
-export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" # Doesnt work
-export ZDOTDIR="$XDG_CONFIG_HOME/zsh" # Move .zshrc
-
-export XDG_DATA_HOME="$HOME/.local/share"
-export CARGO_HOME="$XDG_DATA_HOME/cargo"
-export GNUPGHOME="$XDG_DATA_HOME/gnupg"
-export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_DATA_HOME/java"
-export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
-
-export LESSHISTFILE="-"
-
-# Path
-scriptspath="/home/timmy/.local/bin"
-export PATH="$scriptspath/launch:$PATH"
-export PATH="$scriptspath/x11:$PATH"
-export PATH="$scriptspath/misc:$PATH"
-#export PATH="$scriptspath/keyboard:$PATH"
-export PATH="$scriptspath/sync:$PATH"
-export PATH="$scriptspath/programs:$PATH"
-export PATH="$CARGO_HOME/bin:$PATH"
-
-# Theming
-export QT_QPA_PLATFORMTHEME="qt5ct"
-
-# Autostart X after login
-if [[ -z $DISPLAY ]] && [[ "$(id -u)" != 0 ]] && ( [[ $(tty) = /dev/tty1 ]] || [[ $(tty) = /dev/ttyC0 ]] ); then startx $XDG_CONFIG_HOME/x11/xinitrc; fi
diff --git a/zsh/zprofile.debx230 b/zsh/zprofile.debx230
deleted file mode 100644
index ece1659..0000000
--- a/zsh/zprofile.debx230
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env zsh
-# vim: filetype=zsh
-export WIFIDEV="wlp2s0"
-export ETHEDEV="enp0s25"
-#export PATH="/home/timmy/scripts/pkgmgt/xbps:$PATH"
-#export ZPLUGINS="
-#/usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh
-#/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-#"
-#alias \
-# xi="sudo xbps-install" \
-# xq="xbps-query -R --search" \
-# xr="sudo xbps-remove" \
-
-source /home/timmy/.config/zsh/zprofile.base
diff --git a/zsh/zprofile.librex60 b/zsh/zprofile.librex60
deleted file mode 100644
index e35273b..0000000
--- a/zsh/zprofile.librex60
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env zsh
-# vim: filetype=zsh
-export WIFIDEV="wlp2s0"
-export ETHEDEV="enp1s0"
-export PATH="/usr/local/texlive/2021/bin/x86_64-linux:$PATH"
-export ZPLUGINS="
-/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-"
-
-source /home/timmy/.config/zsh/zprofile.base
diff --git a/zsh/zprofile.openbsdx230 b/zsh/zprofile.openbsdx230
deleted file mode 100644
index 7fd9c63..0000000
--- a/zsh/zprofile.openbsdx230
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env zsh
-# vim: filetype=zsh
-export WIFIDEV="iwn0"
-export ETHEDEV="em0"
-export LC_CTYPE=en_US.UTF-8
-#/usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh
-export ZPLUGINS="
-/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-"
-source /home/timmy/.config/zsh/zprofile.base
-alias \
- grep="rg -i" \
- diff="\diff" \
-
diff --git a/zsh/zprofile.voidx250 b/zsh/zprofile.voidx250
deleted file mode 100644
index 9941ad1..0000000
--- a/zsh/zprofile.voidx250
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env zsh
-# vim: filetype=zsh
-export WIFIDEV="wlp3s0"
-export ETHEDEV="enp0s25"
-export PATH="/home/timmy/scripts/pkgmgt/xbps:$PATH"
-export ZPLUGINS="
-/usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh
-/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-"
-
-alias \
- xi="sudo xbps-install" \
- xq="xbps-query -R --search" \
- xr="sudo xbps-remove" \
-
-source /home/timmy/.config/zsh/zprofile.base
diff --git a/zsh/zshrc b/zsh/zshrc
index f639b2f..648ea3c 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,15 +1,19 @@
#!/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
+
# Colors! + Prompt
autoload -U colors && colors
-PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " # TODO: change $ to # when root
-
-# Load aliasrc and keybindrc
-source "$XDG_CONFIG_HOME/zsh/aliasrc"
-source "$XDG_CONFIG_HOME/zsh/aliasrc.$(hostname)"
-source "$XDG_CONFIG_HOME/zsh/keybindrc"
-# lf icons
-#source "$XDG_CONFIG_HOME/zsh/lficons"
+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/"
@@ -24,23 +28,8 @@ setopt HIST_IGNORE_DUPS # Successive duplicate entries ignored
setopt HIST_IGNORE_SPACE # Entries with leading space ignored
setopt EXTENDED_HISTORY # Save superfluous info with command to reduce disk writes
-# Change cursor shape for different vi modes (Cred: LARBS)
-if [ -n "$DISPLAY" ]; then
- function zle-keymap-select () {
- case $KEYMAP in
- vicmd) echo -n '\e[1 q';; # block
- viins|main) echo -n '\e[5 q';; # beam
- esac
- }
- zle -N zle-keymap-select
- zle-line-init() {
- #zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
- echo -n "\e[5 q"
- }
- zle -N zle-line-init
- echo -n '\e[5 q' # Use beam shape cursor on startup
- preexec() { echo -n '\e[5 q' ;} # Use beam shape cursor for each new prompt
-fi
+# Other settings
+setopt autocd # 'cd' is implied
# Load zsh plugins; should be last
for plugin in ${=ZPLUGINS}; do