zsh 탭 완성에서 색상 제거

zsh 탭 완성에서 색상 제거

zsh 탭 완성 제안에서 색상을 보고 싶지 않습니다. 그것들은 나의 독서를 더욱 어렵게 만듭니다. 어떻게 해야 하나요?

이 내 꺼야 .zshrc:

#           _
#   _______| |__
#  |_  / __|  _ \
#   / /\__ \ | | |
#  /___|___/_| |_|
#

# install oh-my-zsh
[ ! -d ~/.oh-my-zsh ] && git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# install zsh-autosuggestion
autosuggestions="/home/enan/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
[ ! -f "$autosuggestions" ] && git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.zsh/zsh-autosuggestions
[ -f "$autosuggestions" ] && source "/home/enan/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"

# oh-my-zsh config
export ZSH=/home/enan/.oh-my-zsh
ZSH_THEME=""
DISABLE_LS_COLORS="true"
DISABLE_AUTO_TITLE="true"
export UPDATE_ZSH_DAYS=13
source $ZSH/oh-my-zsh.sh
plugins=( git )

bindkey '^P' up-line-or-beginning-search
bindkey '^N' down-line-or-beginning-search

# Personal customization
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"

executables="/home/enan/Executables/bin"
[ -d "$executables" ] && [[ ":$PATH:" != *$executables* ]] && export PATH=$executables:${PATH}

# FZF settings
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_OPTS='--height 100% '

alias ls='ls -CF --color=none'
alias ll='ls -AlF'
alias la='ls -AF'
alias refresh='source ~/.zshrc'
alias screenfetch='screenfetch -t'
alias i3lock='sh ~/Git-repos/dotFiles/lock.sh'
alias emacs='emacs -nw'
alias v='nvim'
alias py2=python2
alias py3=python3
alias t='sh ~/Git-repos/dotFiles/tmux.sh'

# zsh prompt with git info
git_branch() {
  git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}

git_status() {
  # + changes are staged and ready to commit
  # ! unstaged changes are present
  # ? untracked files are present
  # $ changes have been stashed
  # ↑ local commits need to be pushed to the remote
  local state="$(git status --porcelain 2>/dev/null)"
  local output='['
  [[ -n $(egrep '^[MADRC]' <<<"$state") ]] && output="$output+"
  [[ -n $(egrep '^.[MD]' <<<"$state") ]] && output="$output!"
  [[ -n $(egrep '^\?\?' <<<"$state") ]] && output="$output?"
  [[ -n $(git stash list) ]] && output="$output$"
  [[ -n $(git log --branches --not --remotes) ]] && output="$output↑"
  [[ -n $output ]] && output="$output]"
  echo $output
}

git_prompt() {
  # First, get the branch name...
  local branch=$(git_branch)
  # Empty output? Then we're not in a Git repository, so bypass the rest
  # of the function, producing no output
  if [[ -n $branch ]]; then
    local state=$(git_status)
    # Now output the actual code to insert the branch and status
    if [ $state = '[]' ]; then
      echo -e " $branch"
    else
    echo -e " $branch %{$fg_bold[red]%}$state"
    fi
  fi
}

PROMPT='%{$fg[blue]%}[%n@%m] %{$fg[magenta]%}%c%{$fg[yellow]%}$(git_prompt)
%(?:%{$fg[green]%}❯ :%{$fg[red]%}❯ )%{$reset_color%}'

스크린샷:

스크린샷

cd <tab>스크린샷에서 터미널 왼쪽 창의 마지막 명령을 살펴보세요 .

답변1

순수 zsh 사용:

zstyle ':completion:*' list-colors

대신 다음 명령과 동일한 색상을 사용하십시오 ls.

eval "$(dircolors)"
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

이는 oh-my-zsh에서도 작동해야 하지만 oh-my-zsh에는 때때로 작업을 수행하는 고유한 방식이 있으며 oh-my-zsh로는 테스트하지 않았습니다.

관련 정보