我想在.screenrc中有一个if-else循环用于以下代码,以便在我的终端支持256色时运行它。 否则,它不会运行。
attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm" termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"如何在.screenrc中创建if-else循环?
I would like to have a if-else loop in .screenrc for the following codes such that it is run if my terminal supports 256 colors. Otherwise, it is not run.
attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm" termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"How can you make the if-else loop in .screenrc?
最满意答案
这应该已经由terminfo数据库文件设置。 在我的情况下,我的默认终端是xterm。 它使用8种颜色,用vi反映在vi中
:设置termcap
命令检查t_Co项目,设置为8.如果我将我的终端更改为另一种终端类型,如gnome-256color使用256种颜色,那么vi将显示t_Co等于256.我不知道为什么你需要尝试和在.vimrc文件中设置它。
This should already be set by the terminfo database file. In my case my default terminal is xterm. It uses 8 colors which is reflected in vi by using the
:set termcap
command an inspecting the t_Co item which is set to 8. If I change my terminal to another terminal type like gnome-256color which uses 256 colors then vi will show t_Co as equal to 256. I'm not sure why you need to try and set this in your .vimrc file.
更多推荐
发布评论