因此,在我的LXLE(基本上是Lubuntu)笔记本电脑上安装Vim后,命令行上的颜色消失了。
例如,如果您键入'ls',您将看到该目录中所有文件/文件夹的列表,并且它们将以彩色编码。就我而言,一切都是白色的。安装vim后命令行颜色消失了吗?
我的问题是,我安装Vim后,我的整个命令行窗口只是黑色和白色(黑色背景,白色文本),没有任何颜色编码。
LXLE在LXDE桌面界面中使用ROXTerm(如果有任何区别)。在发布之前,我搜索了这个相同的问题,结果没有任何结果。任何人都可以帮忙吗?
因此,在我的LXLE(基本上是Lubuntu)笔记本电脑上安装Vim后,命令行上的颜色消失了。
例如,如果您键入'ls',您将看到该目录中所有文件/文件夹的列表,并且它们将以彩色编码。就我而言,一切都是白色的。安装vim后命令行颜色消失了吗?
我的问题是,我安装Vim后,我的整个命令行窗口只是黑色和白色(黑色背景,白色文本),没有任何颜色编码。
LXLE在LXDE桌面界面中使用ROXTerm(如果有任何区别)。在发布之前,我搜索了这个相同的问题,结果没有任何结果。任何人都可以帮忙吗?
我假设你正在使用bash。
如果是这样,请在您的主目录中检查.bashrc文件。
应该有一行:
#force_color_promt=yes
尝试删除唱 “#”
看看是否有一行:如果心不是这样的行
alias ls='ls --color=auto'
,添加它
如果没有行尝试将其添加到该文件(它来自我的.bashrc):
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\[email protected]\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\[email protected]\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
谢谢,它的工作。令人惊讶的是,我的主目录中没有.bashrc文件,只好创建一个。 – relapsn
安装Vim对您的shell配置不做任何*:它不会改变任何东西的内容或为您的$ HOME添加任何东西。由于你所做的其他事情,颜色消失了。请详细说明您所经历的所有步骤。另外作为参考,如果你没有给出正确的参数,'ls'的输出是* not * colored。 – romainl
好的..在安装Vim之前,我的文件夹颜色是浅蓝色。然后,我做了'sudo apt-get install vim'和瞧,颜色消失了。这些是我在颜色之间完成的唯一步骤,它们是默认颜色和颜色变化。 – relapsn
这与编程无关,应该迁移到SuperUser。 –