GNU/Linux >> Tutoriales Linux >  >> Linux

Cómo habilitar el color del texto en vi similar a vim en CentOS/RHEL

Si usa el editor de texto vim, habrá visto el marcado de texto colorido. Ayuda mucho en caso de que estés escribiendo guiones.

Por defecto, el editor vi no tiene esta característica habilitada. Siga los pasos a continuación para habilitar la función de color de texto en vi.

1. instalar vim-enhanced si aún no está instalado.

# yum install vim-enhanced

2. Descomponga la línea que contiene “[ -n “$ID” -a “$ID” -le 200 ] &&return “.

# 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

3. Cierre sesión y vuelva a iniciar sesión para ver el color del texto usando vi.


Linux
  1. Cómo habilitar IPv6 en CentOS / RHEL 7

  2. CentOS / RHEL:Cómo habilitar SSL para Apache

  3. Cómo habilitar IPv6 en CentOS / RHEL 5

  4. Cómo habilitar el reenvío X11 en CentOS/RHEL 5,6,7

  5. Cómo habilitar FTP en CentOS/RHEL 5 y 6

Cómo habilitar SELinux en CentOS/RHEL 7

Cómo habilitar el repositorio EPEL en RHEL 8 / CentOS 8 Linux

Cómo instalar vim en RHEL 8 / CentOS 8

Cómo habilitar el repositorio EPEL en CentOS y RHEL

Cómo habilitar Kdump en RHEL 7 y CentOS 7

Cómo instalar el editor de texto Vim en CentOS 8