How to get vim syntax highlighting to work?

2

I cannot get vim syntax highlighting to work on a suse box.

I have (only this two lines) in my ~/.vimrc

filetype plugin on
syntax on

If I open a shell script with .sh an do

:set filetype?

I get

filetype=sh

Entering

:scriptnames

gives

  1: /etc/vimrc
  2: /usr/share/vim/vim73/syntax/syntax.vim
  3: /usr/share/vim/vim73/filetype.vim
  4: ~/.vimrc
  5: /usr/share/vim/vim73/ftplugin.vim

which means my ~/.vimrc is loaded.

As you can see from the screen shot, the ~ after the end of the file are blue, so there's is some color at least, but no syntax highlighting. enter image description here

Any ideas what's wrong?

BetaRide

Posted 2015-09-08T12:07:57.370

Reputation: 2 099

Answers

4

Since I'm on SUSE, installing vim is not enough. I had to install vim-data. Once installed, nothing else needs to be done. Syntax highlighting works out of the box.

To install vim-data, use YaST, or on the command line:

zypper install vim-data

BetaRide

Posted 2015-09-08T12:07:57.370

Reputation: 2 099