summaryrefslogtreecommitdiff
path: root/zsh/zscripts
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 /zsh/zscripts
parent4af49ed67fbf358674d45fb8af3c4c3efaf90f58 (diff)
downloaddotconfig-a0943a0a387400afc8e49e7a626532e73990d24f.tar.xz
dotconfig-a0943a0a387400afc8e49e7a626532e73990d24f.zip
bunch more stuff
Diffstat (limited to 'zsh/zscripts')
-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
5 files changed, 36 insertions, 30 deletions
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