ubuntu - 命令的颜色突出显示(Ubuntu 突出显示到 Debian)?

标签 ubuntu server debian ls nano

所以我有一个 Debian 10 服务器和一个 Ubuntu 18.04.3 LTS 服务器,但是对于 Ubuntu 18.04.3 LTS 服务器,它具有 ls、nano 等颜色突出显示,但是对于 Debian 10 服务器,它不是这样,是吗可以为 Debian 10 上的命令添加 Ubuntu 18.04.3 LTS 服务器语法突出显示和颜色突出显示,因为我查找了无数线程,但没有一个有效

最佳答案

您必须首先知道颜色在 linux 用户下以某种方式被破坏了。

ls 输出的颜色在/etc/DIR_COLORS 文件中设置。但是你说你正在寻找纳米来着色。

要调整您的 nano,您必须编辑(如果不存在则触摸)您文件夹中的 .nanorc。如果你正在寻找语法高亮,你必须知道 nano 可以做到这一点,但它在 Debian 中没有激活,请检查文件夹/usr/share/nano/并在你的 .nanorc 中添加以下行:

include /usr/share/nano/*

这将在 nano 检测到正确的 shebang 的文件中启用一些颜色。

但是也有一些人喜欢自己动手做,每年,你懂的……,对于那些我在 archive.org 上找到了这个非常好的版本,我也调整了我的……

## Here is an example for Bourne shell scripts.
##
syntax "bash" "\.sh$"
header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
icolor brightgreen "^[0-9A-Z_]+\(\)"
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
color brightyellow ""(\\.|[^"])*""
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color brightyellow "'(\\.|[^'])*'"
color cyan "(^|[[:space:]])#.*$"
color ,green "[[:space:]]+$"

关于ubuntu - 命令的颜色突出显示(Ubuntu 突出显示到 Debian)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59092429/

相关文章:

css - 如何使用 CSS 更改 GtkWidget 的大小?

Docker:由于缺少 bash,无法编辑图像中的代码

linux - 查找文件直到一个数字并执行操作

ssl - SSL 连接读取中的垃圾值

linux - Ghostscript:拆分大型 PDF 会导致 "pdfmark destination page"错误

linux - 查找当前按窗口 Id 打开的 gnome 终端选项卡的数量

无法使用在 c 中处理多个客户端的服务器在客户端之间平均分配工作

ios - 支持 HTTPS Web 服务器 iOS

linux - 如何编译静态链接的go程序(1.3)?

ubuntu - Gentoo + debootstrap 在与 fakeroot 和 fakechroot 一起使用时失败