From 1efbfc53722fed4e49ad27df2d3fcf45b985dd79 Mon Sep 17 00:00:00 2001 From: dkjii Date: Thu, 17 Sep 2020 21:03:38 -0400 Subject: [PATCH] add toggle to disable compiler --- README.md | 2 ++ ftplugin/typescript.vim | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c487381..412c6c1 100644 --- a/README.md +++ b/README.md @@ -132,5 +132,7 @@ Syntax highlighting for TypeScript can be customized by following variables. highlighted. - `g:typescript_ignore_browserwords`: When this variable is set to `1`, browser API names such as `window` or `document` will not be highlighted. (default to `0`) +- `g:typescript_disable_compiler`: When this variable is set to `1`, the compiler will not be modified + (default to `0`) ![Obligatory screenshot](https://raw.github.com/leafgarland/typescript-vim/master/vimshot01.png) diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim index da4b1e8..3b20fa1 100644 --- a/ftplugin/typescript.vim +++ b/ftplugin/typescript.vim @@ -6,7 +6,9 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo-=C -compiler typescript +if !get(g:, 'typescript_disable_compiler', 0) + compiler typescript +endif setlocal commentstring=//\ %s " Set 'formatoptions' to break comment lines but not other lines,