From e0dc8694715a728b95913f903ad82772f7a134de Mon Sep 17 00:00:00 2001 From: lhark Date: Fri, 23 Nov 2018 13:39:57 -0500 Subject: [PATCH] [zshrc] Add support for Kitty term emulator --- functions | 5 +++++ zshrc | 30 +++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/functions b/functions index b88ce63..d0922b4 100755 --- a/functions +++ b/functions @@ -89,4 +89,9 @@ ymsearch() { mpv --ytdl-format=bestaudio ytdl://ytsearch:"$(xsel -ob)" } +# Kitty terminfo setup for ssh +ssh_kitty () { + kitty +kitten ssh "$@" +} + # vim: ft=zsh diff --git a/zshrc b/zshrc index 03e1d3f..ba87527 100644 --- a/zshrc +++ b/zshrc @@ -51,6 +51,12 @@ colors # Term specific hacks case $TERM in + *kitty) + preexec () { + print -n "\e]0;kitty - $1 - ${HOST} - ${PWD}\a" + } + alias ssh='ssh_kitty' + ;; xterm*) preexec () { print -n "\e]0;xterm - $1 - ${HOST} - ${PWD}\a" @@ -100,6 +106,17 @@ HISTFILE=~/.history HISTTIMEFORMAT="%d/%m %H:%M:%S " +###################### +# Load ZSH functions # +###################### + +zmodload zsh/complist +autoload -U compinit promptinit +compinit +colors +autoload -U zsh-mime-setup + + ###################### # Completion options # ###################### @@ -138,17 +155,8 @@ zstyle ':completion:*:manuals' separate-sections true # comme la recherche d'un paquet aptitude install moz zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zs - - -###################### -# Load ZSH functions # -###################### - -zmodload zsh/complist -autoload -U compinit promptinit -compinit -colors -autoload -U zsh-mime-setup +# Enable ssh completion for kitty ssh +compdef ssh_kitty=ssh ################