mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:00:04 +08:00
Update documents about colorscheme
This commit is contained in:
parent
194f5bf67e
commit
4abb6c4722
@ -1,23 +1,37 @@
|
||||
---
|
||||
title: "Development"
|
||||
description: "A guide for contributing to SpaceVim."
|
||||
description: "Development information about SpaceVim, including contributing guidelines and changelog."
|
||||
---
|
||||
|
||||
# Development
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [Contribution guidelines](#contribution-guidelines)
|
||||
- [Asking for help](#asking-for-help)
|
||||
- [Reporting issues](#reporting-issues)
|
||||
- [Contributing code](#contributing-code)
|
||||
- [License](#license)
|
||||
- [Conventions](#conventions)
|
||||
- [Pull Request](#pull-request)
|
||||
- [Ideally for simple PRs (most of them):](#ideally-for-simple-prs-most-of-them)
|
||||
- [For complex PRs (big refactoring, etc):](#for-complex-prs-big-refactoring-etc)
|
||||
- [Contributing a layer](#contributing-a-layer)
|
||||
- [File header](#file-header)
|
||||
- [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)
|
||||
- [Contributing a banner](#contributing-a-banner)
|
||||
- [Contributing a statusline theme](#contributing-a-statusline-theme)
|
||||
- [Build with SpaceVim](#build-with-spacevim)
|
||||
- [Changelog](#changelog)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
Development happens in the GitHub repository. here is a throughput graph of the repository for the last few weeks:
|
||||
|
||||
[![Throughput Graph](https://graphs.waffle.io/SpaceVim/SpaceVim/throughput.svg)](https://waffle.io/SpaceVim/SpaceVim/metrics/throughput)
|
||||
|
||||
## Content
|
||||
|
||||
- [Contribution guidelines](#contribution-guidelines)
|
||||
- [Asking for help](#asking-for-help)
|
||||
- [Reporting issues](#reporting-issues)
|
||||
- [Contributing code](#contributing-code)
|
||||
- [Build with SpaceVim](#build-with-spacevim)
|
||||
- [Changelog](#changelog)
|
||||
|
||||
## Contribution guidelines
|
||||
|
||||
SpaceVim is an effort of all the volunteers, we encourage you to pitch in. The community makes SpaceVim what it is.
|
||||
@ -32,12 +46,14 @@ You can only consider reading the sections relevant to what you are going to do:
|
||||
### Asking for help
|
||||
|
||||
If you want to ask an usage question, be sure to look first into some places as it may hold the answers:
|
||||
|
||||
- <kbd>:h SpaceVim-faq</kbd>: Some of the most frequently asked questions are answered there.
|
||||
- [SpaceVim documentation](https://spacevim.org/documentation): It is the general documentation of SpaceVim.
|
||||
|
||||
### Reporting issues
|
||||
|
||||
Issues have to be reported on [issues tracker](https://github.com/SpaceVim/SpaceVim/issues), Please:
|
||||
|
||||
- Check that there is no duplicate issue in the issues tracker, you can search for keywords in the issues tracker.
|
||||
- Check that the issue has not been fixed in latest version of SpaceVim, please update your SpaceVim, and try to reproduce the bug here.
|
||||
- Use a clear title and follow the issue template.
|
||||
@ -50,6 +66,7 @@ Code contributions are welcome. Please read the following sections carefully. In
|
||||
#### License
|
||||
|
||||
The license is MIT for all the parts of SpaceVim. this includes:
|
||||
|
||||
- The initialization and core files
|
||||
- All the layer files.
|
||||
|
||||
@ -94,29 +111,27 @@ Write commit messages according to adapted [Tim Pope’s guidelines](http://tbag
|
||||
|
||||
This is a model commit message:
|
||||
|
||||
```
|
||||
Capitalized, short (72 chars or less) summary
|
||||
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.
|
||||
|
||||
@ -222,6 +237,7 @@ If you have some ASCII skills you can submit your artwork!
|
||||
|
||||
You are free to choose a reasonable height size but the width size should be around 75 characters.
|
||||
|
||||
#### Contributing a statusline theme
|
||||
|
||||
## Build with SpaceVim
|
||||
|
||||
|
@ -1,16 +1,42 @@
|
||||
---
|
||||
title: "Conventions"
|
||||
description: "conventions of contribute to SpaceVim, including the coding style guide about vim script and markdown"
|
||||
description: "conventions of contributing to SpaceVim, including the coding style guides about vim script and markdown"
|
||||
permalink: "/conventions"
|
||||
---
|
||||
|
||||
# Conventions
|
||||
|
||||
## Content
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [commit emoji convention](#commit-emoji-convention)
|
||||
- [viml coding style guild](#viml-coding-style-guide)
|
||||
- [markdown style guide](#markdown-style-guide)
|
||||
- [Commit emoji convention](#commit-emoji-convention)
|
||||
- [Viml coding style guide](#viml-coding-style-guide)
|
||||
- [Portability](#portability)
|
||||
- [Strings](#strings)
|
||||
- [Matching Strings](#matching-strings)
|
||||
- [Regular Expressions](#regular-expressions)
|
||||
- [Dangerous commands](#dangerous-commands)
|
||||
- [Fragile commands](#fragile-commands)
|
||||
- [Catching Exceptions](#catching-exceptions)
|
||||
- [General Guidelines](#general-guidelines)
|
||||
- [Messaging](#messaging)
|
||||
- [Type checking](#type-checking)
|
||||
- [Python](#python)
|
||||
- [Other Languages](#other-languages)
|
||||
- [Plugin layout](#plugin-layout)
|
||||
- [Functions](#functions)
|
||||
- [Commands](#commands)
|
||||
- [Autocommands](#autocommands)
|
||||
- [Mappings](#mappings)
|
||||
- [Errors](#errors)
|
||||
- [Settings](#settings)
|
||||
- [Style](#style)
|
||||
- [Whitespace](#whitespace)
|
||||
- [Line Continuations](#line-continuations)
|
||||
- [Naming](#naming)
|
||||
- [Markdown style guide](#markdown-style-guide)
|
||||
- [Thanks:](#thanks)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Commit emoji convention
|
||||
|
||||
@ -23,29 +49,35 @@ permalink: "/conventions"
|
||||
- :beer: I'm happy like reduced code complexity.
|
||||
|
||||
## Viml coding style guide
|
||||
|
||||
### Portability
|
||||
|
||||
Vim is highly configurable. Users can change many of the default settings, including the case sensitivity, the regular expression rules, the substitution rules, and more. In order for your vimscript to work for all users, follow these guidelines:
|
||||
|
||||
#### Strings
|
||||
|
||||
**Prefer single quoted strings**
|
||||
|
||||
Double quoted strings are semantically different in vimscript, and you probably don't want them (they break regexes).
|
||||
|
||||
Use double quoted strings when you need an escape sequence (such as "\n") or if you know it doesn't matter and you need to embed single quotes.
|
||||
Use double quoted strings when you need an escape sequence (such as "\\n") or if you know it doesn't matter and you need to embed single quotes.
|
||||
|
||||
#### Matching Strings
|
||||
|
||||
**Use the =~# or =~? operator families over the =~ family.**
|
||||
|
||||
The matching behavior depends upon the user's ignorecase and smartcase settings and on whether you compare them with the =~, =~#, or =~? family of operators. Use the =~# and =~? operator families explicitly when comparing strings unless you explicitly need to honor the user's case sensitivity settings.
|
||||
|
||||
#### Regular Expressions
|
||||
**Prefix all regexes with one of \m, \v, \M, or \V.**
|
||||
|
||||
In addition to the case sensitivity settings, regex behavior depends upon the user's nomagic setting. To make regexes act like nomagic and noignorecase are set, prepend all regexes with one of \m, \v, \M, or \V.
|
||||
**Prefix all regexes with one of \\m, \\v, \\M, or \\V.**
|
||||
|
||||
You are welcome to use other magic levels (\v) and case sensitivities (\c) so long as they are intentional and explicit.
|
||||
In addition to the case sensitivity settings, regex behavior depends upon the user's nomagic setting. To make regexes act like nomagic and noignorecase are set, prepend all regexes with one of \\m, \\v, \\M, or \\V.
|
||||
|
||||
You are welcome to use other magic levels (\\v) and case sensitivities (\\c) so long as they are intentional and explicit.
|
||||
|
||||
#### Dangerous commands
|
||||
|
||||
**Avoid commands with unintended side effects.**
|
||||
|
||||
Avoid using :s[ubstitute] as it moves the cursor and prints error messages. Prefer functions (such as search()) better suited to scripts.
|
||||
@ -55,6 +87,7 @@ The meaning of the g flag depends upon the gdefault setting. If you do use :subs
|
||||
For many vim commands, functions exist that do the same thing with fewer side effects. See :help functions() for a list of built-in functions.
|
||||
|
||||
#### Fragile commands
|
||||
|
||||
**Avoid commands that rely on user settings.**
|
||||
|
||||
Always use normal! instead of normal. The latter depends upon the user's key mappings and could do anything.
|
||||
@ -64,12 +97,15 @@ Avoid :s[ubstitute], as its behavior depends upon a number of local settings.
|
||||
The same applies to other commands not listed here.
|
||||
|
||||
#### Catching Exceptions
|
||||
|
||||
**Match error codes, not error text.**
|
||||
|
||||
Error text may be locale dependant.
|
||||
|
||||
### General Guidelines
|
||||
|
||||
#### Messaging
|
||||
|
||||
**Message the user infrequently.**
|
||||
|
||||
Loud scripts are annoying. Message the user only when:
|
||||
@ -78,6 +114,7 @@ Loud scripts are annoying. Message the user only when:
|
||||
- An error has occurred.
|
||||
|
||||
#### Type checking
|
||||
|
||||
**Use strict and explicit checks where possible.**
|
||||
|
||||
Vimscript has unsafe, unintuitive behavior when dealing with some types. For instance, 0 == 'foo' evaluates to true.
|
||||
@ -89,21 +126,25 @@ Check variable types explicitly before using them. Use functions from maktaba#en
|
||||
Use :unlet for variables that may change types, particularly those assigned inside loops.
|
||||
|
||||
#### Python
|
||||
|
||||
**Use sparingly.**
|
||||
|
||||
Use python only when it provides critical functionality, for example when writing threaded code.
|
||||
|
||||
#### Other Languages
|
||||
|
||||
**Use vimscript instead.**
|
||||
|
||||
Avoid using other scripting languages such as ruby and lua. We can not guarantee that the end user's vim has been compiled with support for non-vimscript languages.
|
||||
|
||||
#### Plugin layout
|
||||
|
||||
**Organize functionality into modular plugins**
|
||||
|
||||
Group your functionality as a plugin, unified in one directory (or code repository) which shares your plugin's name (with a "vim-" prefix or ".vim" suffix if desired). It should be split into plugin/, autoload/, etc. subdirectories as necessary, and it should declare metadata in the addon-info.json format (see the VAM documentation for details).
|
||||
|
||||
#### Functions
|
||||
|
||||
**In the autoload/ directory, defined with [!] and [abort].**
|
||||
|
||||
Autoloading allows functions to be loaded on demand, which makes startuptime faster and enforces function namespacing.
|
||||
@ -117,6 +158,7 @@ Non-library plugins should expose commands instead of functions. Command logic s
|
||||
[abort] forces the function to halt when it encounters an error.
|
||||
|
||||
#### Commands
|
||||
|
||||
**In the plugin/commands.vim or under the ftplugin/ directory, defined without [!].**
|
||||
|
||||
General commands go in plugin/commands.vim. Filetype-specific commands go in ftplugin/.
|
||||
@ -124,6 +166,7 @@ General commands go in plugin/commands.vim. Filetype-specific commands go in ftp
|
||||
Excluding [!] prevents your plugin from silently clobbering existing commands. Command conflicts should be resolved by the user.
|
||||
|
||||
#### Autocommands
|
||||
|
||||
**Place them in plugin/autocmds.vim, within augroups.**
|
||||
|
||||
Place all autocommands in augroups.
|
||||
@ -133,6 +176,7 @@ The augroup name should be unique. It should either be, or be prefixed with, the
|
||||
Clear the augroup with autocmd! before defining new autocommands in the augroup. This makes your plugin re-entrable.
|
||||
|
||||
#### Mappings
|
||||
|
||||
**Place them in plugin/mappings.vim, using maktaba#plugin#MapPrefix to get a prefix.**
|
||||
|
||||
All key mappings should be defined in plugin/mappings.vim.
|
||||
@ -148,6 +192,7 @@ Your plugins generally shouldn't introduce mappings, but if they do, the map com
|
||||
When using catch, match the error code rather than the error text.
|
||||
|
||||
#### Settings
|
||||
|
||||
**Change settings locally**
|
||||
|
||||
Use :setlocal and &l: instead of :set and & unless you have explicit reason to do otherwise.
|
||||
@ -189,6 +234,7 @@ such as "noremap <leader>gf :grep -f ".
|
||||
```
|
||||
|
||||
#### Line Continuations
|
||||
|
||||
- Prefer line continuations on semantic boundaries.
|
||||
|
||||
```diff
|
||||
@ -214,6 +260,7 @@ autocommand BufEnter <buffer>
|
||||
- Do not continue multi-line commands when you can avoid it. Prefer function calls.
|
||||
|
||||
#### Naming
|
||||
|
||||
In general, use plugin-names-like-this, FunctionNamesLikeThis, CommandNamesLikeThis, augroup_names_like_this, variable_names_like_this.
|
||||
|
||||
Always prefix variables with their scope.
|
||||
@ -221,28 +268,29 @@ Always prefix variables with their scope.
|
||||
- plugin-names-like-this
|
||||
Keep them short and sweet.
|
||||
- FunctionNamesLikeThis
|
||||
- Prefix script-local functions with s:
|
||||
- Autoloaded functions may not have a scope prefix.
|
||||
- Do not create global functions. Use autoloaded functions instead.
|
||||
- Prefix script-local functions with s:
|
||||
- Autoloaded functions may not have a scope prefix.
|
||||
- Do not create global functions. Use autoloaded functions instead.
|
||||
- CommandNamesLikeThis
|
||||
Prefer succinct command names over common command prefixes.
|
||||
- variable_names_like_this
|
||||
Augroup names count as variables for naming purposes.
|
||||
- Prefix all variables with their scope.
|
||||
- Global variables with g:
|
||||
- Script-local variables with s:
|
||||
- Function arguments with a:
|
||||
- Function-local variables with l:
|
||||
- Vim-predefined variables with v:
|
||||
- Buffer-local variables with b:
|
||||
- g:, s:, and a: must always be used.
|
||||
- b: changes the variable semantics; use it when you want buffer-local semantics.
|
||||
- l: and v: should be used for consistency, future proofing, and to avoid subtle bugs. They are not strictly required. Add them in new code but don’t go out of your way to add them elsewhere.
|
||||
- Global variables with g:
|
||||
- Script-local variables with s:
|
||||
- Function arguments with a:
|
||||
- Function-local variables with l:
|
||||
- Vim-predefined variables with v:
|
||||
- Buffer-local variables with b:
|
||||
- g:, s:, and a: must always be used.
|
||||
- b: changes the variable semantics; use it when you want buffer-local semantics.
|
||||
- l: and v: should be used for consistency, future proofing, and to avoid subtle bugs. They are not strictly required. Add them in new code but don’t go out of your way to add them elsewhere.
|
||||
|
||||
## Markdown style guide
|
||||
|
||||
## Thanks:
|
||||
- link : https://google.github.io/styleguide/vimscriptguide.xml
|
||||
- link : https://google.github.io/styleguide/vimscriptfull.xml
|
||||
- link : https://github.com/noahfrederick/vim-scripting-style-guide/blob/master/doc/scripting-style.txt
|
||||
|
||||
- link : <https://google.github.io/styleguide/vimscriptguide.xml>
|
||||
- link : <https://google.github.io/styleguide/vimscriptfull.xml>
|
||||
- link : <https://github.com/noahfrederick/vim-scripting-style-guide/blob/master/doc/scripting-style.txt>
|
||||
- [google's markdown style guide](https://github.com/google/styleguide/blob/3591b2e540cbcb07423e02d20eee482165776603/docguide/style.md)
|
||||
|
@ -515,6 +515,10 @@ The letters displayed in the statusline correspond to the key bindings used to t
|
||||
| `SPC t S` | Ⓢ | S | enabled in spell checking |
|
||||
| `SPC t w` | ⓦ | w | whitespace mode |
|
||||
|
||||
**colorscheme of statusline:**
|
||||
|
||||
current version only support `gruvbox`/`molokai`/`nord`/`one`/`onedark`, if you want to contribute theme please check the template of a statusline theme.
|
||||
|
||||
#### tabline
|
||||
|
||||
Buffers will be listed on tabline if there is only one tab, each item contains the index, filetype icon and the bufname. if there are more than one tab, all tabs will be listed on the tabline. each item can be quickly accessed using `<Leader> number`. default `<Leader>` is `\`.
|
||||
|
Loading…
Reference in New Issue
Block a user