No syntax highlighting in Vim

Hi all,
I’m unable to get syntax highlighting in vim using vim-go. This is my .vimrc

set nu
set tabstop=4 shiftwidth=4
set ignorecase
set smartcase
set incsearch
set paste
set nocompatible
filetype off

" How to setup vundle: https://www.digitalocean.com/community/tutorials/how-to-use-vundle-to-manage-vim-plugins-on-a-linux-vps
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" This is the Vundle package, which can be found on GitHub.
" For GitHub repos, you specify plugins using the
" 'user/repository' format

Plugin 'gmarik/vundle'

" vim-go
" https://github.com/fatih/vim-go
Plugin 'fatih/vim-go'

let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1

call vundle#end()
filetype plugin indent on

Directory structure of ~/.vim directory goes like this:

.
└── bundle
    β”œβ”€β”€ Vundle.vim
    β”‚   β”œβ”€β”€ autoload
    β”‚   β”œβ”€β”€ doc
    β”‚   β”œβ”€β”€ ftplugin
    β”‚   β”œβ”€β”€ syntax
    β”‚   └── test
    β”œβ”€β”€ data
    β”‚   β”œβ”€β”€ boltdb
    β”‚   β”œβ”€β”€ cleanerdb
    β”‚   └── rocksdb
    β”œβ”€β”€ vim-go
    β”‚   β”œβ”€β”€ autoload
    β”‚   β”œβ”€β”€ compiler
    β”‚   β”œβ”€β”€ doc
    β”‚   β”œβ”€β”€ ftdetect
    β”‚   β”œβ”€β”€ ftplugin
    β”‚   β”œβ”€β”€ gosnippets
    β”‚   β”œβ”€β”€ indent
    β”‚   β”œβ”€β”€ plugin
    β”‚   β”œβ”€β”€ scripts
    β”‚   └── syntax
    └── vundle
        β”œβ”€β”€ autoload
        β”œβ”€β”€ doc
        β”œβ”€β”€ ftplugin
        β”œβ”€β”€ syntax
        └── test

Vim version: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2015 16:22:14)

Thanks in advance,
lafolle

Hey @lafolle. Do you have the setting syntax on in your vimrc?
Let me know if you have it set and it still doesn’t work :smile:

1 Like

Ah, thanks @radovskyb. It worked!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.