Vim syntax highlighting for Dockerfiles

By default Vim offers on the Mac OS X no syntax highlighting for Dockerfiles. With a few steps you can change that. At the end of this tutorial you can also install additional PlugIns!

Prepare .vimrc

# create or modify .vimrc
$ vim ~/.vimrc
set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" add plugins here...
Plugin 'VundleVim/Vundle.vim'
Plugin 'docker/docker' , {'rtp': '/contrib/syntax/vim/'}

call vundle#end()
filetype plugin indent on

set ruler
syntax enable

Install and enable PlugIns

# start Vim
$ vim

# install and enable Vim PlugIns
:PluginInstall

# quit vim
:q

# show installed Vim PlugIns (optional)
$ ls -la ~/.vim/bundle/