Add further support for typescript
This commit is contained in:
@@ -0,0 +1,67 @@
|
|||||||
|
"============================================================================
|
||||||
|
"File: tsc.vim
|
||||||
|
"Description: TypeScript syntax checker
|
||||||
|
"Maintainer: Bill Casarin <[email protected]>
|
||||||
|
"
|
||||||
|
"============================================================================
|
||||||
|
|
||||||
|
if exists('g:loaded_syntastic_typescript_tsc_checker')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_syntastic_typescript_tsc_checker = 1
|
||||||
|
|
||||||
|
if !exists('g:syntastic_typescript_tsc_sort')
|
||||||
|
let g:syntastic_typescript_tsc_sort = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! SyntaxCheckers_typescript_tsc_IsAvailable() dict
|
||||||
|
if !executable(self.getExec())
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let version_output = split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n', 1)
|
||||||
|
let ver = filter(copy(version_output), 'v:val =~# ''\m\<Version ''')
|
||||||
|
let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0], '\v<Version \zs\d+(\.\d+)\ze') : []
|
||||||
|
|
||||||
|
if len(parsed_ver)
|
||||||
|
call self.setVersion(parsed_ver)
|
||||||
|
let s:tsc_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 5])
|
||||||
|
else
|
||||||
|
call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
|
||||||
|
call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
|
||||||
|
let s:tsc_new = -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:tsc_new >= 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! SyntaxCheckers_typescript_tsc_GetLocList() dict
|
||||||
|
let makeprg = self.makeprgBuild({
|
||||||
|
\ 'exe': 'tsc',
|
||||||
|
\ 'fname': '',
|
||||||
|
\ 'args': '--noEmit -p tsconfig.json' })
|
||||||
|
|
||||||
|
let errorformat =
|
||||||
|
\ '%E%f %#(%l\,%c): error %m,' .
|
||||||
|
\ '%E%f %#(%l\,%c): %m,' .
|
||||||
|
\ '%Eerror %m,' .
|
||||||
|
\ '%C%\s%\+%m'
|
||||||
|
|
||||||
|
return SyntasticMake({
|
||||||
|
\ 'makeprg': makeprg,
|
||||||
|
\ 'errorformat': errorformat,
|
||||||
|
\ 'postprocess': ['guards'],
|
||||||
|
\ 'defaults': {'bufnr': bufnr('')} })
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
|
\ 'filetype': 'typescript',
|
||||||
|
\ 'name': 'tsc'})
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim: set sw=4 sts=4 et fdm=marker:
|
||||||
+13
-7
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
Plug 'HerringtonDarkholme/yats.vim'
|
||||||
Plug 'ctrlpvim/ctrlp.vim'
|
Plug 'ctrlpvim/ctrlp.vim'
|
||||||
Plug 'digitaltoad/vim-pug'
|
Plug 'digitaltoad/vim-pug'
|
||||||
Plug 'elzr/vim-json'
|
Plug 'elzr/vim-json'
|
||||||
@@ -10,7 +11,6 @@ Plug 'gisraptor/vim-lilypond-integrator'
|
|||||||
Plug 'godlygeek/tabular'
|
Plug 'godlygeek/tabular'
|
||||||
Plug 'jlanzarotta/bufexplorer'
|
Plug 'jlanzarotta/bufexplorer'
|
||||||
Plug 'kchmck/vim-coffee-script'
|
Plug 'kchmck/vim-coffee-script'
|
||||||
Plug 'leafgarland/typescript-vim'
|
|
||||||
Plug 'nathanaelkane/vim-indent-guides'
|
Plug 'nathanaelkane/vim-indent-guides'
|
||||||
Plug 'plasticboy/vim-markdown'
|
Plug 'plasticboy/vim-markdown'
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
@@ -24,10 +24,10 @@ call plug#end()
|
|||||||
" Execute Basic Setup Commands #########################################################################################
|
" Execute Basic Setup Commands #########################################################################################
|
||||||
|
|
||||||
set background=dark
|
set background=dark
|
||||||
colorscheme zmrok
|
silent! colorscheme zmrok
|
||||||
" abra alduin badwolf Benokai birds-of-paradise black-angus brogrammer bvemu cabin camo chlordane coffee corporation
|
" abra alduin badwolf Benokai birds-of-paradise black-angus brogrammer bvemu cabin camo chlordane coffee
|
||||||
" dark-robin feral golden greens kellys liquidcarbon night_vision obsidian solarized zmrok
|
" corporation dark-robin feral golden greens kellys liquidcarbon night_vision obsidian solarized zmrok
|
||||||
"
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
hi ColorColumn ctermbg=8
|
hi ColorColumn ctermbg=8
|
||||||
syntax on
|
syntax on
|
||||||
@@ -95,13 +95,19 @@ nmap =or :Tabularize /or<CR>
|
|||||||
nmap =, :Tabularize /[^,]*:<CR>
|
nmap =, :Tabularize /[^,]*:<CR>
|
||||||
|
|
||||||
" nathanaelkane/vim-indent-guides
|
" nathanaelkane/vim-indent-guides
|
||||||
let g:indent_guides_enable_on_vim_startup = 0 " :IndentGuidesToggle
|
let g:indent_guides_enable_on_vim_startup = 0
|
||||||
|
|
||||||
" vim-syntastic/syntastic
|
" vim-syntastic/syntastic
|
||||||
let g:syntastic_always_populate_loc_list = 1
|
let g:syntastic_always_populate_loc_list = 1
|
||||||
let g:syntastic_auto_loc_list = 1
|
let g:syntastic_auto_loc_list = 1
|
||||||
let g:syntastic_check_on_open = 1
|
let g:syntastic_check_on_open = 0
|
||||||
let g:syntastic_check_on_wq = 0
|
let g:syntastic_check_on_wq = 0
|
||||||
|
let g:syntastic_error_symbol = "E>"
|
||||||
|
let g:syntastic_style_error_symbol = "e>"
|
||||||
|
let g:syntastic_style_warning_symbol = "w>"
|
||||||
|
let g:syntastic_warning_symbol = "W>"
|
||||||
|
|
||||||
|
let g:syntastic_typescript_checkers = ['tsc', 'tslint']
|
||||||
|
|
||||||
" Key Mappings #########################################################################################################
|
" Key Mappings #########################################################################################################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user