zshrc: Remove vterm, add SSH/ gpg tweaks
parent
448a85d588
commit
73a76e7586
32
zsh/.zshrc
32
zsh/.zshrc
|
@ -63,37 +63,11 @@ zreload() {
|
|||
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||
}
|
||||
|
||||
# Emacs/ vterm
|
||||
vterm_printf(){
|
||||
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ] ); then
|
||||
# Tell tmux to pass the escape sequences through
|
||||
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
|
||||
elif [ "${TERM%%-*}" = "screen" ]; then
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
printf "\eP\e]%s\007\e\\" "$1"
|
||||
else
|
||||
printf "\e]%s\e\\" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
|
||||
alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear'
|
||||
# w/ SSH
|
||||
if [[ "$HOST" == core.envs.net ]]; then
|
||||
export GPG_TTY=$(tty)
|
||||
fi
|
||||
|
||||
vterm_cmd() {
|
||||
local vterm_elisp
|
||||
vterm_elisp=""
|
||||
while [ $# -gt 0 ]; do
|
||||
vterm_elisp="$vterm_elisp""$(printf '"%s" ' "$(printf "%s" "$1" | sed -e 's|\\|\\\\|g' -e 's|"|\\"|g')")"
|
||||
shift
|
||||
done
|
||||
vterm_printf "51;E$vterm_elisp"
|
||||
}
|
||||
|
||||
find_file() {
|
||||
vterm_cmd find-file "$(realpath "${@:-.}")"
|
||||
}
|
||||
|
||||
# PLUGINS!
|
||||
# `miniplug update`
|
||||
|
||||
|
|
Loading…
Reference in New Issue