Skip to content

bmenant/typescript-vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript Syntax for Vim

Syntax file and compiler settings for TypeScript. The syntax file is taken from this blog post.

Install

The simplest way to install is via a Vim add-in manager such as Plug, Vundle or Pathogen.

If you want to install manually then you need to copy the files from this repository into your vim path, see the vim docs for :help runtimepath for more information. This might be as simple as copying the files and directories to ~/.vim/ but it depends on your Vim install and operating system.

Indenting

This plugin used to include some indent settings but they were not very good. There are better options around such as vim-js-indent that you should install as well.

Usage

Once the files are installed the syntax highlighting and compiler settings will be automatically enabled anytime you edit a .ts file.

Compiler settings

The compiler settings enable you to call the tsc compiler directly from Vim and display any errors or warnings in Vim's QuickFix window.

To run the compiler, enter :make, this will run tsc against the last saved version of your currently edited file.

You can add compiler options by modifying the compiler options variable.

let g:typescript_compiler_options = '-sourcemap'

Note, you can use something like this in your .vimrc to make the QuickFix window automatically appear if :make has any errors.

autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost    l* nested lwindow

Obligatory screenshot

About

Typescript syntax files for Vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%