From b0d2ed88cadd9fd50aa64dc7c1b1e1adc7c183b7 Mon Sep 17 00:00:00 2001 From: HerrCraziDev Date: Thu, 23 Mar 2023 11:14:01 +0100 Subject: [PATCH] completion and prompt tweaks --- .zshrc | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 5e2c6d0..0faa439 100644 --- a/.zshrc +++ b/.zshrc @@ -16,9 +16,52 @@ if [ -d $ZSH ]; then fi # Personal prompt -export PROMPT="%F{yellow}[ %F{green}%B%n%F{yellow}@%F{cyan}%m %F{blue}%~%b %F{yellow}] %(!.%F{red}.%F{yellow})%B$%b%f " +if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then + c_host='%F{magenta}%M%f' +else + c_host='%F{cyan}%m%f' +fi +export PROMPT="%F{yellow}[ %F{green}%B%n%F{yellow}@$c_host %F{blue}%~%b %F{yellow}] %(!.%F{red}.%F{yellow})%B$%b%f " export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH #Load personal term dotfiles source "$HOME/.termrc" + + +# The following lines were added by compinstall + +zstyle ':completion:*' completer _list _expand _complete _ignored _approximate _prefix +zstyle ':completion:*' expand prefix +zstyle ':completion:*' file-sort name +zstyle ':completion:*' ignore-parents parent +zstyle ':completion:*' list-colors '' +zstyle ':completion:*' matcher-list '+m:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=** r:|=**' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' +zstyle ':completion:*' max-errors 3 +zstyle ':completion:*' menu select=long +zstyle ':completion:*' preserve-prefix '//[^/]##/' +zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s +zstyle ':completion:*' squeeze-slashes true +zstyle :compinstall filename '/home/glrf/.zshrc' + +# Prevent suggesting items already present +zstyle ':completion:*:rm:*' ignore-line yes +zstyle ':completion:*:mv:*' ignore-line yes +zstyle ':completion:*:cp:*' ignore-line yes + +# Complete 'sudo' - add root paths +zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin + + +# Load completion +autoload -Uz compinit +compinit +# End of lines added by compinstall + +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=100000 +SAVEHIST=100000 +setopt autocd beep notify +bindkey -e +# End of lines configured by zsh-newuser-install