mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 02:05:40 +08:00
Fix vim support
This commit is contained in:
parent
ca5caef345
commit
41a4fbbf5f
@ -24,3 +24,17 @@ function! SpaceVim#layers#lang#typescript#config() abort
|
||||
autocmd FileType typescript setlocal omnifunc=tsuquyomi#complete
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#typescript#set_variable(var) abort
|
||||
if has('nvim')
|
||||
let g:nvim_typescript#server_path =
|
||||
\ get(a:var, 'typescript_server_path',
|
||||
\ './node_modules/.bin/tsserver')
|
||||
else
|
||||
let tsserver_path = get(a:var, 'typescript_server_path', '')
|
||||
if !empty(tsserver_path)
|
||||
let g:tsuquyomi_use_dev_node_module = 2
|
||||
let g:tsuquyomi_tsserver_path = tsserver_path
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
39
docs/layers/lang/typescript.md
Normal file
39
docs/layers/lang/typescript.md
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "SpaceVim lang#typescript layer"
|
||||
---
|
||||
|
||||
# [SpaceVim Layers:](https://spacevim.org/layers) lang#typescript
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [Description](#description)
|
||||
- [Layer Installation](#layer-installation)
|
||||
- [Features](#features)
|
||||
- [Layer configuration](#layer-configuration)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Description
|
||||
|
||||
This layer is for TypeScript development.
|
||||
|
||||
## Layer Installation
|
||||
|
||||
To use this configuration layer, add `call SpaceVim#layers#load('lang#typescript')` to your custom configuration file. BTW, you need to install TypeScript via:
|
||||
|
||||
```sh
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- auto-completion
|
||||
- syntax checking
|
||||
- viewing documentation
|
||||
- type-signature
|
||||
- goto definition
|
||||
- refernce finder
|
||||
|
||||
## Layer configuration
|
||||
|
||||
`typescript_server_path`: set the path of the tsserver.
|
Loading…
x
Reference in New Issue
Block a user