1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:30:05 +08:00

Add key bindings development doc

This commit is contained in:
wsdjeg 2018-01-02 20:00:16 +08:00
parent 2a9033afc1
commit d427c3f065

View File

@ -21,6 +21,7 @@ description: "Development information about SpaceVim, including contributing gui
- [Author of a new layer](#author-of-a-new-layer)
- [Contributor to an existing layer](#contributor-to-an-existing-layer)
- [Contributing a keybinding](#contributing-a-keybinding)
- [Language specified key bindings](#language-specified-key-bindings)
- [Contributing a banner](#contributing-a-banner)
- [Build with SpaceVim](#build-with-spacevim)
- [Changelog](#changelog)
@ -110,27 +111,29 @@ Write commit messages according to adapted [Tim Popes guidelines](http://tbag
This is a model commit message:
Capitalized, short (72 chars or less) summary
```gitcommit
Capitalized, short (72 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug." This convention matches up with commit messages generated
by commands like git merge and git revert.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug." This convention matches up with commit messages generated
by commands like git merge and git revert.
Further paragraphs come after blank lines.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between, but conventions vary here
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between, but conventions vary here
- Use a hanging indent
- Use a hanging indent
```
[Gita] provide vim mode for Git commit messages, which helps you to comply to these guidelines.
@ -148,13 +151,13 @@ The file header for vim script should look like the following template:
"=============================================================================
" FILENAME --- NAME layer file for SpaceVim
" Copyright (c) 2012-2016 Shidong Wang & Contributors
" Author: YOUR_NAME <YOUR_EMAIL>
" Author: YOUR NAME <YOUR EMAIL>
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
```
You should replace FILENAME by the name of the file (e.g. foo.vim) and NAME by the name of the layer you are creating, dont forget to replace YOUR_NAME and YOUR_EMAIL also.
You should replace FILENAME by the name of the file (e.g. foo.vim) and NAME by the name of the layer you are creating, dont forget to replace **YOUR NAME** and **YOUR EMAIL** also.
##### Author of a new layer
@ -228,6 +231,20 @@ If you think it worth contributing a new mappings then be sure to read the docum
ALWAYS document your new mappings or mappings changes inside the relevant documentation file. It should be the the layer file and the [documentation.md](https://spacevim.org/documentation).
#### Language specified key bindings
All language specified key bindings are started with `SPC l` prefix.
we recommended to keep same language specified key bindings for different languages:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| SPC l r | start a runner for current file |
| SPC l s i | Start a language specified inferior REPL process |
| SPC l s b | send buffer and keep code buffer focused |
| SPC l s l | send line and keep code buffer focused |
| SPC l s s | send selection text and keep code buffer focused |
#### Contributing a banner
The startup banner is by default the SpaceVim logo but there are also ASCII banners available in the core/banner layer.