0

I'm trying to figure out how to get Syntax highlighting or getting the colorscheme in my .vimrc to work with my current VIM instance, version 7.4.335, installed via Homebrew. I used Pathogen to download a lot of plugins and I can tell it's working with a few of them, Syntastic and NERDTree for instance, but when I open say a GO file I don't get any syntax highlighting.

I'm fairly new to VIM and Pathogen but I'd prefer to stay with VIM over MacVim, I use it for quick scripting and prototyping and the speed of startup is the main reason I want to keep using it instead of waiting for a GUI to load. Here's what's in my .vimrc

set runtimepath+=~/.vim_runtime
set mouse=a
set term=xterm

source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_confic.vim
source ~/.vim_runtime/vimrcs/extened.vim

try
    source ~/.vim_runtime/my_configs.vim
catch
endtry

set nocompatible
call pathogen#infect()
syntax on
filetype plugin indent on
colorscheme solarized
let g:soloarized_termcolors=256

"ack
let g:ack_autofold_results = 1

"syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_error_symbol = "X"
let g:syntastic_style_error_symbol = ">"
let g:syntastic_warning_symbol = "1"
let g:syntastic_sytle_warning_symbol = ">"

I've checked these posts but they don't seem to quite fix my problem:

Why does Pathogen "magically" solve Vim syntax highlighting problems?

Vim: Can't get pathogen to load bundles

Vim Solarized Color scheme: Should I have to set `call pathogen#infect()` in my .vimrc to make the syntax highlighting work properly?

Syntax highlighting in terminal vim but not gVIM

Thanks in advance!

Community
  • 1
  • 1
CGideon
  • 143
  • 2
  • 15
  • 1
    You shouldn't source things before `set nocompatible` but I doubts thats the problem. Where did you put these syntax files? Location is very important – FDinoff Aug 06 '14 at 20:17
  • The syntax files are in the bundle's themselves. Here's an example of my GO plugin. .vim/bundle/vim-go/syntax . When installing new plugins I just cd .vim/bundle then git clone – CGideon Aug 06 '14 at 20:51
  • I should also mention that I'm using iTerm 2 as my terminal – CGideon Aug 06 '14 at 20:57

2 Answers2

0

I don't think you used Pathogen to "download a lot of plugins".

Anyway…

set runtimepath+=~/.vim_runtime

That line is pointless: your plugins and colorschemes and whatnot are supposed to go into ~/.vim/ and nowhere else.

set term=xterm

That line is useless: Vim is smart enough to know by itself what terminal type it's executed in.

source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_confic.vim
source ~/.vim_runtime/vimrcs/extened.vim

Again, put your stuff in ~/.vim/ and there's no point whatsoever to split your config like that, especially if you are a beginner. There's a typo on the 4th line, by the way.

Also, the whole point of the runtimepath… line at the top of your ~/.vimrc is to tell Vim where to search for vim scripts with the :runtime command so, even using :source, here, is wrong.

try
    source ~/.vim_runtime/my_configs.vim
catch
endtry

You might as well try/catch the four others. Again, just put all that in your ~/.vimrc.

set nocompatible

nocompatible is set when Vim finds a ~/.vimrc file or a ~/.vim/vimrc file so that line is useless too.

call pathogen#infect()

That line should be execute pathogen#infect(), as per Pathogen's README.

colorscheme solarized
let g:soloarized_termcolors=256

The let… line acts as an option for that colorscheme, it should come before the colorscheme… line and… it has a typo.

Also, set term=xterm forces Vim to run in 8/16 colors while your solarized option tells solarized and Vim to assume 256 colors. Make up your mind.

Basically, your ~/.vimrc is a mess… let's clean it up, shall we?

execute pathogen#infect()

syntax on
filetype plugin indent on

set mouse=a

" here comes all the stuff from your other `vimrcs`

let g:solarized_termcolors=256
colorscheme solarized

let g:ack_autofold_results = 1

let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_error_symbol = "X"
let g:syntastic_style_error_symbol = ">"
let g:syntastic_warning_symbol = "1"
let g:syntastic_sytle_warning_symbol = ">"
romainl
  • 186,200
  • 21
  • 280
  • 313
  • I appreciate your help! And yes, I used the wrong terminology. I'm using Pathogen to manage plugins for VIM. Sorry if this caused confusion. And yes I am a terrible typer :) – CGideon Aug 07 '14 at 13:37
0

So it's an issue with iTerm, syntax highlighting works perfectly fine through the regular terminal.

Thank you for the assistance. If I figure out how to get iTerm to work with VIM syntax highlighting I'll post it here.

CGideon
  • 143
  • 2
  • 15