Search code examples
vimtypescriptvim-syntax-highlighting

TypeScript syntax highlighting in vim


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?


Solution

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

    Plugin 'leafgarland/typescript-vim'
    

    Highlighting works now.