From 6f0ca4a0b6366b9c33e9366e08aa1b14e1037e8a Mon Sep 17 00:00:00 2001
From: Timmy Keller <tjk@tjkeller.xyz>
Date: Wed, 16 Mar 2022 23:32:06 -0500
Subject: zscripts and profiles

---
 zsh/profile/zprofile.G3N2         |  5 ++++
 zsh/profile/zprofile.librex60     |  7 +++++
 zsh/profile/zprofile.voidx250     |  5 ++++
 zsh/zscripts/aliasrc.G3N2.zsh     |  6 +++++
 zsh/zscripts/aliasrc.librex60.zsh |  7 +++++
 zsh/zscripts/aliasrc.voidx250.zsh |  8 ++++++
 zsh/zscripts/aliasrc.zsh          | 55 +++++++++++++++++++++++++++++++++++++++
 zsh/zscripts/colors.G3N2.zsh      |  7 +++++
 zsh/zscripts/keybindrc.zsh        | 41 +++++++++++++++++++++++++++++
 zsh/zscripts/lfub.zsh             | 27 +++++++++++++++++++
 zsh/zscripts/vicursor.zsh         | 21 +++++++++++++++
 11 files changed, 189 insertions(+)
 create mode 100644 zsh/profile/zprofile.G3N2
 create mode 100644 zsh/profile/zprofile.librex60
 create mode 100644 zsh/profile/zprofile.voidx250
 create mode 100755 zsh/zscripts/aliasrc.G3N2.zsh
 create mode 100755 zsh/zscripts/aliasrc.librex60.zsh
 create mode 100755 zsh/zscripts/aliasrc.voidx250.zsh
 create mode 100755 zsh/zscripts/aliasrc.zsh
 create mode 100755 zsh/zscripts/colors.G3N2.zsh
 create mode 100755 zsh/zscripts/keybindrc.zsh
 create mode 100755 zsh/zscripts/lfub.zsh
 create mode 100755 zsh/zscripts/vicursor.zsh

diff --git a/zsh/profile/zprofile.G3N2 b/zsh/profile/zprofile.G3N2
new file mode 100644
index 0000000..4bc5886
--- /dev/null
+++ b/zsh/profile/zprofile.G3N2
@@ -0,0 +1,5 @@
+#!/usr/bin/env zsh
+
+export ZPLUGINS="/home/timmy/.local/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
+
+source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/profile/zprofile.librex60 b/zsh/profile/zprofile.librex60
new file mode 100644
index 0000000..18860a5
--- /dev/null
+++ b/zsh/profile/zprofile.librex60
@@ -0,0 +1,7 @@
+#!/usr/bin/env zsh
+
+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
diff --git a/zsh/profile/zprofile.voidx250 b/zsh/profile/zprofile.voidx250
new file mode 100644
index 0000000..bb7e164
--- /dev/null
+++ b/zsh/profile/zprofile.voidx250
@@ -0,0 +1,5 @@
+#!/usr/bin/env zsh
+
+export ZPLUGINS="/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
+
+source /home/timmy/.config/zsh/zprofile
diff --git a/zsh/zscripts/aliasrc.G3N2.zsh b/zsh/zscripts/aliasrc.G3N2.zsh
new file mode 100755
index 0000000..8e8d2a5
--- /dev/null
+++ b/zsh/zscripts/aliasrc.G3N2.zsh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Package Management
+alias \
+	e="sudo emerge" \
+
diff --git a/zsh/zscripts/aliasrc.librex60.zsh b/zsh/zscripts/aliasrc.librex60.zsh
new file mode 100755
index 0000000..87f7e08
--- /dev/null
+++ b/zsh/zscripts/aliasrc.librex60.zsh
@@ -0,0 +1,7 @@
+#!/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
new file mode 100755
index 0000000..4681ace
--- /dev/null
+++ b/zsh/zscripts/aliasrc.voidx250.zsh
@@ -0,0 +1,8 @@
+#!/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
new file mode 100755
index 0000000..16bb675
--- /dev/null
+++ b/zsh/zscripts/aliasrc.zsh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# Replacement programs
+alias \
+	htop="htim" \
+	mutt="neomutt" \
+	sudo="doas" \
+
+# Shorten program names
+alias \
+	open="xdg-open" \
+	smci="sudo make clean install" \
+	smi="sudo make install" \
+	su="sudo su" \
+
+# Quick navigate to directories / open specific files
+alias \
+	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" \
+	exa="exa --icons -a --group-directories-first" \
+	grep="grep --color=auto -I --ignore-case --line-number" \
+	ls="ls -vAhN --color=auto --group-directories-first" \
+	bat="bat --theme=Monokai\ Extended" \
+
+# (Non)-Verbosity
+alias \
+	br="br -h" \
+	cp="cp -iv" \
+	ffmpeg="ffmpeg -hide_banner" \
+	ffprobe="ffprobe -hide_banner" \
+	mkd="mkdir -p" \
+	mv="mv -iv" \
+	rm="rm -v" \
+
+# Clean home directory
+alias \
+	startdwm="\startx $XDG_CONFIG_HOME/x11/xinitdwmrc" \
+	startx="startx $XINITRC" \
+
diff --git a/zsh/zscripts/colors.G3N2.zsh b/zsh/zscripts/colors.G3N2.zsh
new file mode 100755
index 0000000..f6c1a90
--- /dev/null
+++ b/zsh/zscripts/colors.G3N2.zsh
@@ -0,0 +1,7 @@
+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
new file mode 100755
index 0000000..90c1e16
--- /dev/null
+++ b/zsh/zscripts/keybindrc.zsh
@@ -0,0 +1,41 @@
+#!/usr/bin/env zsh
+
+# Vi mode + requirements for ALL keybindings to work correctly
+bindkey -v
+export KEYTIMEOUT=1
+
+# Unbind some default keybindings
+#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
+
+# 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
+
+# Ignore ctrl-d to exit shell
+setopt ignore_eof
diff --git a/zsh/zscripts/lfub.zsh b/zsh/zscripts/lfub.zsh
new file mode 100755
index 0000000..309a0dc
--- /dev/null
+++ b/zsh/zscripts/lfub.zsh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# This is a wrapper script for lb that allows it to create image previews with
+# ueberzug. This works in concert with the lf configuration file and the
+# lf-cleaner script.
+
+cleanuplf() {
+	exec 3>&-
+	\rm "$FIFO_UEBERZUG"
+}
+
+lfub() {
+	dircache=/tmp/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
+		exec 3>"$FIFO_UEBERZUG"
+		trap cleanuplf HUP INT QUIT TERM PWR EXIT
+		lf "$lfopt" "$@" 3>&-
+	fi
+	[ -f "$dircache" ] && dir="$(cat "$dircache")" && [ -d "$dir" ] && cd "$dir"
+}
+
+alias "lf=lfub"
diff --git a/zsh/zscripts/vicursor.zsh b/zsh/zscripts/vicursor.zsh
new file mode 100755
index 0000000..3e4320d
--- /dev/null
+++ b/zsh/zscripts/vicursor.zsh
@@ -0,0 +1,21 @@
+#!/usr/bin/env zsh
+
+# Change cursor shape for different vi modes
+# Copied from 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
+
-- 
cgit v1.2.3