TypeScript syntax highlighting in vim

Nico Schlömer picture Nico Schlömer · Jan 29, 2016 · Viewed 24.7k times · Source

I installed the typescript plugin via

git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim

and inserted

au BufRead,BufNewFile *.ts   setfiletype typescript

into by ~/.vim.rc. Linting via Syntastic and tsc/tslint works well, and

:set syntax

shows syntax=typescript. However,

:syntax

shows No Syntax items defined for this buffer and highlighting doesn't work.

Any idea what's going wrong?

Answer

Nico Schlömer picture Nico Schlömer · Jan 29, 2016

What was missing from ~/.vimrc is a specification of where to find the plugin, i.e.,

Plugin 'leafgarland/typescript-vim'

Highlighting works now.