如何正确设置Emacs颜色?

如何正确设置Emacs颜色?,emacs,colors,color-scheme,Emacs,Colors,Color Scheme,我设置了两个版本: My computer apt-get emacs 23.0.91 Remote server yum emacs 21.4 我已经下载了color-theme-6.6.0,将文件放在/usr/share/emacs/-version-/lisp/,在我的.emacs中有: (require 'color-theme) (color-theme-initialize) (color-theme-midnight) 在终端上运行emacs时,

我设置了两个版本:

My computer      apt-get   emacs 23.0.91
Remote server    yum       emacs 21.4
我已经下载了color-theme-6.6.0,将文件放在/usr/share/emacs/-version-/lisp/,在我的.emacs中有:

(require 'color-theme)
(color-theme-initialize)
(color-theme-midnight)
在终端上运行emacs时,所有颜色都能正确显示在我的计算机上,但在服务器上,我只能得到两种颜色???无论我选择什么主题,背景是一种颜色,文本是另一种颜色。启动emacs时没有显示错误

有什么建议吗?

转述自:

为了能够在Unix/Linux设备上使用语法高亮显示,您需要一个支持颜色的终端。有些系统(AIX for me)需要tic在文件上生成TERMINFO文件。这里有一个剪报:

 setenv TERMINFO /home/cfl/lib/terminfo
 tic xterm-color
 setenv TERM xterm-color
再次阅读文章,了解所有细节


另一方面,这是我的.emacs文件中用于设置颜色(在深色背景上)的内容


您需要像这样设置环境变量项(假设bash shell):

导出术语=“xterm-256color”

如果您是从screen中运行emacs,则必须将以下内容添加到.screenrc中

术语屏幕-256color

如果这不起作用,可能是因为您的系统没有安装适当的termcap。例如,在deb/ubuntu系统上,您必须:

apt获取安装课程术语

我不确定是否安装了基于rpm的系统,但请确保安装了ncurses和termcap。

使用

在AIX上:

su -
tic xterm-color.tic
alias emacs='TERM=xterm-color emacs'
su -
tic xterm-color.tic
alias emacs='TERM=xterm-color emacs'