6

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?

1 Answer 1

10

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
2
  • When installing vim on Tumbleweed, this should be a dependency. However, it is currently missing, and users will need to devote a significant amount of work to correct this. This response saved me a few days.
    – inckka
    Jun 10, 2023 at 1:43
  • I performed password recovery for SE and logged in just to upvote this. Haunting me for months
    – zzxyz
    Jul 27, 2023 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .