How to change syntax color in vim?

12,550

For syntax highlighting in vim, first install vim

sudo apt install vim

then run

$ cd /usr/share/vim/vim74/colors
/usr/share/vim/vim74/colors$ ls

From its output:

blue.vim      desert.vim    koehler.vim  peachpuff.vim  slate.vim
darkblue.vim  elflord.vim   morning.vim  README.txt     torte.vim
default.vim   evening.vim   murphy.vim   ron.vim        zellner.vim
delek.vim     industry.vim  pablo.vim    shine.vim

Modify file ~/.vimrc

vi ~/.vimrc or gedit ~/.vimrc and edit

colorscheme koehler

or any you like.

Share:
12,550

Related videos on Youtube

Suraj kumar
Author by

Suraj kumar

Updated on September 18, 2022

Comments

  • Suraj kumar
    Suraj kumar over 1 year

    I have Ubuntu 16.04 LTS. But vim is not showing the proper syntax colors and also the mode in which you are like insert mode. So can anyone help me how to solve the issue?

    • Zanna
      Zanna almost 7 years
      are you talking about vim?
    • Suraj kumar
      Suraj kumar almost 7 years
      yes its vim...in this vi editor the mode and different syntax colour not showing
    • Suraj kumar
      Suraj kumar almost 7 years
      how to solve ...plzzz reply asap
    • Zanna
      Zanna almost 7 years
      Ubuntu comes with vim-tiny or something. You have to run sudo apt install vim to get a full-featured vim
  • d a i s y
    d a i s y almost 7 years
    @Surajkumar If it helpful to you then please upvote and accept it. Read Tour Page