Show Us Your baschrc or zshrc or Whatever-rc

Hi great team,
i haven’t found this topic before and i like script creation, share it
Here mine

with the script

#!/bin/bash

[[ $- == *i* && $BASH_VERSION ]] && SHELL=/bin/bash || return 0

# set some defaults
export MANWIDTH=90
export HISTSIZE=10000
export HISTIGNORE="q:f:v"

# colors in less (manpager)
export LESS_TERMCAP_mb=$'\e[01;31m'
export LESS_TERMCAP_md=$'\e[01;31m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;44;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[01;32m'

# ensure ~/bin is on the path
[[ $PATH =~ ~/bin ]] || PATH=~/bin:$PATH

set -o vi
set -o notify

shopt -s direxpand
shopt -s checkhash
shopt -s sourcepath
shopt -s expand_aliases
shopt -s autocd cdspell
shopt -s extglob dotglob
shopt -s no_empty_cmd_completion
shopt -s autocd cdable_vars cdspell
shopt -s cmdhist histappend histreedit histverify
[[ $DISPLAY ]] && shopt -s checkwinsize

# prompt if file sourcing below fails
#PS1='[\u@\h \W]\$ '
PS1='[\u@\h \W] : > '

al-info
3 Likes

Thanks for sharing but in future please used code tags.

ok, sorry.

It’s all good man, it just makes the text a whole lot more readable.

Looks good - clean and simple. My is such a mess :smiley:

1 Like

Looks great @Naltap . Good idea in there.

This is my .zshrc

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

export ZSH=$HOME/.oh-my-zsh

ZSH_THEME="powerlevel10k/powerlevel10k"

# CASE_SENSITIVE="true"

typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

# HYPHEN_INSENSITIVE="true"
# DISABLE_AUTO_UPDATE="true"
# export UPDATE_ZSH_DAYS=13
# DISABLE_LS_COLORS="true"
# DISABLE_AUTO_TITLE="true"
# ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
plugins=(
git 
history
globalias
history-substring-search
zsh-autosuggestions
colored-man-pages
chucknorris)

source $ZSH/oh-my-zsh.sh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

#-----------------------------
# Alias
#-----------------------------
    alias d='clear'
    alias q='exit 0'
    alias v='nvim'
    alias p='pacman'
    alias nano='nano -I'
    alias la='ls -Ah'
    alias ll='ls -lAh'
    alias mkdir='mkdir -p'
    alias xp='xprop | awk -F\"'" '/CLASS/ {printf \"NAME = %s\nCLASS = %s\n\", \$2, \$4}'"
    alias music="ncmpcpp -S visualizer"
    alias merge="xrdb -merge ~/.Xresources"
    alias font="sudo fc-cache -f -v"
    alias ana="systemd-analyze"
    alias anab="systemd-analyze blame"
    alias find='sudo find / -name'
  	
    ## UPDATING AND INSTALLING
    alias i='sudo pacman -S'
    alias u='sudo pacman -Syu'
    alias r='sudo pacman -R'
    alias Rr='sudo pacman -Rsc'
    alias y='yay'
    alias ys-'yay -S'
    alias clean='yay -Scc'
    alias orphan='yay -Rs $(pacman -Qtdq)'

    ## GIT
    alias ga='git add .'
    alias gb='git branch'
    alias gc='git clone'
    alias gch='git checkout'
    alias gcm='git commit -m'
    alias gf='git fetch'
    alias gp='git pull'
    alias gpo='git push origin master'
       
    ## PACMAN
    alias listfiles='pacman -Ql'
    alias whoisorphan='pacman -Qdt'
    alias upmirrors='sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup; sudo reflector -l 5 --sort rate --save /etc/pacman.d/mirrorlist'
    alias paclog='tail -f /var/log/pacman.log'
    alias pacul='sudo rm /var/lib/pacman/db.lck'

    alias rms="echo 'I'\''d just like to interject for a moment.  What you'\''re referring to as Linux,
is in fact, GNU/Linux, or as I'\''ve recently taken to calling it, GNU plus Linux.
Linux is not an operating system unto itself, but rather another free component
of a fully functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day,
without realizing it.  Through a peculiar turn of events, the version of GNU
which is widely used today is often called \"Linux\", and many of its users are
not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a
part of the system they use.  Linux is the kernel: the program in the system
that allocates the machine'\''s resources to the other programs that you run.
The kernel is an essential part of an operating system, but useless by itself;
it can only function in the context of a complete operating system.  Linux is
normally used in combination with the GNU operating system: the whole system
is basically GNU with Linux added, or GNU/Linux.  All the so-called \"Linux\"
distributions are really distributions of GNU/Linux.'"

frankenfetch

source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
source <(cod init $$ zsh)

Just edited the title to include other shells :smiley:

Mine’s a bit large but not too bad considering no frameworks.

zshrc

#!/bin/zsh

if [[ $- != *i* ]]; then
	return
elif [[ $PROFILE_ZSHRC ]]; then
	zmodload zsh/zprof
fi

SHELL=/bin/zsh
KEYTIMEOUT=1
SAVEHIST=10000
HISTSIZE=10000
HISTFILE="$HOME/.cache/.zsh_history"
CDPATH='.:~:/media/wdblue/git:/media/wdblue'
SF_USERNAME="smokeking"
AL_BASE_PATH="/media/wdblue/git/archlabs"

export EDITOR=nvim
export VISUAL=nvim
export MANWIDTH=120
export LESS='-R'
export LESSHISTFILE=-
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[32m'
export LESS_TERMCAP_mb=$'\e[31m'
export LESS_TERMCAP_md=$'\e[31m'
export LESS_TERMCAP_so=$'\e[47;30m'
export LESSPROMPT='?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...'

typeset -Ug fpath=($HOME/.zsh/fpath $fpath)
typeset -g  comppath="$HOME/.cache"
typeset -g  compfile="$comppath/.zcompdump"

[[ -w "$compfile" ]] || rm -rf "$compfile" >/dev/null 2>&1

if [[ $TERM == 'linux' ]]; then
	sudo kbdrate -r 70 -d 300 >/dev/null 2>&1
	col=("\e]P0111111" "\e]P1EE5555" "\e]P288BB88" "\e]P3FFCC66"  # 0-3
		 "\e]P46699CC" "\e]P5AA88CC" "\e]P655CCFF" "\e]P7CCCCCC"  # 4-7
		 "\e]P8222222" "\e]P9FF4444" "\e]PA66BB66" "\e]PBEE8844"  # 8-11
		 "\e]PC3388EE" "\e]PDDD88DD" "\e]PE44DDEE" "\e]PFFFFFFF") # 12-15
	printf "%b" "${col[@]}" && clear && unset col
fi

alias g='git'
alias v='nvim'
alias q='[[ $TMUX ]] && { exit; exit 0; } || exit'
alias f='noice'
alias vi='nvim'
alias vim='nvim'
alias la='ls -Ah'
alias ll='ls -lAh'
alias vd='nvim -d'
alias sv='sudo nvim'
alias sf='sudo noice'
alias sp='sudo pacman'
alias pls='pacman -Ql'
alias mkdir='mkdir -p'
alias grep='grep --color=auto'
alias hex2dec="printf '%d\n'"
alias dec2hex="printf '0x%x\n'"
alias bunny='printf "\n{\_/}\n(• •)\n/⊃ ⊃\n"'
alias calc='python -qi -c "from math import *"'
alias timer='time read -p "Press enter to stop"'
alias xeph='Xephyr -br -ac -noreset -screen 1920x1080 :1'
alias sx='startx -- -keeptty > ~/.local/share/xorg/Xorg.0.log 2>&1'
alias grabcol='grabpixel | xclip -i -selection clipboard'
alias broken='sudo find . -type l -! -exec test -e {} \; -print'
alias smk='make clean && make && sudo make install && make clean'
alias xpaste="xclip -i <<< '\$(curl -ns -F 'f:1=<-' http://ix.io)'"
alias cam='ffplay -f video4linux2 -i /dev/video0 -video_size 720x720'
alias spkg='makepkg --printsrcinfo > .SRCINFO && makepkg -fsrc --sign'
alias xp='xprop | awk -F\"'" '/CLASS/ {printf \"NAME = %s\nCLASS = %s\n\", \$2, \$4}'"
alias gif='byzanz-record -x 1920 -w 1920 -y 0 -h 1080 -v -d 10 ~/Videos/$(date +%a-%d-%S).gif'
alias vid='ffmpeg -video_size 3840x2160 -framerate 60 -f x11grab -i :0.0 -c:v libx264 -qp 0 -preset ultrafast ~/Videos/$(date +%a-%d-%S).mp4'
alias vida='ffmpeg -video_size 3840x2160 -framerate 60 -f x11grab -f pulse -ac 2 -i :0.0 -c:v libx264 -c:a ac3 -ab 320k -qp 0 -preset ultrafast ~/Videos/$(date +%a-%d-%S).mp4'

# completion
setopt CORRECT
setopt NO_NOMATCH
setopt LIST_PACKED
setopt ALWAYS_TO_END
setopt GLOB_COMPLETE
setopt COMPLETE_ALIASES
setopt COMPLETE_IN_WORD
# builtin command behaviour
setopt AUTO_CD
setopt C_BASES
setopt BSD_ECHO
setopt OCTAL_ZEROES
# job control
setopt AUTO_CONTINUE
setopt LONG_LIST_JOBS
# history control
setopt HIST_VERIFY
setopt SHARE_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
# misc
setopt EXTENDED_GLOB
setopt TRANSIENT_RPROMPT
setopt INTERACTIVE_COMMENTS

ls() # ls with preferred arguments
{
	command ls --color=auto -1F "$@"
}

cd() # cd and ls after
{
	builtin cd "$@" && command ls --color=auto -F
}

ga() # git add with preferred arguments
{
	git add "${1:-.}"
}

gr() # git rebase with preferred arguments
{
	git rebase -i HEAD~${1:-5}
}

src() # recompile completion and reload zsh
{
	autoload -U zrecompile
	rm -rf "$compfile"*
	compinit -u -d "$compfile"
	zrecompile -p "$compfile"
	exec zsh
}

prf() # profile zsh initialization time
{
	export PROFILE_ZSHRC=1
	[[ $1 =~ (-x|--xtrace) ]] && { shift; set -x; zsh "$@"; set +x; } || exec zsh "$@"
	unset PROFILE_ZSHRC
}

mir() # update pacman mirror list
{
	if hash reflector >/dev/null 2>&1; then
		su -c 'reflector --score 100 -l 50 -f 10 --sort rate --save /etc/pacman.d/mirrorlist --verbose'
	elif hash rankmirrors >/dev/null 2>&1; then
		local s="https://www.archlinux.org/mirrorlist/?country=US&country=CA&use_mirror_status=on"
		su -c "curl -L '$s' | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -v -t -n 10 - > /etc/pacman.d/mirrorlist"
	else
		printf "this requires reflector or rankmirrors installed\n"; return 1
	fi
}

por() # remove orphaned packages
{
	local orphans=($(pacman -Qtdq 2>/dev/null))
	if (( ${#orphans[@]} == 0 )); then
		printf "System has no orphaned packages\n"
	else
		sudo pacman -Rns "${orphans[@]}"
	fi
}

pss() # search and install package
{
	(( $# == 1 )) || { printf "usage: pss <package_search>\n"; return 1; }

	local inpkgs=() pkgs=($(pacman -Ssq "$1"))

	for ((i=1; i<=${#pkgs[@]}; i++)); do
		printf " \e[1;34m%d " $i
		pacman -Ss "^${pkgs[i]}$"
	done

	printf "\n\nEnter package number(s) to install: "
	read id

	if [[ $id && $id =~ [0-9] ]]; then
		for i in $(printf "%s" "$id"); do
			case $i in
				''|*[!0-9]*) : ;;
				*) inpkgs+=("${pkgs[i]}") ;;
			esac
		done
		(( ${#inpkgs[@]} == 0 )) || sudo pacman -S "${inpkgs[@]}"
	fi
}

arc() # create and extract archives
{
	if [[ $# -eq 0 || $1 =~ (--help|-h) ]]; then
		printf "usage: arc [-e, --extract] <archive_name>\n"
		printf "       arc [-n, --new] <name.type> files...\n"
		printf "\n\nwhen first argument is an archive --ext is assumed\n"
		return 0
	fi

	(( $# >= 2 )) && { arg="$1"; shift; } || arg='-e'

	case "$arg" in
		-e|--extract)
			if [[ "$1" && -e "$1" ]]; then
				case "$1" in
					*.tbz2|*.tar.bz2) tar xvjf "$1" ;;
					*.tgz|*.tar.gz) tar xvzf "$1" ;;
					*.tar.xz) tar xpvf "$1" ;;
					*.tar) tar xvf "$1" ;;
					*.gz) gunzip "$1" ;;
					*.zip) unzip "$1" ;;
					*.bz2) bunzip2 "$1" ;;
					*.7zip) 7za e "$1" ;;
					*.rar) unrar x "$1" ;;
					*.deb) { ar p "$1" data.tar.xz | tar x; } || { ar p "$1" data.tar.gz | tar xz; } ;;
					*) printf "invalid archive for extraction: %s" "$1"; return 1
				esac
			else
				printf "invalid archive for extraction: %s" "$1"; return 1
			fi ;;
		-n|--new)
			case "$1" in
				*.tar.*)
					n="${1%.*}" e="${1#*.tar.}"; shift
					tar cvf "$n" "$@" || return 1
					case "$e" in
						xz) xz "$n" ;;
						gz) gzip -9r "$n" ;;
						bz2) bzip2 -9zv "$n" ;;
						*) printf "invalid extension after tar %s" "$e"; return 1
					esac ;;
				*.gz) shift; gzip -9rk "$@" ;;
				*.zip) zip -9r "$@" ;;
				*.7z) 7z a -mx9 "$@" ;;
				*) printf "invalid extension %s" "$1"; return 1
			esac ;;
		*) printf "invalid argument %s (use --help)" "$arg"; return 1
	esac
}

sens() # read sensor data from system, requires root
{
	ncores=$(awk 'BEGIN{ i = 0 } /cpu MHz/ { i++ } END{ print i / 2 }' /proc/cpuinfo)

	sudo watch -n 1 -t "sensors -A 'asuswmisensors-isa-*' 'k10temp-pci-*' |
		awk '!/Chipset|Tsensor|asuswmi|k10temp/' &&
		awk -v j=$ncores 'BEGIN{ s = \"\"; i = 0} /cpu MHz/ {
			if (i == j || i == j / 2 || i == j + (j / 2))
				s=s\"\\n\"
			if (s != \"\" && i != j && i != j / 2 && i != j + (j / 2))
				s=s\" | \"int(\$4)\"MHz\"
			else
				s=s\"\"int(\$4)\"MHz\"
			i++
		} END{print s}' /proc/cpuinfo &&
		echo &&
		sensors -A 'amdgpu-pci-*' | awk '!/emerg|amdgpu|fan1/ {
				gsub(/\\s*\\(.*\\)$/, \"\")
				print
			}' &&
		awk '/MHz|%|GPU Load/ {
				sub(/^\s*/, \"\")
				print
			}' /sys/kernel/debug/dri/0/amdgpu_pm_info &&
		awk '/ram usage:/ {
				gsub(/ram usage:/, \"Vram Used: \")
				gsub(/,/, \"\")
				print \$4, \$5, \$6
			}' /sys/kernel/debug/dri/0/amdgpu_vram_mm &&
		echo &&
		cat /sys/class/drm/card0/device/pp_dpm_sclk &&
		echo &&
		cat /sys/class/drm/card0/device/pp_dpm_mclk"
	# echo && cat /sys/class/drm/card0/device/pp_od_clk_voltage | awk '{if (\$1 ~ \"OD_RANGE\") { exit } print}'
}

upr() # update all repos
{
	(( $# )) && { printf "usage: upr\n"; return; }

	for i in "$AL_BASE_PATH"/archlabs_{git_repo/archlabs_repo,repo,unstable}; do
		[[ -x "$i/x86_64/updaterepo.sh" ]] && "$i/x86_64/updaterepo.sh" "$SF_USERNAME"
	done
}

cpr() # cp/mv files ($@) to repo directories
{
	typeset -i u j
	typeset -a bases
	if [[ $1 =~ (-h|--help) || $# -eq 0 ]]; then
		printf "usage: cpr [-u,--update] <file(s)>\n"
		return
	elif [[ $1 =~ (-u|--update) ]]; then
		u=1
		shift
	fi
	for filepath; do
		base="${filepath##*/}"
		bases+=("${base%%-[0-9]*[\-.][0-9]*}")
	done
	for i in "$AL_BASE_PATH"/archlabs_{git_repo/archlabs_repo,repo,unstable}; do
		for b in "${bases[@]}"; do
			find "$i/x86_64/" -name "$b*.tar.*" -delete -printf "remove %p\n"
		done
		if (( j == 2 )); then
			# remove the files were copying using mv on the last iteration
			command mv -fv "$@" "$i/x86_64/" || return
		else
			command cp -fv "$@" "$i/x86_64/" || return
		fi
		(( j++ ))
	done

	(( ! u )) || upr
}

cpu() # add files ($@) to unstable repo
{
	typeset -i u
	if [[ $1 =~ (-h|--help) || $# -eq 0 ]]; then
		printf "usage: cpu [-u,--update] <file(s)>\n"
		return
	elif [[ $1 =~ (-u|--update) ]]; then
		u=1
		shift
	fi
	for filepath; do
		base="${filepath##*/}"
		find "$AL_BASE_PATH/archlabs_unstable/x86_64/" -name "${base%%-[0-9]*[\-.][0-9]*}*.tar.*" -delete -printf "remove %p\n"
	done
	command mv -fv "$@" "$AL_BASE_PATH/archlabs_unstable/x86_64/" || return
	(( ! u )) || "$AL_BASE_PATH/archlabs_unstable/x86_64/updaterepo.sh"
}

tmux() # run tmux and exit the terminal after
{
	command tmux "$@"
	(( $# )) || [[ $LOADED_ZSH_DONE ]] || exit 0
}

surfs() # tabbed instance of surf with default pages
{
    if ! hash surf-open tabbed surf >/dev/null 2>&1; then
        local reqs="tabbed, surf, surf-open (shell script provided with surf)"
        printf "error: this requires the following installed\n\n\t%s\n" "$reqs"
        return 1
    fi

    declare -a urls
    if (( $# == 0 )); then
        local main="https://www.google.com"
        urls=("https://www.youtube.com"
        "https://forum.archlabslinux.com"
        "https://bitbucket.org"
        )
    else
        local main="$1"
        shift
        for arg in "$@"; do
            urls+=("$arg")
        done
    fi

    (
        surf-open "$main" &
        sleep 0.1
        for url in "${urls[@]}"; do
            surf-open "$url" &
        done
    ) & disown
}

first_tab() # on first tab without any text it will list the current directory
{ # empty line tab lists
	if [[ $#BUFFER == 0 ]]; then
		BUFFER="cd " CURSOR=3
		zle list-choices
		BUFFER="" CURSOR=1
	else
		zle expand-or-complete
	fi
}; zle -N first_tab

exp_alias() # expand aliases to the left (if any) before inserting a space
{ # expand aliases
	zle _expand_alias
	zle self-insert
}; zle -N exp_alias

autoload -U compinit     # completion
autoload -U terminfo     # terminfo keys
zmodload -i zsh/complist # menu completion
autoload -U promptinit   # prompt

# better history navigation
autoload -U up-line-or-beginning-search; zle -N up-line-or-beginning-search
autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search

# set the terminal mode when entering or exiting zle, otherwise terminfo keys are not loaded
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
	zle-line-init() { echoti smkx; }; zle -N zle-line-init
	zle-line-finish() { echoti rmkx; }; zle -N zle-line-finish
fi

bindkey -- '^I'   first_tab
bindkey -- ' '    exp_alias
bindkey -- '^P'   up-history
bindkey -- '^N'   down-history
bindkey -- '^E'   end-of-line
bindkey -- '^A'   beginning-of-line
bindkey -- '^[^M' self-insert-unmeta # alt-enter to insert a newline/carriage return
bindkey -- '^K'   up-line-or-beginning-search
bindkey -- '^J'   down-line-or-beginning-search

[[ -n ${terminfo[kdch1]} ]] && bindkey -- "${terminfo[kdch1]}" delete-char                   # delete
[[ -n ${terminfo[kend]}  ]] && bindkey -- "${terminfo[kend]}"  end-of-line                   # end
[[ -n ${terminfo[kcuf1]} ]] && bindkey -- "${terminfo[kcuf1]}" forward-char                  # right arrow
[[ -n ${terminfo[kcub1]} ]] && bindkey -- "${terminfo[kcub1]}" backward-char                 # left arrow
[[ -n ${terminfo[kich1]} ]] && bindkey -- "${terminfo[kich1]}" overwrite-mode                # insert
[[ -n ${terminfo[khome]} ]] && bindkey -- "${terminfo[khome]}" beginning-of-line             # home
[[ -n ${terminfo[kbs]}   ]] && bindkey -- "${terminfo[kbs]}"   backward-delete-char          # backspace
[[ -n ${terminfo[kcbt]}  ]] && bindkey -- "${terminfo[kcbt]}"  reverse-menu-complete         # shift-tab
[[ -n ${terminfo[kcuu1]} ]] && bindkey -- "${terminfo[kcuu1]}" up-line-or-beginning-search   # up arrow
[[ -n ${terminfo[kcud1]} ]] && bindkey -- "${terminfo[kcud1]}" down-line-or-beginning-search # down arrow

# correction
zstyle ':completion:*:correct:*' original true
zstyle ':completion:*:correct:*' insert-unambiguous true
zstyle ':completion:*:approximate:*' max-errors 'reply=($(( ($#PREFIX + $#SUFFIX) / 3 )) numeric)'

# completion
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$comppath"
zstyle ':completion:*' rehash true
zstyle ':completion:*' verbose true
zstyle ':completion:*' insert-tab false
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:-command-:*:' verbose false
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*' completer _complete _match _approximate _ignored
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories

# labels and categories
zstyle ':completion:*' group-name ''
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' format ' %F{green}->%F{yellow} %d%f'
zstyle ':completion:*:messages' format ' %F{green}->%F{purple} %d%f'
zstyle ':completion:*:descriptions' format ' %F{green}->%F{yellow} %d%f'
zstyle ':completion:*:warnings' format ' %F{green}->%F{red} no matches%f'
zstyle ':completion:*:corrections' format ' %F{green}->%F{green} %d: %e%f'

# menu colours
eval "$(dircolors)"
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=36=0=01'

# command parameters
zstyle ':completion:*:functions' ignored-patterns '(prompt*|_*|*precmd*|*preexec*)'
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
zstyle ':completion:*:(vim|nvim|vi):*' ignored-patterns '*.(wav|mp3|flac|ogg|mp4|avi|mkv|iso|so|o|7z|zip|tar|gz|bz2|rar|deb|pkg|gzip|pdf|png|jpeg|jpg|gif)'

# hostnames and addresses
zstyle ':completion:*:ssh:*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
zstyle -e ':completion:*:hosts' hosts 'reply=( ${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*} ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}})'
ttyctl -f

# initialize completion
compinit -u -d "$compfile"

# initialize prompt
promptinit
prompt simpl

[[ -z $PROFILE_ZSHRC ]] || zprof

# [[ $TMUX ]] || tmux

# so we know if we started tmux after the shell or not
LOADED_ZSH_DONE=true

fpath/prompt_simpl_setup

#!/bin/zsh

# A fast, customizable, and informative zsh prompt.
# Written by Nathaniel Maia, December 2018 - February 2019
#
# avoid using subshells $(), and external system calls
# we want to be as fast and unbuffered as possible, use builtins!

# load colors, needed to use %F{color}
autoload -U colors; colors

# load the needed prompt opts, see `man zshmisc`
prompt_opts=(subst percent cr sp)

prompt_defaults()
{ # set prompt defaults that aren't already defined
  # don't change these here, define them in your zshrc
	: "${_PMT_GIT="1"}"
	: "${_PMT_TITLE="1"}"
	: "${_PMT_USERFMT=""}"
	: "${_PMT_TIMEFMT="%*"}"
	: "${_PMT_NEWLINE="$prompt_newline"}" # defined by promptinit as $'\n%{\r%}'
	: "${_PMT_SHCOL="%F{blue}"}"
	: "${_PMT_WRAPCOL="%F{magenta}"}"
	: "${_PMT_ECODE="%(?,, %F{red}%?)"}"
	: "${_PMT_USERCOL="%(!,%F{red},%F{cyan})"}"

	(( ! ${#_PMT_USERFMT} && EUID == 0 )) && _PMT_USERFMT=" %n"

	if [[ $_PMT_NEWLINE ]]; then
		: "${_PMT_ARROW=">"}" # ➜ ➤ ► ▻ ▸ ▹ ❯
		: "${_PMT_LNBR1="┌"}" # ┌ ┏ ╓ ╒
		: "${_PMT_LNBR2="└"}" # └ ┗ ╙ ╘
	else
		: "${_PMT_LNBR1=">"}"
	fi

	if [[ $_PMT_ARROW != *"$_PMT_WRAPCOL"* ]]; then
		_PMT_ARROW="${_PMT_WRAPCOL}${_PMT_ARROW}%f"
		_PMT_LNBR1="${_PMT_WRAPCOL}${_PMT_LNBR1}%f"
		_PMT_LNBR2="${_PMT_WRAPCOL}${_PMT_LNBR2}%f"
	fi

	: "${_GIT_PRE="("}"
	: "${_GIT_SEP="|"}"
	: "${_GIT_SUF=")"}"
	: "${_GIT_BRCH="%F{green}"}"
	: "${_GIT_CNFL="%F{red}x%f"}"
	: "${_GIT_CHGD="%F{blue}+%f"}"
	: "${_GIT_UNMG="%F{yellow}*%f"}"

	if [[ $TERM =~ (linux|rxvt) ]]; then
		: "${_GIT_CLN="%F{green}Ok%f"}"
		: "${_GIT_STGD="%F{red}.%f"}"
		: "${_GIT_AHD="%F{green}^%f"}"
		: "${_GIT_BHD="%F{red}v%f"}"
		: "${_GIT_UNTR="%F{yellow}--%f"}"
		: "${_GIT_STSH="%F{blue}S%f"}"
	else
		: "${_GIT_CLN="%F{green}%{✔%G%}%f"}"
		: "${_GIT_STGD="%F{red}%{•%G%}%f"}"
		: "${_GIT_AHD="%F{green}%{↑%G%}%f"}" # ⇡
		: "${_GIT_BHD="%F{red}%{↓%G%}%f"}"   # ⇣
		: "${_GIT_UNTR="%F{yellow}%{…%G%}%f"}"
		: "${_GIT_STSH="%F{blue}%{⚑%G%}%f"}"
	fi

	unset nl
}

prompt_builder()
{
	typeset -i H B G S C M A U # ints
	typeset s='' b='' d='' x='' y='' p='' pmt='' pid='' name='' ptype='' c="$PWD" ppid=$PPID

	if [[ $_PMT_GIT && $COLUMNS -ge 40 ]] && ! [[ $c =~ ^/(boot|bin|etc|usr|dev|lib|proc|sys|var) || $c == "$HOME" ]]; then
		git status --porcelain=v2 -b 2>/dev/null | while read l; do
			case "$l" in
				'u'*) (( U++ )) ;;
				'?'*) (( A++ )) ;;
				*'.head'*) b="${l##*.head }" ;;
				*'.ab'*) l="${l#*.ab +}" H="${l% -*}" B="${l#* -}" ;;
				*[1-2]*) x="${l:2:1}" y="${l:3:1}"
					if [[ $x$y =~ (AA|AU|DD|DU|UA|UD|UU) ]]; then
						(( C++ ))
					else
						[[ $x =~ [ACDMR] ]] && (( G++ ))
						[[ $y =~ [CDMR]  ]] && (( M++ ))
					fi
					;;
			esac
		done

		if [[ $b ]]; then # in a git repo
			while [[ $c && -z $d ]]; do # find .git/
				[[ -d "$c/.git" ]] && d="$c/.git" || c="${c%/*}"
			done
			if [[ -f "$d/refs/stash" ]]; then
				while read l; do (( S++ )); done < "$d/refs/stash"
			fi
			s+=" %f$_GIT_PRE$_GIT_BRCH${b}%f"
			(( H )) && s+="$_GIT_AHD${H}"                           # ahead
			(( B )) && s+="$_GIT_BHD${B}"                           # behind
			s+="$_GIT_SEP"
			(( G )) && s+="$_GIT_STGD${G}"                          # staged
			(( M )) && s+="$_GIT_CHGD${M}"                          # changed
			(( C )) && s+="$_GIT_CNFL${C}"                          # conflicts
			(( U )) && s+="$_GIT_UNMG${U}"                          # un-merged
			(( A )) && s+="$_GIT_UNTR${A}"                          # untracked
			(( ! M && ! C && ! G && ! A && ! U )) && s+="$_GIT_CLN" # clean
			(( S )) && s+="$_GIT_STSH${S}"                          # stashed
			s+="$_GIT_SUF%f"
		fi
	fi

	# walk up the process tree and check for nested shells and owning process name
	for (( shlvl=1; shlvl < SHLVL && ppid > 1; shlvl++ )); do
		read -r pid name < "/proc/$ppid/stat" >/dev/null 2>&1 || break
		awk '{print $(NF - 48)}' "/proc/$ppid/stat" | read -r ppid
		[[ $name == *tmux* || $name == *vim* || $name == *emacs* ]] && break
		n="${name%%\) *}"
		n="${n#\(}"
		[[ $TERM == *$n* || $n == *rxvt* || $n == *term* ]] && break
		if [[ $SHELL != *$n* && $n != *sh ]]; then
			(( shlvl-- )) # don't count the process spawning the new shell
			(( sub )) || sub=1 subp=" ${_PMT_SHCOL}($n)%f" # owning process name
		fi
	done
	# add a single % for each nested shell level
	printf -v pmt '%*s' $shlvl && pmt="${pmt// /%#}" || pmt='%#'

	# current working directory
	p+="${_PMT_LNBR1}${_PMT_ECODE}${_PMT_USERCOL}${_PMT_USERFMT} ${_PMT_WRAPCOL}"
	if (( ! ${#_PMT_NEWLINE} && COLUMNS > 70 )); then
		p+='%-40<..<%~%<<'
	elif (( ${#_PMT_NEWLINE} && COLUMNS > 60 )); then
		p+="%-15<..<%~%<<"
	else
		p+='%1~'
	fi

	# add time format if the terminal is large enough and not using tmux
	if (( ! ${#TMUX} && ${#_PMT_TIMEFMT} && (COLUMNS > 70 || (${#_PMT_NEWLINE} && COLUMNS > 30)) )); then
		RPROMPT="$_PMT_TIMEFMT"
	else
		RPROMPT=""
	fi

	PROMPT="${p}${s}${_PMT_NEWLINE}${_PMT_LNBR2}${_PMT_ARROW}${subp} ${_PMT_USERCOL}${pmt}%f "
}

prompt_defaults
precmd_functions+=(prompt_builder)
PROMPT2='%_ ==> '
PROMPT3=$'\nSelection: '
PROMPT4='+ %N:%I:%_ ==> '

if [[ $TERM =~ (linux|xterm|rxvt|st|alacritty|kitty|tmux) ]]; then
	# change the cursor for vi-mode
	if bindkey -lL | grep -q 'viins\s*main'; then
		case "$TERM" in
			linux) CUR_BAR="\033[?0c" CUR_BLOCK="\033[?8c" ;;
			*)     CUR_BAR="\033[6 q" CUR_BLOCK="\033[2 q" ;;
		esac
		zle-keymap-select()
		{
			if [[ $KEYMAP != vicmd ]]; then
				printf "$CUR_BAR"
			else
				printf "$CUR_BLOCK"
			fi
		}
		zle -N zle-keymap-select
		if (( ${+terminfo[smkx]} )); then
			zle-line-init()
			{
				echoti smkx
				printf "$CUR_BAR"
			}
		else
			zle-line-init()
			{
				printf "$CUR_BAR"
			}
		fi
	fi

	# don't set the title in ttys
	if [[ $_PMT_TITLE && $TERM != linux ]]; then
		termtitle_precmd()
		{
			print -n "\033]2;${(%):-%2/}\a"
		}
		termtitle_preexec()
		{
			print -n "\033]2;${(%):-%2/}: ${(q)2}\a"
		}
		precmd_functions+=(termtitle_precmd)
		preexec_functions+=(termtitle_preexec)
	fi
fi
3 Likes

it seems you use zsh and not bash.
is it better ?
I this time i learn and use git for project with some friends.
I use sublime merge and git for all command, is it better on line by terminal for git like to do a checkout for all views ?
may better is not the right term

empty@E485 ~ % wc -l ~/.zshrc
3853 /home/empty/.zshrc
empty@E485 ~ % 

Frameworks ftw! :grin:

I’ve added a few extras:

alias sluf='systemctl list-unit-files --state=enabled'
alias sudo='/usr/bin/sudo'
alias su='/usr/bin/su'
alias passwd='/usr/bin/passwd'

function vlaunch {
   qemu-system-x86_64 -enable-kvm \
                      -m 4G \
                      -cpu host \
                      -smp cores=4 \
                      -drive file="$1",format=raw,cache=none,if=virtio \
                      -soundhw pa \
                      -vga qxl \
                      -device virtio-serial-pci \
                      -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
                      -chardev spicevmc,id=spicechannel0,name=vdagent \
                      -spice unix,addr=/tmp/vm_spice.socket,disable-ticketing \
                      -device nec-usb-xhci,id=usb \
                      -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
                      -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
                      -chardev spicevmc,name=usbredir,id=usbredirchardev2 \
                      -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
                      -fsdev local,id=qemu_dev,path=/home/empty/Public,security_model=none \
                      -device virtio-9p-pci,fsdev=qemu_dev,mount_tag=qemu_mount &
   remote-viewer "spice+unix:///tmp/vm_spice.socket"
}

9 fortune
print

The aliases (alii?) for sudo, su & passwd are to prevent hi-jacking and the vlaunch function is for my VMs.

I also have

empty@E485 ~ % cat ~/.zshrc.pre                                                  ↓69%
GRML_DISPLAY_BATTERY=1
empty@E485 ~ %

For the battery status readout on the right :slight_smile:

Sorry if I disturb the post, but for example I see aliases for mirrorlist especially when pacsaves arrive and also for system-boot instead of aliases, isn’t it better to use the hook version that is in the arch linux wiki ?!
Mine is just a question.
Cheers

My bash{rc,_profile}, etc are always changing but the main hunk of gibberish I always bring along is my .xstefenrc

it aint much, but its honest work… the stuff that works at least

#
# xstefenrc - random shits serving random purposes
#

if [[ ! -z "$BASH_VERSION" ]]; then
    shopt -s direxpand
    shopt -s checkhash
    shopt -s sourcepath
    shopt -s expand_aliases
    shopt -s autocd cdspell
    shopt -s extglob dotglob
    shopt -s no_empty_cmd_completion
    shopt -s autocd cdable_vars cdspell
    shopt -s cmdhist histappend histreedit histverify
    [[ $DISPLAY ]] && shopt -s checkwinsize
fi

# GPG/SSH agent
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
  export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null

if [[ "$(command -v hub)" ]]; then
    alias git='hub'
fi

alias setperf='echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
alias setsave='echo "powersave" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'

# Creates a virtualenv if required and activates it
venv() {
    PYV=$(python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]))\
            ;sys.stdout.write(t)")
    if [[ "${PYV}" == "3" ]]; then
        if [[ "$(command -v 'virtualenv2')" ]]; then
            [[ -f "/tmp/venv/bin/activate" ]] || virtualenv2 --system-site-packages /tmp/venv
            source /tmp/venv/bin/activate
        else
            echo "Please install 'virtualenv2', or make 'python' point to \
                    python2"
        fi
    fi
}

# Deactivates a virtualenv and deletes the folder
rmvenv() {
    if [[ -d "/tmp/venv/" ]]; then
        deactivate
        rm -rf /tmp/venv
    fi
}

repofastsync() { schedtool -B -n 1 -e ionice -n 1 `which repo` sync -c --optimized-fetch --no-tags --no-clone-bundle -j8 "$@"; }

# Repo sync with various flags I'm lazy to type each time
syncc() {
    time repo sync --force-sync --no-clone-bundle --current-branch --no-tags "$@"
}

rinsync() {
    rm -fv .repo/local_manifests/*
    rm -rfv .repo/repo
    rm -rfv .repo/manifests
    if [[ -z $1 && -z $2 ]]; then
        read -p 'Manifest URL: ' MNFST
        read -p 'Branch: ' BRNCH
        repo init -u "${MNFST}" -b "${BRNCH}" --no-tags --no-clone-bundle --current-branch --no-repo-verify
    else
        repo init -u $1 -b $2 --no-tags --no-clone-bundle --current-branch --no-repo-verify
    fi
    repo forall --ignore-missing -j"$(nproc)" -c "git reset --hard m/${BRANCH} && git clean -fdx"
    time repo sync -j"$(nproc)" --current-branch --no-tags --no-clone-bundle --force-sync
}

# Some git aliases for an easier workflow
gitalias() {
    git config --global alias.s 'status'
    git config --global alias.p 'push'
    git config --global alias.pl 'pull'
    git config --global alias.f 'fetch'
    git config --global alias.r 'remote'
    git config --global alias.rv 'remote --verbose'
    git config --global alias.ru 'remote update'
    git config --global alias.rrm 'remote remove'
    git config --global alias.rsu 'remote set-url'
    git config --global alias.ra 'remote add'
    git config --global alias.rev 'revert'
    git config --global alias.re 'reset'
    git config --global alias.cp 'cherry-pick'
    git config --global alias.cpc 'cherry-pick --continue'
    git config --global alias.cpa 'cherry-pick --abort'
    git config --global alias.rh 'reset --hard'
    git config --global alias.rs 'reset --soft'
    git config --global alias.rb 'rebase'
    git config --global alias.rbi 'rebase --interactive'
    git config --global alias.rbc 'rebase --continue'
    git config --global alias.rba 'rebase --abort'
    git config --global alias.rbs 'rebase --skip'
    git config --global alias.d 'diff'
    git config --global alias.dc 'diff --cached'
    git config --global alias.b 'bisect'
    git config --global alias.c 'commit'
    git config --global alias.cs 'commit --signoff'
    git config --global alias.ca 'commit --amend'
    git config --global alias.cn 'commit --no-edit'
    git config --global alias.gerrit 'push gerrit HEAD:refs/for/pie'
    git config --global alias.add-change-id "!EDITOR='sed -i -re s/^pick/e/' sh -c 'git rebase -i \$1 && while test -f .git/rebase-merge/interactive; do git commit --amend --no-edit && git rebase --continue; done' -"
}
#alias repo-change-hook-all="repo forall -c 'gitdir=$(git rev-parse --git-dir); scp -p -P 29418 xstefen@review.lineageos.org:hooks/commit-msg ${gitdir}/hooks/'"
0file() { curl -F"file=@$1" https://envs.sh ; }
0pb() { curl -F"file=@-;" https://envs.sh ; }
0url() { curl -F"url=$1" https://envs.sh ; }
0short() { curl -F"shorten=$1" https://envs.sh ; }
alias tb="nc tb.envs.net 9999"

# BASH HISTORY
# make multiple shells share the same history file
export HISTSIZE=1000            # bash history will save N commands
export HISTFILESIZE=${HISTSIZE} # bash will remember N commands
export HISTCONTROL=ignoreboth   # ingore duplicates and spaces
export HISTIGNORE='&:ls:ll:la:cd:exit:clear:history'

# AUTOCOLOR
#export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
alias ls='ls --color=none'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

# MODIFIED COMMANDS
alias ..='cd ..'
alias df='df -h'
alias diff='colordiff'              # requires colordiff package
alias du='du -c -h'
alias free='free -m'                # show sizes in MB
alias grep='grep --color=auto'
alias grep='grep --color=tty -d skip'
alias mkdir='mkdir -p -v'
alias more='less'
alias nano='nano -w'
alias ping='ping -c 5'
alias ll='ls -alh --color=auto'


# PRIVILEGED ACCESS
alias sudo='sudo '
alias reboot='sudo reboot'

# RAND
alias sysu='systemctl --user'
alias cls="echo -e '\0033\0143'"
alias syncit='repo sync -c --no-tags --no-clone-bundle -j8'
alias reload='rmvenv && clear && reset && cls && source ~/.bashrc'
#alias reload='rmvenv && clear && reset && cls && source ~/.zshrc'
alias adp='adb push'
#alias d0tz='/usr/bin/git --git-dir=$HOME/.d0tz/ --work-tree=$HOME'
alias wttr='curl wttr.in/dfw?format=3'
alias rp='repopick '
alias cpupower-freqset='sudo cpupower frequency-set -g ' # performance, powersave, schedutil, ondemand, etc
alias watchcpu='watch grep \"cpu MHz\" /proc/cpuinfo'
alias mirror='sudo reflector --verbose --latest 200 --protocol https --sort rate --save /etc/pacman.d/mirrorlist'
alias update='sudo pacman -Syyu'
alias update-grub='grub-mkconfig -o /boot/grub/grub.cfg'
alias tb="nc tb.envs.net 9999"

export VISUAL=nano
export EDITOR=nano
export USE_CCACHE=1
export CCACHE_COMPRESS=1
export CCACHE_DIR="${HOME}/.ccache"
export CCACHE_EXEC="$(which ccache)"
#export ALLOW_MISSING_DEPENDENCIES=true

#alias d0tz='/usr/bin/git --git-dir=/home/xstefen/.dotfiles/ --work-tree=/home/xstefen'

Despite what may be inferred from this, i actually use yadm and/or local tar/rsync

How to remove terminal name from prompt ?
by the way great.
thanks

2020-04-27_22-21

You must be running in a subshell?

What is subshell ? and how to not run in ? Me feel dumb now :sweat_smile:

Don’t feel dumb, it’s a feature of the prompt to show when in a subshell or subprocess (another process run ontop of the current shell), eg. running su
2020-04-27-164543_451x126_scrot
or running a terminal file manager that allows running another shell from within (! in noice, etc.)
2020-04-27-164700_491x96_scrot
or just multiple levels of the same shell
2020-04-27-172723_415x268_scrot

Your issue with it does not seem related to this though, can you post the output from

echo $TERM

oh i get it thanks
here the output
2020-04-28_02-50

Do you have something like this in you’re zshrc?

TERM='xterm-256color'

If so just remove it, I ran alacritty and it works fine without changing the value of TERM.

no i cleared my zshrc file and add your config then added my plugins and no TERM=‘xterm-256color’ in the file