SpaceVim add typescript tsx support

This commit is contained in:
wsq 2020-11-02 17:32:19 +08:00
parent dbf44e0456
commit 11b62fc104
3 changed files with 61 additions and 1 deletions

View File

@ -1,3 +1,59 @@
function! paiyou#before() abort
set virtualedit=onemore " Allow for cursor beyond last character
set splitright
" open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" }}}
let g:neoformat_javascript_jsbeautify = {
\ 'exe': 'js-beautify',
\ 'stdin': 1,
\ }
let g:neoformat_typescript_prettier = {
\ 'exe': 'prettier',
\ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'],
\ 'stdin': 1
\ }
let g:neoformat_enabled_typescript = ['tsfmt', 'prettier']
" show all uncompliable symbols
set listchars=tab:>-,trail:~,extends:>,precedes:<
set list
" javascript
let g:tern#command = ["tern"]
let g:tern#arguments = ["--persistent"]
let g:spacevim_custom_plugins = [
\ ['peitalin/vim-jsx-typescript'],
\ ['leafgarland/typescript-vim'],
\ ]
" typescript
let g:tagbar_type_typescript = {
\ 'ctagstype': 'typescript',
\ 'kinds': [
\ 'c:classes',
\ 'n:modules',
\ 'f:functions',
\ 'v:variables',
\ 'v:varlambdas',
\ 'm:members',
\ 'i:interfaces',
\ 'e:enums',
\ 's:statics',
\ ]
\ }
" disable ctags
let g:gutentags_ctags_exclude = [ "*.js", "*.jsx", "*.ts", "*.tsx", "*.css", "build", "vendor", ".git", "node_modules", "*.vim/bundle/*", "out" ]
endfunction
function! paiyou#after() abort
let g:ale_fixers = {
\ 'javascript': ['eslint'],

View File

@ -2,7 +2,7 @@
" We exclude semicolon because it's hard to read and
" i and l are too easy to mistake for each other slowing
" down recognition. The home keys and the immediate keys
" accessible by middle fingers are available
" accessible by middle fingers are available
let g:EasyMotion_keys='asdfjkoweriop'
nmap ,<ESC> ,,w
nmap ,<S-ESC> ,,b

View File

@ -32,6 +32,7 @@
filemanager = "nerdtree"
enable_neomake = false
enable_ale = true
bootstrap_before = "paiyou#before"
bootstrap_after = "paiyou#after"
project_rooter_automatically = 0
@ -58,6 +59,9 @@ name = "tmux"
[[layers]]
name = "lang#javascript"
[[layers]]
name = "lang#typescript"
[[layers]]
name = "colorscheme"