summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-04-17 10:46:33 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2022-04-17 10:46:33 -0500
commit06b0c7eb739fd430aacbb46f183cea4aaf17300a (patch)
treeb87398a7ed71ed22d4c43c42f274fbff12c1d578
parentaff2302d113a71aee647ab71336e8d68bb844653 (diff)
downloaddotconfig-06b0c7eb739fd430aacbb46f183cea4aaf17300a.tar.xz
dotconfig-06b0c7eb739fd430aacbb46f183cea4aaf17300a.zip
small changes to zsh and st configsa
-rw-r--r--htop/htoprc4
-rwxr-xr-xlf/scope5
-rwxr-xr-xnvim/init.vim14
-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
14 files changed, 69 insertions, 87 deletions
diff --git a/htop/htoprc b/htop/htoprc
index 572a374..0eb61a0 100644
--- a/htop/htoprc
+++ b/htop/htoprc
@@ -2,7 +2,7 @@
# The parser is also very primitive, and not human-friendly.
fields=0 48 124 46 47 109 110 17 2 18 49 16 1
sort_key=46
-sort_direction=1
+sort_direction=-1
tree_sort_key=124
tree_sort_direction=1
hide_kernel_threads=1
@@ -11,6 +11,7 @@ shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=1
+highlight_deleted_exe=1
highlight_megabytes=1
highlight_threads=1
highlight_changes=0
@@ -20,6 +21,7 @@ strip_exe_from_cmdline=1
show_merged_command=0
tree_view=0
tree_view_always_by_pid=0
+all_branches_collapsed=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_one=1
diff --git a/lf/scope b/lf/scope
index 4058543..39fdfef 100755
--- a/lf/scope
+++ b/lf/scope
@@ -26,6 +26,11 @@ ifub() {
# be regenerated once seen.
case "$(file --dereference --brief --mime-type -- "$1")" in
+ image/svg+xml)
+ gencacheimage "$1" ".png"
+ [ ! -f "$CACHE" ] && convert -background none "$1" "$CACHE"
+ image "$CACHE" "$2" "$3" "$4" "$5"
+ ;;
image/*) image "$1" "$2" "$3" "$4" "$5" ;;
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
text/troff) man ./ "$1" | col -b ;;
diff --git a/nvim/init.vim b/nvim/init.vim
index ab3a9d3..e017191 100755
--- a/nvim/init.vim
+++ b/nvim/init.vim
@@ -81,14 +81,20 @@ vnoremap . :normal .<CR>
cnoremap w!! execute 'silent! write !doas tee % >/dev/null' <bar> edit!
" Capitalize every word on the line
nmap gcc :s/\v<(.)(\w*)/\u\1\L\2/g<CR>
+nmap gCC :%s/\v<(.)(\w*)/\u\1\L\2/g<CR>
+" HTML shortcuts
+nmap gwp I<p><ESC>l4xA</p><ESC>
+nmap gwh1 I<h1><ESC>l5xA</h1><ESC>
+nmap gwh2 I<h2><ESC>l5xA</h2><ESC>
+nmap gwh3 I<h3><ESC>l5xA</h3><ESC>
"" Extra functionality
" Colorscheme for root and normal users (since vimrc is just symlinked to the root user's home)
if ($USER) == 'root'
- colorscheme zellner
+ colorscheme koehler
else
if empty($DISPLAY)
- colorscheme default
+ colorscheme koehler
else
set bg=dark
let g:gruvbox_contrast_dark = 'hard'
@@ -131,8 +137,8 @@ endif
" Automatically deletes all trailing whitespace on save
function DelWS()
- :norm m`
+ let l:save_view = winsaveview()
:%s/\s*$//e
- :norm g``
+ call winrestview(l:save_view)
endfunction
autocmd BufWritePre * call DelWS()
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