【发布时间】:2019-02-20 16:50:02
【问题描述】:
所以我知道可能有很多关于此的帖子,但要么我找不到我需要的帖子,要么我的终端讨厌我。我正在尝试使用 OSX 上 iterm2 上的 zsh shell 为 ls 的输出着色。
我尝试过使用别名“alias ls='ls -laGH'”和许多变体,但没有奏效。 我尝试在 zshrc 中使用 LS_COLORS 有很多变化,但没有成功。 我已经尝试了几个小时来安装这个https://github.com/trapd00r/LS_COLORS,但没有成功(当然还安装了zplugin)。
我的预测是由于颜色或主题已经实现但优先于别名或 GitHub 存储库,因此没有任何效果?
任何帮助将不胜感激!
这是当前的 .zshrc:
# Load Nerd Fonts with Powerlevel9k theme for Zsh
POWERLEVEL9K_MODE='nerdfont-complete'
source ~/powerlevel9k/powerlevel9k.zsh-theme
# Customise the Powerlevel9k prompts
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(time ram dir_writable)
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# Load Zsh tools for syntax highlighting and autosuggestions
HOMEBREW_FOLDER="/usr/local/share"
source "$HOMEBREW_FOLDER/zsh-autosuggestions/zsh-autosuggestions.zsh"
# Colorise the top Tabs of Iterm2 with the same color as background
# Just change the 18/26/33 wich are the rgb values
echo -ne "\033]6;1;bg;red;brightness;18\a"
echo -ne "\033]6;1;bg;green;brightness;26\a"
echo -ne "\033]6;1;bg;blue;brightness;33\a"
# Aliases for list commands with colorful output
alias ls='ls -laGH'
alias add='git add * ; git status'
source '/Users/christianquinn/.zplugin/plugins/trapd00r---LS_COLORS/c.zsh'
source "$HOMEBREW_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
### Added by Zplugin's installer
source '/Users/christianquinn/.zplugin/bin/zplugin.zsh'
autoload -Uz _zplugin
(( ${+_comps} )) && _comps[zplugin]=_zplugin
### End of Zplugin's installer chunk
【问题讨论】: