diff options
Diffstat (limited to '')
-rw-r--r-- | dot_config/zsh/aliasrc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/dot_config/zsh/aliasrc b/dot_config/zsh/aliasrc index 0b2b91d..75903ee 100644 --- a/dot_config/zsh/aliasrc +++ b/dot_config/zsh/aliasrc @@ -3,19 +3,23 @@ # Use neovim for vim if present. [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" +# If code-insiders exists and code does not, use code-insiders. +[ -x "$(command -v code-insiders)" ] && [ ! -x "$(command -v code)" ] && alias code="code-insiders" + # Use $XINITRC variable if file exists. -[ -f "$XINITRC" ] && alias startx="startx $XINITRC" +[ -f "$XINITRC" ] && alias startx='startx "$XINITRC"' # sudo not required for some system commands for x in mount umount sv emerge apt pacman updatedb su ; do + # shellcheck disable=SC2139 alias $x="sudo $x" done -if command -v doas &>/dev/null +if command -v doas >/dev/null 2>&1 then alias sudo='doas' else - alias sudo='sudo ' + alias sudo='sudo -E' fi # Verbosity and settings that you pretty much just always are going to want. @@ -32,6 +36,7 @@ alias \ du="dust -r" \ free="free -m" \ gdb='gdb -q -nh -x "$XDG_CONFIG_HOME/gdb/init"' \ + wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"' \ # Colorize commands when possible. alias \ @@ -39,7 +44,7 @@ alias \ ll="eza -alg --group-directories-first" \ lt='eza -aTF --group-directories-first' \ lr='eza -aRF' \ - grep="rg --color=auto" \ + grep="rg --color=auto --hyperlink-format=file://{wslprefix}{path}" \ diff="delta" \ cat='bat --paging=never --style=plain' \ @@ -50,8 +55,8 @@ alias \ trem="transmission-remote" \ YT="youtube-viewer" \ sdn="sudo shutdown -h now" \ - e="$EDITOR" \ - v="$EDITOR" \ + e="\$EDITOR" \ + v="\$EDITOR" \ em="sudo emerge" \ p="sudo pacman" \ xi="sudo xbps-install" \ @@ -60,3 +65,8 @@ alias \ z="zathura" alias adb='HOME="$XDG_DATA_HOME"/android adb' + +# Use the SSH kitten when possible. (but not already in SSH) +if [ "$TERM" = "xterm-kitty" ] && [ -z "$SSH_TTY" ]; then + alias sshs='sshs -t "kitten ssh \"{{{name}}}\""' +fi
\ No newline at end of file |