【发布时间】:2010-11-18 06:58:30
【问题描述】:
如何在 Ubuntu 中获得与 Zsh 的 Less 比 Bash 的 Less 类似的突出显示?
我从 OS X 切换到 Ubuntu。我的 Less 在 Zsh 中无法正常工作。
我的 Less 中的手册是绿色和黑色的,有或没有以下代码。
# comment these out in Ubuntu
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;33;146m' # begin underline is now yellow
# | | |
# | |----------------- yellow
# |-------------------- underline
# to have the indication of cursor's location and line numbers, and R
export LESS="-mNR"
# |--------- only ASCII color
该代码使手册在 OS X 中可读,但它不适用于 Zsh 中的 Ubuntu。
Ubuntu 在 Bash 的 Less 中有出色的亮点。在没有我的代码的情况下,我的手册在 Bash 中有黄色、绿色和黑色。 Zsh 和 Bash 在/usr/bin/less 使用相同的 Less。这表明我 Ubuntu 的 Bash 有一些点文件可以在某处配置它。
Ubuntu 在 Bash 中的 Less 亮点在哪里?
【问题讨论】:
-
@Luboš Turek 所以最后我创建了less-unix,所以如果你要取消标记 Linux 的 less,请考虑在其位置添加这个。
标签: bash ubuntu colors zsh less-unix