summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-07-31 15:16:04 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-07-31 15:16:04 -0500
commita0943a0a387400afc8e49e7a626532e73990d24f (patch)
tree5e14f8a353c9b05a1a97f029c66c9f0e28f352a1
parent4af49ed67fbf358674d45fb8af3c4c3efaf90f58 (diff)
downloaddotconfig-a0943a0a387400afc8e49e7a626532e73990d24f.tar.xz
dotconfig-a0943a0a387400afc8e49e7a626532e73990d24f.zip
bunch more stuff
-rwxr-xr-xx11/xinitrc2
-rw-r--r--zsh/profile/zprofile.G3N23
-rwxr-xr-x[-rw-r--r--]zsh/profiles/zprofile.librex60 (renamed from zsh/profile/zprofile.librex60)2
-rwxr-xr-x[-rw-r--r--]zsh/profiles/zprofile.voidx250 (renamed from zsh/profile/zprofile.voidx250)2
-rwxr-xr-x[-rw-r--r--]zsh/zprofile5
-rwxr-xr-xzsh/zscripts/.lfub.zsh2
-rwxr-xr-xzsh/zscripts/aliasrc.zsh19
-rwxr-xr-xzsh/zscripts/keybindrc.zsh25
-rwxr-xr-xzsh/zscripts/zplug.zsh2
-rwxr-xr-xzsh/zscripts/zshcompmenu.zsh18
-rwxr-xr-xzsh/zshrc17
11 files changed, 48 insertions, 49 deletions
diff --git a/x11/xinitrc b/x11/xinitrc
index e324ad6..a62b91e 100755
--- a/x11/xinitrc
+++ b/x11/xinitrc
@@ -1,4 +1,4 @@
#!/bin/sh
X11CONFIG=${X11CONFIG:=${XDG_CONFIG_HOME:+$XDG_CONFIG_HOME/x11}}; X11CONFIG=${X11CONFIG:-$HOME/.config/x11}
X11CONFIG=$X11CONFIG $X11CONFIG/xprofile
-exec dbus-launch --exit-with-session ${1:-timmywm}
+exec dbus-launch --exit-with-session ${WM:-timmywm}
diff --git a/zsh/profile/zprofile.G3N2 b/zsh/profile/zprofile.G3N2
deleted file mode 100644
index 4bcfddc..0000000
--- a/zsh/profile/zprofile.G3N2
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env zsh
-
-source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/profile/zprofile.librex60 b/zsh/profiles/zprofile.librex60
index 543038c..530563f 100644..100755
--- a/zsh/profile/zprofile.librex60
+++ b/zsh/profiles/zprofile.librex60
@@ -1,5 +1,3 @@
#!/usr/bin/env zsh
export PATH="/usr/local/texlive/2021/bin/x86_64-linux:$PATH"
-
-source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/profile/zprofile.voidx250 b/zsh/profiles/zprofile.voidx250
index 4b00faa..61eb34e 100644..100755
--- a/zsh/profile/zprofile.voidx250
+++ b/zsh/profiles/zprofile.voidx250
@@ -1,5 +1,3 @@
#!/usr/bin/env zsh
export XDG_DATA_DIRS="/var/lib/flatpak/exports/share:$XDG_DATA_DIRS" # .desktop files
-
-source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/zprofile b/zsh/zprofile
index 618514d..52be283 100644..100755
--- a/zsh/zprofile
+++ b/zsh/zprofile
@@ -27,8 +27,8 @@ export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_DATA_HOME/java"
export XDG_STATE_HOME="$HOME/.local/state"
- HISTFILE="$XDG_STATE_HOME/zsh/zhistory" # Zsh internal variable, doesn't need to be available to general environment
export LESSHISTFILE='-' # Disable this, but it would be considered a state file
+export ZHISTFILE="$XDG_STATE_HOME/zsh/zhistory" # Used to set HISTFILE in zshrc without exporting since HISTFILE is generic to most shells, and desired behavior is for zsh to have its own history file
# Path
for lbin in "$HOME/.local/bin"{/,/*/}; do export PATH="${lbin%/}:$PATH"; done 2>/dev/null # Add ~/.local/bin and all sub dirs
@@ -39,7 +39,8 @@ export PATH="$CARGO_HOME/bin:$PATH"
export QT_QPA_PLATFORMTHEME='qt5ct'
# Misc Zsh setup
-mkdir -p "$HISTFILE"
+mkdir -p "$(dirname "$ZHISTFILE")"
+source "$ZDOTDIR/profiles/zprofile.$HOST" 2>/dev/null # Source additional host-specific profiles
# Autostart X after login
[ -z $DISPLAY ] && [[ $UID != 0 ]] && [[ $TTY =~ /dev/tty(1|C0) ]] && startx "$X11CONFIG/xinitrc"
diff --git a/zsh/zscripts/.lfub.zsh b/zsh/zscripts/.lfub.zsh
index 83b00c1..2e1f7f4 100755
--- a/zsh/zscripts/.lfub.zsh
+++ b/zsh/zscripts/.lfub.zsh
@@ -1,5 +1,5 @@
#!/bin/sh
-# This is a wrapper script for lb that allows it to create image previews with
+# This is a wrapper script for lf that allows it to create image previews with
# ueberzug. This works in concert with the lf configuration file and the
# lf-cleaner script.
diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh
index 411a84d..308690d 100755
--- a/zsh/zscripts/aliasrc.zsh
+++ b/zsh/zscripts/aliasrc.zsh
@@ -1,10 +1,14 @@
-#!/bin/sh
+#!/usr/bin/env zsh
# Replacement programs
-alias \
- htop="htim" \
- mutt="neomutt" \
- sudo="${SUDO-sudo}" \
+typeset -A repaliases=(
+ #alias replacement
+ htop htim
+ mutt neomutt
+ vim nvim
+ sudo "$SUDO"
+)
+for alias rep in ${(kv)repaliases}; do command -v $rep >/dev/null && alias $alias=$rep; done # Tests if replacement exists before creating alias
# Shorten program names
alias \
@@ -19,10 +23,9 @@ alias \
cds="cd ~/.local/bin" \
cdw="cd ~/.local/src/sites" \
hw="cd ~/docs/school" \
- vrc="nvim ~/.config/nvim/init.vim" \
+ vrc="vim ~/.config/nvim/init.vim" \
xrc="cd ~/.config/x11" \
zrc="cd ~/.config/zsh" \
- zhist="vim ~/.local/share/zsh/zhistory" \
# Power scripts
alias \
@@ -58,7 +61,5 @@ alias \
# Clean home directory
alias \
mbsync="mbsync --config $MBSYNCRC" \
- startdwm="startx $X11CONFIG/xinitrc dwm" \
- startpfwm="startx $X11CONFIG/xinitrc picframewm" \
startx="startx $X11CONFIG/xinitrc" \
diff --git a/zsh/zscripts/keybindrc.zsh b/zsh/zscripts/keybindrc.zsh
index 67dfcd5..5e6ee83 100755
--- a/zsh/zscripts/keybindrc.zsh
+++ b/zsh/zscripts/keybindrc.zsh
@@ -5,11 +5,12 @@ bindkey -v # Select viins keymap
KEYTIMEOUT=1
# Keybindings
-autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
+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 '^[[4~' end-of-line # End Key
+bindkey '^[[H' beginning-of-line # Home Key
bindkey '^[[4h' overwrite-mode # Insert Key
bindkey '^D' kill-whole-line # Ctrl-d - delete line
bindkey '^X' clear-screen # Ctrl-x - clear screen
@@ -19,24 +20,10 @@ bindkey '^[[M' delete-word # Ctrl-Delete - delete currect word in front of the
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 '^L' emacs-forward-word # Ctrl-H - go forward 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
-zstyle ':completion:*' menu select
-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
-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
+#bindkey '^H' emacs-backward-word # Ctrl-L - go back one word
# Ignore ctrl-d to exit shell
setopt IGNORE_EOF
diff --git a/zsh/zscripts/zplug.zsh b/zsh/zscripts/zplug.zsh
index 6b86104..587a8c0 100755
--- a/zsh/zscripts/zplug.zsh
+++ b/zsh/zscripts/zplug.zsh
@@ -1,6 +1,6 @@
#!/usr/bin/env zsh
-local zplugs="${ZDOTDIR:-~/.}${ZDOTDIR:+/}zplugs" # Declare videos using `local` to keep variables away from interactive shell
+local zplugs="${ZDOTDIR:-~/.}${ZDOTDIR:+/}zplugs" # Declare all variables using `local` to keep them away from the interactive shell
local zplugins="${ZPLUGINSDIR:-/usr/local/share/zsh/zplugins}"
[[ $EUID != 0 ]] && local sudo=${SUDO-sudo}
diff --git a/zsh/zscripts/zshcompmenu.zsh b/zsh/zscripts/zshcompmenu.zsh
new file mode 100755
index 0000000..0d471a5
--- /dev/null
+++ b/zsh/zscripts/zshcompmenu.zsh
@@ -0,0 +1,18 @@
+#!/usr/bin/env zsh
+
+# Basic auto/tab complete
+autoload -U compinit
+zstyle ':completion:*' menu select
+zmodload zsh/complist
+compinit -d "${XDG_CACHE_HOME:-$HOME/.config}/zcompdump" # Change where .zcompdump is stored
+_comp_options+=(globdots) # Include hidden files.
+
+# Use ctrl-vi keys in tab complete menu
+bindkey -M menuselect '^h' vi-backward-char
+bindkey -M menuselect '^j' vi-down-line-or-history
+bindkey -M menuselect '^k' vi-up-line-or-history
+bindkey -M menuselect '^l' vi-forward-char
+bindkey -v '^?' backward-delete-char
+
+# Options
+setopt MENU_COMPLETE # Immediately insert first option from completion menu
diff --git a/zsh/zshrc b/zsh/zshrc
index bef8f9c..e57b70d 100755
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,6 +1,6 @@
#!/usr/bin/env zsh
-# Zsh scripts
+# Zsh scripts (load general scripts, then host specific scripts, then scripts prepended with !)
for zscript in "$XDG_CONFIG_HOME/zsh/zscripts"{/[^\!]*.zsh,/hosts/*.$HOST.zsh,/!*.zsh}; do source "$zscript"; done 2>/dev/null
# Colors! + Prompt
@@ -12,20 +12,19 @@ setopt AUTO_CD # `cd` is implied
#setopt CDABLE_VARS # '~/' is implied for `cd` (doesn't work?)
# History settings
-HISTSIZE=500 # Max lines of history loaded into memory
-SAVEHIST=10000000 # Max lines of history saved to the histfile
-setopt EXTENDED_HISTORY # Save superfluous info with command to reduce disk writes
+HISTFILE="${ZHISTFILE:-$HOME/.zhistory}"
+HISTSIZE=500 # Max lines of history loaded into memory for each zsh session
+SAVEHIST=10000000 # Max lines of history saved to HISTFILE before overwriting
+setopt EXTENDED_HISTORY # Save superfluous info with command to reduce disk writes when using INC_APPEND_HISTORY or SHARE_HISTORY
setopt HIST_IGNORE_DUPS # Successive duplicate entries ignored
setopt HIST_IGNORE_SPACE # Entries with leading space ignored
-setopt HIST_REDUCE_BLANKS
+setopt HIST_REDUCE_BLANKS # Remove superfluous blank characters before saving
setopt INC_APPEND_HISTORY # Create entries after each command, not after zsh exits
setopt SHARE_HISTORY # Share history between zsh sessions
-# Zsh completion settings
-setopt MENU_COMPLETE # Insert first option immediately in completion menu instead of just showing menu
-
# Input/output settings
-setopt INTERACTIVE_COMMENTS # Comments work as expected in interactive shell
+setopt INTERACTIVE_COMMENTS # Comments won't be interpreted in an interactive zsh session
+setopt +o NOMATCH # Non-existant wildcard matches won't produce an error
# tmp thing
[ $TTY = /dev/tty2 ] && "/home/timmy/.local/opt/shell-color-scripts/colorscripts/$(ls /home/timmy/.local/opt/shell-color-scripts/colorscripts 2>/dev/null | shuf -n1)" 2>/dev/null