From d9fad010143297224534f0ae02a6d75d814465c7 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 10 Jul 2025 22:51:26 +0200 Subject: add systemd user service for ssh agent and zshrc --- zshrc | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 zshrc (limited to 'zshrc') diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..935339c --- /dev/null +++ b/zshrc @@ -0,0 +1,44 @@ +autoload -Uz compinit +autoload colors ; colors +autoload -U edit-command-line + +compinit + +HISTFILE=~/.histfile +HISTSIZE=900000 +SAVEHIST=200000 +setopt appendhistory nomatch +unsetopt autocd beep extendedglob notify + +# set line editing to vim +zle -N edit-command-line +bindkey -M vicmd v edit-command-line + +PS1="$(print '%{\e[1;30m%}[%{\e[1;31m%}%*%{\e[1;30m%}]%{\e[0m%} %{\e[1;30m%}[%{\e[1;31m%}%n%{\e[1;30m%}-%{\e[1;31m%}%m%{\e[1;30m%}]%{\e[1;31m%} %2d %{\e[0m%}')" + +bindkey -v '^[[3~' delete-char +bindkey -v '^[[4~' end-of-line +bindkey -v '^[OF' end-of-line +bindkey -v '^[[F' end-of-line +bindkey -v '^[[1~' beginning-of-line +bindkey -v '^[[H' beginning-of-line +bindkey -v '^[OH' beginning-of-line +bindkey -v '^[[5~' history-beginning-search-backward +bindkey -v '^[[6~' history-beginning-search-forward +bindkey -v '^K' history-search-backward +bindkey -v '^J' history-search-forward +bindkey -v '^R' history-incremental-search-backward +bindkey -v '^T' history-incremental-search-forward +bindkey -v '^[^?' backward-delete-word + +# environment setup +export EDITOR="vim" +export PAGER="less -FXR" + +# load any SSH keys into the agent +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent/agent.sock" +keys_loaded="$( ssh-add -l | grep 'has no ident' | wc -l )" +if [ "$keys_loaded" -eq "1" ]; then + ssh-add +fi +ssh-add -l -- cgit v1.2.3-70-g09d2