Site icon moneyslow.com

centos7下vi显示彩色如何设置

centos7和CentOS8 rc.local 开机不自动执行的解决方法

centos7和CentOS8 rc.local 开机不自动执行的解决方法

首先确保安装了3个包:

vim-minimal,vim-enhanced,vim-common

并且设置了别名:

centos7下vi设置彩色

看下面代码,把 -n "$ID" -a "$ID" -le 200 这行注释掉,重新登录linux即可。

# vi /etc/profile.d/vim.sh

if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
  [ -x /usr/bin/id ] || return
  ID=`/usr/bin/id -u`
  #[ -n "$ID" -a "$ID" -le 200 ] && return  ### hash out this line
  # for bash and zsh, only if no alias is already set
  alias vi >/dev/null 2>&1 || alias vi=vim
fi
Exit mobile version