summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzprofile3
-rw-r--r--zscripts/dockeraliases.zsh19
-rwxr-xr-xzscripts/nicegit.zsh7
-rwxr-xr-xzscripts/vicursor.zsh31
4 files changed, 42 insertions, 18 deletions
diff --git a/zprofile b/zprofile
index 39fa6b1..68b5f86 100755
--- a/zprofile
+++ b/zprofile
@@ -14,7 +14,6 @@ export SUDO='doas'
export XDG_CACHE_HOME="$HOME/.cache"
export ANSIBLE_GALAXY_CACHE_DIR="${XDG_CACHE_HOME}/ansible/galaxy_cache"
export DOCKER_CONFIG="$XDG_CACHE_HOME/docker"
-export XAUTHORITY="$XDG_CACHE_HOME/Xauthority"
export XDG_CONFIG_HOME="$HOME/.config"
export ANSIBLE_HOME="${XDG_CONFIG_HOME}/ansible"
@@ -39,6 +38,8 @@ export XDG_STATE_HOME="$HOME/.local/state"
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
+export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
+
# Path
setopt nullglob # Set in case .local/bin doesn't exist
for lbin in "$HOME/.local/bin"{/,/*/}; do export PATH="${lbin%/}:$PATH"; done 2>/dev/null # Add ~/.local/bin and all sub dirs
diff --git a/zscripts/dockeraliases.zsh b/zscripts/dockeraliases.zsh
new file mode 100644
index 0000000..93a969c
--- /dev/null
+++ b/zscripts/dockeraliases.zsh
@@ -0,0 +1,19 @@
+#!/usr/bin/env zsh
+
+alias \
+ dc="docker compose" \
+ dcl="docker compose logs -f" \
+ dcb="docker compose build" \
+ dcu="docker compose up" \
+ dcd="docker compose down" \
+ dcr="docker compose restart" \
+
+
+function dce() {
+ local shells=("/bin/bash" "/bin/sh")
+ local service=$1
+ shift
+ for shell in ${shells[@]}; do
+ docker compose exec -it $service $shell $@ && return
+ done
+}
diff --git a/zscripts/nicegit.zsh b/zscripts/nicegit.zsh
index 3538284..e191bd0 100755
--- a/zscripts/nicegit.zsh
+++ b/zscripts/nicegit.zsh
@@ -24,6 +24,13 @@ function gc() {
git commit -m "$commit"
}
+function gcf() {
+ issue="$1"
+ [ -z "$issue" ] && return
+ shift
+ gc "$@\n\nfixes: $issue"
+}
+
function __is_diff() {
! git diff --quiet HEAD $REF -- $DIR
}
diff --git a/zscripts/vicursor.zsh b/zscripts/vicursor.zsh
index 3e4320d..a66ad64 100755
--- a/zscripts/vicursor.zsh
+++ b/zscripts/vicursor.zsh
@@ -2,20 +2,17 @@
# 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
-
+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