2017-09-22 20:59:38 +08:00
|
|
|
---
|
|
|
|
title: "SpaceVim lang#javascript layer"
|
2017-10-09 22:41:31 +08:00
|
|
|
description: "This layer is for JaveScript development"
|
2017-09-22 20:59:38 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
# [SpaceVim Layers:](https://spacevim.org/layers) lang#javascript
|
|
|
|
|
|
|
|
<!-- vim-markdown-toc GFM -->
|
|
|
|
|
2017-12-23 14:56:31 +08:00
|
|
|
- [Description](#description)
|
2018-01-03 22:56:15 +08:00
|
|
|
- [Install](#install)
|
2017-12-23 14:56:31 +08:00
|
|
|
- [Features](#features)
|
|
|
|
- [Layer configuration](#layer-configuration)
|
2018-01-13 12:45:21 +08:00
|
|
|
- [Key bindings](#key-bindings)
|
|
|
|
- [Import key bindings](#import-key-bindings)
|
|
|
|
- [Generate key bindings](#generate-key-bindings)
|
2017-09-22 20:59:38 +08:00
|
|
|
|
|
|
|
<!-- vim-markdown-toc -->
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
This layer is for JavaScript development.
|
|
|
|
|
2018-01-03 22:56:15 +08:00
|
|
|
## Install
|
2017-09-22 20:59:38 +08:00
|
|
|
|
|
|
|
To use this configuration layer, add `call SpaceVim#layers#load('lang#javascript')` to your custom configuration file.
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- auto-completion
|
|
|
|
- syntax checking
|
|
|
|
- goto definition
|
|
|
|
- refernce finder
|
|
|
|
|
|
|
|
## Layer configuration
|
|
|
|
|
2018-06-02 09:04:38 +08:00
|
|
|
`auto_fix`: auto fix problems when save files, disabled by default. If you need this feature, you can load this layer via:
|
2017-09-22 20:59:38 +08:00
|
|
|
|
|
|
|
```vim
|
|
|
|
call SpaceVim#layers#load('lang#javascript',
|
|
|
|
\ {
|
|
|
|
\ 'auto_fix' : 1,
|
|
|
|
\ }
|
|
|
|
\ )
|
|
|
|
|
|
|
|
```
|
2018-01-13 12:45:21 +08:00
|
|
|
|
2018-06-02 09:04:38 +08:00
|
|
|
`enable_flow_syntax`: Enable configuration for [flow](https://flow.org/), disabled by default. If you need this feature, you can load this layer via:
|
|
|
|
|
|
|
|
```vim
|
|
|
|
call SpaceVim#layers#load('lang#javascript',
|
|
|
|
\ {
|
|
|
|
\ 'enable_flow_syntax' : 1,
|
|
|
|
\ }
|
|
|
|
\ )
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2018-01-13 12:45:21 +08:00
|
|
|
## Key bindings
|
|
|
|
|
|
|
|
### Import key bindings
|
|
|
|
|
|
|
|
| Key Binding | Description |
|
|
|
|
| -------------------- | ------------------------------- |
|
|
|
|
| `F4` (Insert/Normal) | Import symbol under cursor |
|
|
|
|
| `SPC j i` | Import symbol under cursor |
|
|
|
|
| `SPC j f` | Import missing symbols |
|
|
|
|
| `SPC j g` | Jump to module under cursor |
|
|
|
|
| `<C-j>i` (Insert) | Import symbol under cursor |
|
|
|
|
| `<C-j>f` (Insert) | Import missing symbols |
|
|
|
|
| `<C-j>g` (Insert) | Jump to module under cursor |
|
|
|
|
|
|
|
|
### Generate key bindings
|
|
|
|
|
|
|
|
| Mode | Key Binding | Description |
|
|
|
|
| ------------- | ----------- | ------------------------------------- |
|
|
|
|
| normal | `SPC l g d` | Generate JSDoc |
|