From e6509a12400c7264d98aa5761622ba186b9f3ae8 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 12 Sep 2024 19:50:05 +0200 Subject: [PATCH] removed cd becouse it doesnt work --- .zsh/custom/256color.zsh | 48 ++++++++++++++++++++++++++++++++++++++++ .zshrc | 5 +---- 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .zsh/custom/256color.zsh diff --git a/.zsh/custom/256color.zsh b/.zsh/custom/256color.zsh new file mode 100644 index 0000000..91922ea --- /dev/null +++ b/.zsh/custom/256color.zsh @@ -0,0 +1,48 @@ +# Copyright (c) 2014-2019, Christian Ludwig +# +# Set 256color terminal mode if available. + +_zsh_256color_debug() { + [[ -n "${ZSH_256COLOR_DEBUG}" ]] && echo "zsh-256color: $@" >&2 +} + +_zsh_terminal_set_256color() { + if [[ "$TERM" =~ "-256color$" ]]; then + _zsh_256color_debug "256 color terminal already set." + return + fi + + local TERM256="${TERM}-256color" + + # Use (n-)curses binaries, if installed. + if [[ -x "$(which toe)" ]]; then + if toe -a | grep -E "^$TERM256" >/dev/null; then + _zsh_256color_debug "Found $TERM256 from (n-)curses binaries." + export TERM="$TERM256" + return + fi + fi + + # Search through termcap descriptions, if binaries are not installed. + for termcaps in $TERMCAP "$HOME/.termcap" "/etc/termcap" "/etc/termcap.small"; do + if [[ -e "$termcaps" ]] && grep -E -q "(^$TERM256|\|$TERM256)\|" "$termcaps"; then + _zsh_256color_debug "Found $TERM256 from $termcaps." + export TERM="$TERM256" + return + fi + done + + # Search through terminfo descriptions, if binaries are not installed. + for terminfos in $TERMINFO "$HOME/.terminfo" "/etc/terminfo" "/lib/terminfo" "/usr/share/terminfo"; do + if [[ -e "$terminfos"/$TERM[1]/"$TERM256" || + -e "$terminfos"/"$TERM256" ]]; then + _zsh_256color_debug "Found $TERM256 from $terminfos." + export TERM="$TERM256" + return + fi + done +} + +_zsh_terminal_set_256color +unset -f _zsh_terminal_set_256color +unset -f _zsh_256color_debug diff --git a/.zshrc b/.zshrc index 4ede4df..317d5c4 100644 --- a/.zshrc +++ b/.zshrc @@ -74,6 +74,7 @@ _init (){ fi if command_exists zoxide; then eval "$(zoxide init zsh)" + eval "$(zoxide init zsh --cmd cd)" fi # ─< environment variables for zsh >────────────────────────────────────────────────────── @@ -145,25 +146,21 @@ _alias(){ alias l="exa --long --no-filesize --no-permissions --no-time --git --colour-scale --icons" alias ll="exa --all --long --no-filesize --no-permissions --no-time --git --colour-scale --icons" alias tree="exa --icons -l --tree" - alias cd="cd $1 && exa --icons" elif command_exists lsd; then alias ls="lsd -l -1 -h1 --almost-all --git" alias l="lsd -1" alias ll="lsd -1 --almost-all" alias clearl="command clear && l" alias tree="lsd --tree" - alias cd="cd $1 && lsd" elif command_exists eza; then alias ls="eza --icons --long --git" alias l="eza --icons -l" alias ll="eza --icons -laa" alias tree="eza --icons -l --tree" - alias cd="cd $1 && eza --icons" else alias ls="ls --color=always -lAph" alias l="ls --color=always -lph -w1" alias ll="ls --color=always -lph" - alias cd="cd $1 && ls --color=always" fi # ─< t stands for tmux >────────────────────────────────────────────────────────────────────