diff options
author | Timmy Keller <tjk@tjkeller.xyz> | 2022-11-03 11:55:33 -0500 |
---|---|---|
committer | Timmy Keller <tjk@tjkeller.xyz> | 2022-11-03 11:55:33 -0500 |
commit | 0146107851a7f6a05b1a2146e275b631edf20338 (patch) | |
tree | 2652b7d3a04cc32656b54bd7f2ab1dfed56847b2 /zsh/zscripts | |
parent | a0943a0a387400afc8e49e7a626532e73990d24f (diff) | |
download | dotconfig-0146107851a7f6a05b1a2146e275b631edf20338.tar.xz dotconfig-0146107851a7f6a05b1a2146e275b631edf20338.zip |
idk
Diffstat (limited to 'zsh/zscripts')
-rwxr-xr-x | zsh/zscripts/aliasrc.zsh | 7 | ||||
-rwxr-xr-x | zsh/zscripts/termuxprompt.zsh | 8 | ||||
-rwxr-xr-x | zsh/zscripts/zplug.zsh | 6 |
3 files changed, 17 insertions, 4 deletions
diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh index 308690d..8d2f86b 100755 --- a/zsh/zscripts/aliasrc.zsh +++ b/zsh/zscripts/aliasrc.zsh @@ -6,10 +6,11 @@ typeset -A repaliases=( htop htim mutt neomutt vim nvim - sudo "$SUDO" + 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 \ open="xdg-open" \ @@ -63,3 +64,7 @@ alias \ mbsync="mbsync --config $MBSYNCRC" \ startx="startx $X11CONFIG/xinitrc" \ +# Copy-pasting from internet +alias \ + \$="" \ + \#="${SUDO-sudo}" \ diff --git a/zsh/zscripts/termuxprompt.zsh b/zsh/zscripts/termuxprompt.zsh new file mode 100755 index 0000000..1442cc8 --- /dev/null +++ b/zsh/zscripts/termuxprompt.zsh @@ -0,0 +1,8 @@ +#!/usr/bin/env zsh + +if [ -n "$TERMUX_VERSION" ]; then + PS1="%B%F{green}[%F{blue}%U%~%u%F{green}]%f%b%(!.#.$) " + PS1OVERRIDE=1 + export ZPLUGINSDIR=~/.local/share/zsh/zplugins + export ZPLUGNOROOT=1 +fi diff --git a/zsh/zscripts/zplug.zsh b/zsh/zscripts/zplug.zsh index 587a8c0..b3eff09 100755 --- a/zsh/zscripts/zplug.zsh +++ b/zsh/zscripts/zplug.zsh @@ -1,12 +1,12 @@ #!/usr/bin/env zsh 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} +local zplugins="${ZPLUGINSDIR:-/usr/local/share/zsh/zplugins}" # TODO set default dir if zplugnoroot +[[ $EUID != 0 ]] && [ -z "$ZPLUGNOROOT" ] && local sudo=${SUDO-sudo} function __zplugInstall() { touch "$zplugs" - local pluglist=( `grep -v '#' "$zplugs"` ) + local pluglist=( `\grep -v '#' "$zplugs"` ) local confirm plug shift for plug in "$@"; do; pluglist+=(${plug}); done |