views:

136

answers:

2

This is a naive (and likely dumb) question, but I can't seem to get the R syntax highlighting to work with my Linux setup.

I've downloaded a r.vim file that has improved syntax highlighting, and it works on my Windows gvim setup. Does this r.vim file need to be in the /usr/share/vim/v70/syntax directory? Right now, I have it in my home directory and trying out source ~/r.vim in the ~/.vimrc file. However, this doesn't seem to do anything. Perhaps I'm barking up the wrong tree?

+1  A: 

Couple of guesses:

  • you are running vim-tiny (which doesn't have syntax highlighting) instead of vim-full or vim-gnome
  • you do not have 'syntax on' in ~/.vimrc
  • you have a permissions problem on the snippet
Dirk Eddelbuettel
Thanks for your input. I'm running the full vim and syntax is on, so I'm still puzzled. I guess my main question is if the `r.vim` file needs to be in the syntax directory of the `/usr/share/vim` directory, or if there is some kind of work around.
andrewj
A: 

Is the file type getting detected?

:set ft?

That should print out something like filetype=r in your case. If it's not set, try:

:set ft=r

Still nothing? Try:

:syntax on

I place all downloaded plugins in ~/.vim/plugins/. You shouldn't have to place any plugins in the system folders.

In your .vimrc:

filetype plugin on
syntax on
Curt Nelson
Alas, I've tried all those steps and still can't get it work!
andrewj
No, syntax scripts belong in ~/.vim/syntax/.
graywh