diff --git a/autoload/SpaceVim/layers/lang/typescript.vim b/autoload/SpaceVim/layers/lang/typescript.vim index 11fa6d372..4016a38a1 100644 --- a/autoload/SpaceVim/layers/lang/typescript.vim +++ b/autoload/SpaceVim/layers/lang/typescript.vim @@ -115,8 +115,8 @@ endfunction function! s:on_typescript_ft() abort if SpaceVim#layers#lsp#check_filetype('typescript') + \ || SpaceVim#layers#lsp#check_server('tsserver') nnoremap K :call SpaceVim#lsp#show_doc() - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], \ 'call SpaceVim#lsp#show_doc()', 'show-document', 1) call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], @@ -129,33 +129,37 @@ function! s:on_typescript_ft() abort nnoremap K :TSDoc call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TSRename', \ 'rename-symbol', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'f'], 'TSGetCodeFix', - \ 'code fix', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TSImport', - \ 'import', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'p'], 'TSDefPreview', - \ 'preview definition', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 't'], 'TSType', - \ 'view type', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'R'], 'TSRefs', - \ 'show reference', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'D'], 'TSGetDiagnostics', - \ 'show errors', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'o'], 'TSOrganizeImports', - \ 'organizes imports', 1) else nnoremap gD :TsuTypeDefinition call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], 'TsuquyomiSignatureHelp', \ 'show document', 1) call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TsuquyomiRenameSymbol', \ 'rename symbol', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TsuImport', - \ 'import', 1) - call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'm'], 'TsuImplementation', - \ 'interface implementations', 1) endif endif + if has('nvim') + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'f'], 'TSGetCodeFix', + \ 'code fix', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TSImport', + \ 'import', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'p'], 'TSDefPreview', + \ 'preview definition', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 't'], 'TSType', + \ 'view type', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'R'], 'TSRefs', + \ 'show reference', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'D'], 'TSGetDiagnostics', + \ 'show errors', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'o'], 'TSOrganizeImports', + \ 'organizes imports', 1) + else + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TsuImport', + \ 'import', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'm'], 'TsuImplementation', + \ 'interface implementations', 1) + endif + " code runner call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'], \ 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)