1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 23:49:19 +08:00

Update chinese document (#1331)

squash and merged
This commit is contained in:
Wang Shidong 2018-01-27 01:07:02 +08:00 committed by GitHub
parent fd3a0ce108
commit ba59ca2520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 4485 additions and 82 deletions

5
.ci/bootstrap Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# usage: script/bootstrap
#
cd docs && bundle install

6
.ci/build-production Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# usage: script/build-production
#
# Run the jekyll build
cd docs && bundle exec jekyll build

View File

@ -23,6 +23,5 @@ elif [ "${LINT#vader}" != "$LINT" ]; then
./configure $C_OPTS &&
make install)
elif [ "$LINT" = "jekyll" ]; then
cd docs
bundle install
.ci/bootstrap
fi

View File

@ -30,7 +30,7 @@ elif [ "$LINT" = "vader" ]; then
pip install codecov
codecov -X search gcov pycov -f coverage.xml
elif [ "$LINT" = "jekyll" ]; then
cd docs
bundle exec jekyll build --drafts
.ci/build-production
tree docs/_site
fi
set +x

4
.github/CODEOWNERS vendored
View File

@ -3,3 +3,7 @@
# @wsdjeg will be requested for review when someone opens a
# pull request.
* @wsdjeg
# 中文文件
# 中文模块翻译
docs/layers/* @SLZhang-CUG

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
doc/tags
doc/tags-cn
.ropeproject/
wiki/.git
*.class

View File

@ -1,4 +1,7 @@
language: python
language: ruby
rvm:
- 2.1
dist: trusty
sudo: false

View File

@ -5,7 +5,7 @@
[Twitter](https://twitter.com/SpaceVim) \|
[Community](https://spacevim.org/community/) \|
[Gitter **Chat**](https://gitter.im/SpaceVim/SpaceVim) \|
[中文文档](http://spacevim.org/README_zh_cn/)
[中文官网](http://spacevim.org/cn/)
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=master)](https://travis-ci.org/SpaceVim/SpaceVim)
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/master?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
@ -30,18 +30,34 @@ Here is a throughput graph of the repository for the last few weeks:
<!-- vim-markdown-toc GFM -->
- [Features](#features)
- [Requirements](#requirements)
- [Install](#install)
- [Linux and macOS](#linux-and-macos)
- [Windows](#windows)
- [Project layout](#project-layout)
- [Features](#features)
- [Blogs](#blogs)
- [Support SpaceVim](#support-spacevim)
- [Credits & Thanks](#credits--thanks)
<!-- vim-markdown-toc -->
### Features
- **Great documentation:** access documentation in Vim with <kbd>SPC h SPC</kbd>.
![SPC h SPC](https://user-images.githubusercontent.com/13142418/31620230-48b53eea-b2c9-11e7-90d0-b717878875d4.gif)
- **Beautiful UI:** you'll love the awesome UI and its useful features.
![beautiful UI](https://user-images.githubusercontent.com/13142418/33804722-bc241f50-dd70-11e7-8dd8-b45827c0019c.png)
- **Mnemonic key bindings:** all key bindings have mnemonic prefixes.
![mapping guide](https://user-images.githubusercontent.com/13142418/31550099-c8173ff8-b062-11e7-967e-6378a9c3b467.gif)
- **Describe key bindings:** use <kbd>SPC h d k</kbd> to describe key bindings, and find definition of key bindings.
![describe key](https://user-images.githubusercontent.com/13142418/33804739-52dbc498-dd71-11e7-97e5-ed0fa6ec1719.gif)
- **Lazy load plugins:** Lazy-load 90% of plugins with [dein.vim](https://github.com/Shougo/dein.vim)
![UI for dein](https://user-images.githubusercontent.com/13142418/31309093-36c01150-abb3-11e7-836c-3ad406bdd71a.gif)
- **Awesome statusline:** a heavily customized modular statusline.
![statusline](https://user-images.githubusercontent.com/13142418/33804880-b9177142-dd73-11e7-82d5-1780dc27e7e3.png)
- **Neovim centric:** Dark powered mode of SpaceVim
### Requirements
At a minimum, SpaceVim requires `git` to be installed. For a better graphical experience, install [nerd-font](https://github.com/ryanoasis/nerd-fonts) and make sure your terminal supports [true colors](https://gist.github.com/XVilka/8346728).
@ -80,21 +96,6 @@ The easist way is to download [install.cmd](https://spacevim.org/install.cmd) an
└─ test/ tests
```
### Features
- **Great documentation:** access documentation in Vim with <kbd>SPC h SPC</kbd>.
![SPC h SPC](https://user-images.githubusercontent.com/13142418/31620230-48b53eea-b2c9-11e7-90d0-b717878875d4.gif)
- **Beautiful UI:** you'll love the awesome UI and its useful features.
![beautiful UI](https://user-images.githubusercontent.com/13142418/33804722-bc241f50-dd70-11e7-8dd8-b45827c0019c.png)
- **Mnemonic key bindings:** all key bindings have mnemonic prefixes.
![mapping guide](https://user-images.githubusercontent.com/13142418/31550099-c8173ff8-b062-11e7-967e-6378a9c3b467.gif)
- **Describe key bindings:** use <kbd>SPC h d k</kbd> to describe key bindings, and find definition of key bindings.
![describe key](https://user-images.githubusercontent.com/13142418/33804739-52dbc498-dd71-11e7-97e5-ed0fa6ec1719.gif)
- **Lazy load plugins:** Lazy-load 90% of plugins with [dein.vim](https://github.com/Shougo/dein.vim)
![UI for dein](https://user-images.githubusercontent.com/13142418/31309093-36c01150-abb3-11e7-836c-3ad406bdd71a.gif)
- **Awesome statusline:** a heavily customized modular statusline.
![statusline](https://user-images.githubusercontent.com/13142418/33804880-b9177142-dd73-11e7-82d5-1780dc27e7e3.png)
- **Neovim centric:** Dark powered mode of SpaceVim
### Blogs

View File

@ -1,7 +1,11 @@
function! SpaceVim#layers#chinese#plugins() abort
return [
\ ['vimcn/vimcdoc'],
let plugins = [
\ ['yianwillis/vimcdoc', {'merged' : 0}],
\ ]
if index(g:spacevim_plugin_groups, 'ctrlp') != -1
call add(plugins, [['vimcn/ctrlp.cnx', {'merged' : 0}]])
endif
return plugins
endfunction
function! SpaceVim#layers#chinese#config() abort

1232
doc/SpaceVim.cnx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,14 @@ title: "404"
permalink: /404
---
{% if page.language == "cn" %}
## Oops! 你所访问的页面不存在!
> 你可以返回 [首页](https://spacevim.org/cn/) 阅读 [中文博客](https://spacevim.org/cn/blog/)
{% else %}
## Oops! The page you requested was not found!
> you can go to [home](https://spacevim.org) or checkout [Blogs](https://spacevim.org/blog/)
{% endif %}

View File

@ -3,3 +3,4 @@ gem 'github-pages', group: :jekyll_plugins
gem 'jekyll-redirect-from', group: :jekyll_plugins
gem 'jekyll-seo-tag'
gem 'jekyll-feed'

7
docs/_data/i18n.yaml Normal file
View File

@ -0,0 +1,7 @@
en:
previous_page: Previous
next_page: Next
cn:
previous_page: 上一页
next_page: 下一页

View File

@ -59,6 +59,21 @@
<div id="titlex">
<p align="center">{{ site.title | default: site.github.repository_name }}</p>
</div>
{% if page.lang == "cn" %}
<div id="title">
<p>{{ site.description | default: site.github.project_tagline }}</p>
<hr>
<p align="center">
<b><a href="{{ site.url }}/cn/">主页</a></b> |
<b><a href="{{ site.url }}/cn/about">关于我们</a></b> |
<b><a href="{{ site.url }}/cn/documentation">使用文档</a></b> |
<b><a href="{{ site.url }}/cn/development">开发指南</a></b> |
<b><a href="{{ site.url }}/cn/community">用户社区</a></b> |
<b><a href="{{ site.url }}/cn/sponsors">赞助</a></b>
</p>
<hr>
</div>
{% else %}
<div id="title">
<p>{{ site.description | default: site.github.project_tagline }}</p>
<hr>
@ -72,6 +87,7 @@
</p>
<hr>
</div>
{% endif %}
{{ content }}
@ -113,10 +129,19 @@ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58a01d3aac22bd89"></script>
</body>
<root>
{% if page.lang == "cn" %}
<p align="center">
<span class="credits right">网站源码位于 Github, <a href="https://github.com/SpaceVim/SpaceVim/edit/master/docs/{{ page.path }}">帮助改进本页面</a> &mdash; 网站主题: <a href="https://twitter.com/michigangraham">mattgraham</a>,
</span>
</p>
{% else %}
<p align="center">
<span class="credits right">Hosted on GitHub, <a href="https://github.com/SpaceVim/SpaceVim/edit/master/docs/{{ page.path }}">Help improve this page</a> &mdash; Theme by <a href="https://twitter.com/michigangraham">mattgraham</a>,
</span>
</p>
{% endif %}
</root>
</html>
<!-- vim:set nowrap: -->

View File

@ -3,6 +3,7 @@ title: "VIM 中 ctrl 相关的组合键的使用"
categories: tutorials_cn
excerpt: "枚举 Vim 内置的 Ctrl 组合键功能,以及终端下的一些区别"
comments: true
lang: cn
---
# Vim 中 ctrl 组合键的使用

14
docs/api/file.cn.md Normal file
View File

@ -0,0 +1,14 @@
---
title: "file api"
---
# [APIs](https://spacevim.org/apis) : file
## values
name | values | description
----- |:----:| ------------------
separator | `/` or `\` | The system-dependent name-separator character.
pathSeparator | `:` or `;` | The system-dependent path-separator character.
## functions

15
docs/api/system.cn.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "system api"
---
# [APIs](https://spacevim.org/apis) : system
## values
name | values | description
----- |:----:| ------------------
isWindows | 0 or 1 | check if the os is windows
isLinux | 0 or 1 | check if the os is linux
isOSX | 0 or 1 | check if the os is OSX
## functions

31
docs/cn/about.md Normal file
View File

@ -0,0 +1,31 @@
---
title: "关于"
description: "SpaceVim 是一个社区驱动的模块化 vim 配置,以模块的方式组织管理插件和配置"
lang: cn
---
## 版本
[SpaceVim](https://github.com/SpaceVim/SpaceVim) 是一个社区驱动的 vim 配置,支持 vim 和 neovim。SpaceVim
使用模块的方式来组织插件,对新手更加友好。
## 目标
- 提供可跨平台的优雅的用户体验.
- 为不同语言开发提供完整的解决方案.
## 标准
- Do not regress from origin
- Decide outcomes by weighing cost and benefit
- prefer usability over tradition if the benefits are overwhelming
- Give usability a chance™
## 鸣谢
- 维护者: [Wang Shidong](https://github.com/wsdjeg)
- [![贡献者](https://img.shields.io/github/contributors/SpaceVim/SpaceVim.svg)](https://github.com/SpaceVim/SpaceVim/graphs/contributors)
- [vimdoc](https://github.com/google/vimdoc) 自动生成 vim 文档
- [Rafael Bodill](https://github.com/rafi) 的 vim 配置
- [Bailey Ling](https://github.com/bling) 的 vim 配置

29
docs/cn/apis.md Normal file
View File

@ -0,0 +1,29 @@
---
title: "公共 API"
lang: cn
---
# SpaceVim 公共 APIs
SpaceVim 提供了许多公共的 apis你可以在你的插件中使用这些公共 apisSpaceVim 的公共 apis 借鉴与 [vital.vim](https://github.com/vim-jp/vital.vim)
## 使用方法
```viml
let s:file = SpaceVim#api#import('file')
let s:system = SpaceVim#api#import('system')
if s:system.isWindows
echom "Os is Windows"
endif
echom s:file.separator
echom s:file.pathSeparator
```
以下为可用的公共 apis欢迎贡献新的 apis
名称 | 描述 | 文档
----- |:----:| -------
file | 文件 API | [readme](https://spacevim.org/api/file)
system | 系统 API | [readme](https://spacevim.org/api/system)

21
docs/cn/blog.md Normal file
View File

@ -0,0 +1,21 @@
---
title: "博客"
description: "SpaceVim 中文博客"
lang: cn
---
# SpaceVim 中文博客
在这里,你可以看到最新的 SpaceVim 特性简介,以及使用技巧:
{% for post in site.post %}
<ul>
{% if post.lang == "cn" %}
<li>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date_to_string }}</span>
<h3>{{ post.excerpt | truncatewords: 100 }}</h3>
</li>
{% endif %}
</ul>
{% endfor %}

24
docs/cn/community.md Normal file
View File

@ -0,0 +1,24 @@
---
title: "社区"
description: "SpaceVim 中文社区,让沟通更加便利,包括讨论、提问、和聊天频道。"
lang: cn
---
# SpaceVim 中文社区
查看以下频道,选择合适的频道寻求帮助或参与讨论。
## 讨论
- [知乎专栏](https://zhuanlan.zhihu.com/SpaceVim)
- [新浪微博](https://weibo.com/SpaceVim)
- 微信公众号SpaceVim
## 提问
- [segmentfault](https://segmentfault.com/t/spacevim)
- [码云问题列表](https://gitee.com/spacevim/SpaceVim/issues)
## 聊天
SpaceVim 中文聊天主要是 QQ 群121056965

296
docs/cn/conventions.md Normal file
View File

@ -0,0 +1,296 @@
---
title: "约定"
description: "描述贡献代码所需遵循的约定俗成的规范,包括 vim 脚本的代码规范以及 markdown 文件的代码规范。"
lang: cn
---
# Conventions
<!-- vim-markdown-toc GFM -->
- [Commit emoji 规范](#commit-emoji-规范)
- [vim 脚本代码规范](#vim-脚本代码规范)
- [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 代码规范](#markdown-代码规范)
- [感谢:](#感谢)
<!-- vim-markdown-toc -->
## Commit emoji 规范
- :memo: 添加一个备注或者文档
- :gift: 新的特新
- :bug: bug 修复
- :bomb: 破坏向后兼容
- :white_check_mark: 添加测试
- :fire: 移除某些配置
- :beer: 代码优化
## vim 脚本代码规范
### 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.
#### 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.
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.
The meaning of the g flag depends upon the gdefault setting. If you do use :substitute you must save gdefault, set it to 0 or 1, perform the substitution, and then restore it.
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.
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:
- A long-running process has kicked off.
- 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.
Use strict comparison operators where possible. When comparing against a string literal, use the is# operator. Otherwise, prefer maktaba#value#IsEqual or check type() explicitly.
Check variable types explicitly before using them. Use functions from maktaba#ensure, or check maktaba#value or type() and throw your own errors.
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.
Script-local functions are welcome, but should also live in autoload/ and be called by autoloaded functions.
Non-library plugins should expose commands instead of functions. Command logic should be extracted into functions and autoloaded.
[!] allows developers to reload their functions without complaint.
[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/.
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.
The augroup name should be unique. It should either be, or be prefixed with, the plugin name.
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.
Partial mappings (see :help using-<Plug>.) should be defined in plugin/plugs.vim.
**Always use the noremap family of commands.**
Your plugins generally shouldn't introduce mappings, but if they do, the map command respects the users existing mappings and could do anything.
#### Errors
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.
### Style
Follow google style conventions. When in doubt, treat vimscript style like
python style.
#### Whitespace
**Similar to python.**
- Use two spaces for indents
- Do not use tabs
- Use spaces around operators
This does not apply to arguments to commands.
let s:variable = "concatenated " . "strings"
command -range=% MyCommand
- Do not introduce trailing whitespace
You need not go out of your way to remove it.
Trailing whitespace is allowed in mappings which prep commands for user input,
such as "noremap <leader>gf :grep -f ".
- Restrict lines to 80 columns wide
- Indent continued lines by four spaces
- Do not align arguments of commands
```diff
+command -bang MyCommand call myplugin#foo()
+command MyCommand2 call myplugin#bar()
-command -bang MyCommand call myplugin#foo()
-command MyCommand2 call myplugin#bar()
```
#### Line Continuations
- Prefer line continuations on semantic boundaries.
```diff
+command SomeLongCommand
+ \ call some#function()
-command SomeLongCommand call
- \ some#function()
```
- Place one space after the backslash denoting a line continuation.
When continuing a multi-line command a pipe can be substituted for this space as necessary, as follows:
```viml
autocommand BufEnter <buffer>
\ if !empty(s:var)
\| call some#function()
\|else
\| call some#function(s:var)
\|endif
```
- 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.
- 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.
- 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 dont go out of your way to add them elsewhere.
## markdown 代码规范
## 感谢:
- 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)

304
docs/cn/development.md Normal file
View File

@ -0,0 +1,304 @@
---
title: "开发者文档"
description: "本文档是 SpaceVim 开发者文档,描述了: 1. 如何提交问题 2. 如何贡献代码 3. 代码格式规则 4. 版本迭代信息"
lang: cn
---
# SpaceVim 开发者文档
<!-- vim-markdown-toc GFM -->
- [Asking for help](#asking-for-help)
- [Reporting issues](#reporting-issues)
- [Contributing code](#contributing-code)
- [License](#license)
- [Conventions](#conventions)
- [Pull Request](#pull-request)
- [Rebase your pr Branch on top of upstream master:](#rebase-your-pr-branch-on-top-of-upstream-master)
- [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)
- [Language specified key bindings](#language-specified-key-bindings)
- [Contributing a banner](#contributing-a-banner)
- [Build with SpaceVim](#build-with-spacevim)
- [Changelog](#changelog)
<!-- vim-markdown-toc -->
SpaceVim is an effort of all the volunteers, we encourage you to pitch in. The community makes SpaceVim what it is.
We have a few guidelines, which we ask all contributors to follow.
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)
You can only consider reading the sections relevant to what you are going to do:
- [Asking for help](#asking-for-help) if you are about to open an issue to ask a question.
- [Reporting issues](#reporting-issues) if you are about to open a new issue.
- [Contributing code](#contributing-code) if you are about to send a pull-request.
## 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.
- Include details on how to reproduce it, just like a step by step guide.
## Contributing code
Code contributions are welcome. Please read the following sections carefully. In any case, feel free to join us on the [gitter chat](https://gitter.im/SpaceVim/SpaceVim) to ask questions about contributing!
### License
The license is MIT for all the parts of SpaceVim. this includes:
- The initialization and core files
- All the layer files.
For files not belonging to SpaceVim like local packages and libraries, refer to the header file. Those files should not have an empty header, we may not accept code without a proper header file.
### Conventions
SpaceVim is based on conventions, mainly for naming functions, keybindings definition and writing documentation. Please read the [conventions](https://spacevim.org/conventions/) before your first contribution to get to know them.
### Pull Request
#### Rebase your pr Branch on top of upstream master:
- fork SpaceVim repository
- clone your repository
```sh
git clone ${YOUR_OWN_REPOSITORY_URL}
```
- add upstream remote
```sh
git remote add upstream https://github.com/SpaceVim/SpaceVim.git
```
- fetch upstream and rebase on top of upstream master
```sh
git fetch upstream
git rebase upstream master
```
#### Ideally for simple PRs (most of them):
- Branch from `master`
- One topic per PR
- One commit per PR
- If you have several commits on different topics, close the PR and create one PR per topic
- If you still have several commits, squash them into only one commit
#### For complex PRs (big refactoring, etc):
Squash only the commits with uninteresting changes like typos, syntax fixes, etc… and keep the important and isolated steps in different commits.
Those PRs are merged and explicitly not fast-forwarded.
Commit messages
Write commit messages according to adapted [Tim Popes guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html):
- Use present tense and write in the imperative: “Fix bug”, not “fixed bug” or “fixes bug”.
- Start with a capitalized, short (72 characters or less) summary, followed by a blank line.
- If necessary, add one or more paragraphs with details, wrapped at 72 characters.
- Separate paragraphs by blank lines.
This is a model commit message:
```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.
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.
- 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
- Use a hanging indent
```
[Gita] provide vim mode for Git commit messages, which helps you to comply to these guidelines.
### Contributing a layer
Please read the layers documentation first.
Layer with no associated configuration will be rejected. For instance a layer with just a package and a hook can be easily replaced by the usage of the variable `g:spacevim_custom_plugins`.
#### File header
The file header for vim script should look like the following template:
```viml
"=============================================================================
" FILENAME --- NAME layer file for SpaceVim
" Copyright (c) 2012-2016 Shidong Wang & Contributors
" 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.
#### Author of a new layer
In the files header, change the default author name (Shidong Wang) to your name.
here is an example for creating a new layer names `foo`:
1. fork SpaceVim repo
2. add a layer file `autoload/SpaceVim/layers/foo.vim` for `foo` layer.
3. edit layer file, check out the example below:
```vim
"=============================================================================
" foo.vim --- foo Layer file for SpaceVim
" Copyright (c) 2012-2016 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
""
" @section foo, layer-foo
" @parentsection layers
" This the doc for this layer:
"
" @subsection Key Bindings
" >
" Mode Key Function
" -------------------------------------------------------------
" normal <leader>jA generate accessors
" normal <leader>js generate setter accessor
" <
" @subsection Layer options
" >
" Name Description Default
" -------------------------------------------------------------
" option1 Set option1 for foo layer ''
" option2 Set option2 for foo layer []
" option3 Set option3 for foo layer {}
" <
" @subsection Global options
" >
" Name Description Default
" -------------------------------------------------------------
" g:pluginA_opt1 Set opt1 for plugin A ''
" g:pluginB_opt2 Set opt2 for plugin B []
" <
function! SpaceVim#layers#foo#plugins() abort
let plugins = []
call add(plugins, ['Shougo/foo.vim', {'option' : 'value'}])
call add(plugins, ['Shougo/foo_test.vim', {'option' : 'value'}])
return plugins
endfunction
function! SpaceVim#layers#foo#config() abort
let g:foo_option1 = get(g:, 'foo_option1', 1)
let g:foo_option2 = get(g:, 'foo_option2', 2)
let g:foo_option3 = get(g:, 'foo_option3', 3)
" ...
endfunction
```
4. Add layer document `docs/layers/foo.md` for `foo` layer.
5. Open `docs/layers/index.md`, run `:call SpaceVim#dev#layers#update()` to update layer list.
6. send PR to SpaceVim.
#### Contributor to an existing layer
If you are contributing to an already existing layer, you should not modify any header file.
#### Contributing a keybinding
Mappings are an important part of SpaceVim.
First if you want to have some personal mappings, This can be done in your `~/.SpaceVim.d/init.vim` file.
If you think it worth contributing a new mappings then be sure to read the documentation to find the best mappings, then create a Pull-Request with your changes.
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 e | rename symbol |
| SPC l d | show doc |
| SPC l i r | remove unused imports |
| SPC l i s | sort imports with isort |
| 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 |
All of these above key bindings are just recommended as default, but it also base on the language layer itself.
#### Contributing a banner
The startup banner is by default the SpaceVim logo but there are also ASCII banners available in the core/banner layer.
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.
## Build with SpaceVim
SpaceVim provide a lot of public [APIs](https://spacevim.org/apis), you can create plugins base on this APIs. also you can add a badge to the README.md of your plugin.
![](https://img.shields.io/badge/build%20with-SpaceVim-ff69b4.svg)
markdown
```md
[![](https://spacevim.org/img/build-with-SpaceVim.svg)](https://spacevim.org)
```
## Changelog
<ul>
{% for post in site.categories.changelog %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>

View File

@ -1,49 +1,10 @@
---
title: "SpaceVim 中文手册"
description: "SpaceVim 是一个社区驱动的模块化 Vim 配置,以模块的方式组织和管理插件,为不同语言开发定制特定的模块,提供语法检查、自动补全、格式化、一键编译运行、以及 REPL 和 DEBUG 支持。"
redirect_from: "/README_zh_cn/"
lang: cn
---
# SpaceVim 中文手册
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev)
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev)
[![Version](https://img.shields.io/badge/version-0.7.0--dev-FF00CC.svg)](https://github.com/SpaceVim/SpaceVim/releases)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE)
[![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG)
[![Weibo](https://img.shields.io/badge/Weibo-%40SpaceVim-orange.svg)](https://weibo.com/SpaceVim)
[![GitHub stars](https://img.shields.io/github/stars/SpaceVim/SpaceVim.svg?style=social&label=Star)](https://github.com/SpaceVim/SpaceVim)
![welcome-page](https://user-images.githubusercontent.com/13142418/33793078-3446cb6e-dc76-11e7-9998-376a355557a4.png)
项 目 主 页: <https://spacevim.org>
Github 地址 : <https://github.com/SpaceVim/SpaceVim>
SpaceVim 是一个社区驱动的模块化 vim/neovim 配置集合,以模块的方式组织管理插件以
及相关配置,为不同的语言开发量身定制了相关的开发模块,该模块提供代码自动补全,
语法检查、格式化、调试、REPL 等特性。用户仅需载入相关语言的模块即可得到一个开箱
即用的Vim-IDE。
使用过程中遇到问题或者有什么功能需求可以在 github 提交 issue这将更容易被关注
和修复。我们也欢迎喜欢 vim/neovim 的用户加入我们的
[QQ群(点击加入)](https://jq.qq.com/?_wv=1027&k=43zWPlT),该群定期也会分享一些
实用的 Vim 技巧以及插件。
以下是近几周的开发汇总:
[![Throughput Graph](https://graphs.waffle.io/SpaceVim/SpaceVim/throughput.svg)](https://github.com/SpaceVim/SpaceVim/pulse)
**SpaceVim 微信公众号:**
<img src="https://spacevim.org/img/weixingongzhonghao.png" height="200" width="200">
推荐阅读:
- [SpaceVim 入门教程](https://everettjf.gitbooks.io/spacevimtutorial/content/)
- [Hack SpaceVim 中文版](https://github.com/Gabirel/Hack-SpaceVim/blob/master/README_zh_CN.md)
## 目录
<!-- vim-markdown-toc GFM -->

11
docs/cn/faq.md Normal file
View File

@ -0,0 +1,11 @@
### Where should I put my configration?
SpaceVim load custom configuration from `~/.SpaceVim.d/init.vim`.
1. E492: Not an editor command: ^M
The problem was git auto added ^M when cloning, solved by:
```sh
git config --global core.autocrlf input
```

55
docs/cn/index.md Normal file
View File

@ -0,0 +1,55 @@
---
title: "主页"
description: "SpaceVim is a community-driven vim distribution that seeks to provide layer feature."
lang: cn
---
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev)
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev)
[![Version](https://img.shields.io/badge/version-0.7.0--dev-FF00CC.svg)](https://github.com/SpaceVim/SpaceVim/releases)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE)
[![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG)
[![Weibo](https://img.shields.io/badge/Weibo-%40SpaceVim-orange.svg)](https://weibo.com/SpaceVim)
[![GitHub stars](https://img.shields.io/github/stars/SpaceVim/SpaceVim.svg?style=social&label=Star)](https://github.com/SpaceVim/SpaceVim)
![welcome-page](https://user-images.githubusercontent.com/13142418/33793078-3446cb6e-dc76-11e7-9998-376a355557a4.png)
项 目 主 页: <https://spacevim.org>
Github 地址 : <https://github.com/SpaceVim/SpaceVim>
SpaceVim 是一个社区驱动的模块化 vim/neovim 配置集合,以模块的方式组织管理插件以
及相关配置,为不同的语言开发量身定制了相关的开发模块,该模块提供代码自动补全,
语法检查、格式化、调试、REPL 等特性。用户仅需载入相关语言的模块即可得到一个开箱
即用的Vim-IDE。
推荐阅读:
- [入门指南](quick-start-guide)
- [用户文档](documentation)
- [可用模块](layers)
## 最新特新
<ul>
{% for post in site.categories.feature_cn offset: 0 limit: 5 %}
<strong><a href="{{ post.url }}">{{ post.title }}</a></strong>
<br>
<span class="post-date">{{ post.date | date_to_string }}</span>
<p>{{ post.excerpt | truncatewords: 100 }}</p>
<br>
<img alt="{{ post.title }}" src="{{ post.image }}">
{% endfor %}
</ul>
更多精彩博客请订阅 [SpaceVim 中文博客](https://spacevim.org/cn/blog/)
[关注微博 @SpaceVim](https://weibo.com/SpaceVim)
## 参与
使用过程中遇到问题或者有什么功能需求可以在码云提交,这将更容易被关注
和修复。我们也欢迎喜欢 vim/neovim 的用户加入我们的
[QQ群(点击加入)](https://jq.qq.com/?_wv=1027&k=43zWPlT),该群定期也会分享一些
实用的 Vim 技巧以及插件。

98
docs/cn/install.cmd Normal file
View File

@ -0,0 +1,98 @@
@PowerShell -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) & goto :EOF
echo " /###### /## /##/## "
echo " /##__ ## | ## | #|__/ "
echo " | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### "
echo " | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##"
echo " \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##"
echo " /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##"
echo " | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##"
echo " \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/"
echo " | ## "
echo " | ## "
echo " |__/ "
echo " version : 0.7.0-dev by : spacevim.org "
Push-Location ~
$app_name = "SpaceVim"
$repo_url = "https://github.com/SpaceVim/SpaceVim.git"
$repo_name = "SpaceVim"
$repo_path = "$HOME\.SpaceVim"
Function Pause ($Message = "Press any key to continue . . . ") {
if ((Test-Path variable:psISE) -and $psISE) {
$Shell = New-Object -ComObject "WScript.Shell"
$Button = $Shell.Popup("Click OK to continue.", 0, "Script Paused", 0)
} else {
Write-Host -NoNewline $Message
[void][System.Console]::ReadKey($true)
Write-Host
}
}
echo "==> Starting Testing Procedure..."
echo ""
sleep 1
echo "==> Testing git"
if (Get-Command "git" -ErrorAction SilentlyContinue) {
git version
echo "[OK] Test successfully. Moving to next..."
sleep 1
} else {
echo ""
echo "[ERROR] Unable to find 'git.exe' in your PATH"
echo ">>> Ready to Exit......"
Pause
exit
}
echo ""
echo "==> Testing vim"
if (Get-Command "gvim" -ErrorAction SilentlyContinue) {
echo ($(vim --version) -split '\n')[0]
echo "[OK] Test successfully. Moving to next..."
sleep 1
} else {
echo "[WARNING] Unable to find 'gvim.exe' in your PATH. But intallation still can continue..."
echo ""
echo "[WARNING] Please install gvim later or make your PATH correctly set! "
Pause
}
echo "<== Testing Procedure Completed. Moving to next..."
sleep 1
echo ""
echo ""
if (!(Test-Path "$HOME\.SpaceVim")) {
echo "==> Trying to clone $app_name"
git clone $repo_url $repo_path
} else {
echo "==> Trying to update $app_name"
Push-Location $repo_path
git pull origin master
}
echo ""
if (!(Test-Path "$HOME\vimfiles")) {
cmd /c mklink $HOME\vimfiles $repo_path
} else {
echo "[OK] vimfiles already exists"
sleep 1
}
echo ""
echo "Almost done!"
echo "=============================================================================="
echo "== Open GVim and it will install the plugins automatically =="
echo "=============================================================================="
echo ""
echo "That's it. Thanks for installing $app_name. Enjoy!"
echo ""
Pause

299
docs/cn/install.sh Normal file
View File

@ -0,0 +1,299 @@
#!/usr/bin/env bash
#=============================================================================
# install.sh --- bootstrap script for SpaceVim
# Copyright (c) 2016-2017 Shidong Wang & Contributors
# Author: Shidong Wang < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: MIT license
#=============================================================================
# Reset
Color_off='\033[0m' # Text Reset
Version='0.6.0'
# Regular Colors
Red='\033[0;31m'
Blue='\033[0;34m'
Green='\033[0;32m'
#System name
System="$(uname -s)"
need_cmd () {
if ! hash "$1" &>/dev/null; then
error "Need '$1' (command not fount)"
exit 1
fi
}
msg() {
printf '%b\n' "$1" >&2
}
success() {
msg "${Green}[✔]${Color_off} ${1}${2}"
}
info() {
msg "${Blue}==>${Color_off} ${1}${2}"
}
error() {
msg "${Red}[✘]${Color_off} ${1}${2}"
exit 1
}
warn () {
msg "${Red}[✘]${Color_off} ${1}${2}"
}
fetch_repo () {
if [[ -d "$HOME/.SpaceVim" ]]; then
info "Trying to update SpaceVim"
git --git-dir "$HOME/.SpaceVim/.git" pull
success "Successfully update SpaceVim"
else
info "Trying to clone SpaceVim"
git clone https://github.com/SpaceVim/SpaceVim.git "$HOME/.SpaceVim"
success "Successfully clone SpaceVim"
fi
}
install_vim () {
if [[ -f "$HOME/.vimrc" ]]; then
mv "$HOME/.vimrc" "$HOME/.vimrc_back"
success "Backup $HOME/.vimrc to $HOME/.vimrc_back"
fi
if [[ -d "$HOME/.vim" ]]; then
if [[ "$(readlink $HOME/.vim)" =~ \.SpaceVim$ ]]; then
success "Installed SpaceVim for vim"
else
mv "$HOME/.vim" "$HOME/.vim_back"
success "BackUp $HOME/.vim to $HOME/.vim_back"
ln -s "$HOME/.SpaceVim" "$HOME/.vim"
success "Installed SpaceVim for vim"
fi
else
ln -s "$HOME/.SpaceVim" "$HOME/.vim"
success "Installed SpaceVim for vim"
fi
}
install_package_manager () {
if [[ ! -d "$HOME/.cache/vimfiles/repos/github.com/Shougo/dein.vim" ]]; then
info "Install dein.vim"
git clone https://github.com/Shougo/dein.vim.git $HOME/.cache/vimfiles/repos/github.com/Shougo/dein.vim
success "dein.vim installation done"
fi
}
install_neovim () {
if [[ -d "$HOME/.config/nvim" ]]; then
if [[ "$(readlink $HOME/.config/nvim)" =~ \.SpaceVim$ ]]; then
success "Installed SpaceVim for neovim"
else
mv "$HOME/.config/nvim" "$HOME/.config/nvim_back"
success "BackUp $HOME/.config/nvim to $HOME/.config/nvim_back"
ln -s "$HOME/.SpaceVim" "$HOME/.config/nvim"
success "Installed SpaceVim for neovim"
fi
else
ln -s "$HOME/.SpaceVim" "$HOME/.config/nvim"
success "Installed SpaceVim for neovim"
fi
}
uninstall_vim () {
if [[ -d "$HOME/.vim" ]]; then
if [[ "$(readlink $HOME/.vim)" =~ \.SpaceVim$ ]]; then
rm "$HOME/.vim"
success "Uninstall SpaceVim for vim"
if [[ -d "$HOME/.vim_back" ]]; then
mv "$HOME/.vim_back" "$HOME/.vim"
success "Recover from $HOME/.vim_back"
fi
fi
fi
if [[ -f "$HOME/.vimrc_back" ]]; then
mv "$HOME/.vimrc_back" "$HOME/.vimrc"
success "Recover from $HOME/.vimrc_back"
fi
}
uninstall_neovim () {
if [[ -d "$HOME/.config/nvim" ]]; then
if [[ "$(readlink $HOME/.config/nvim)" =~ \.SpaceVim$ ]]; then
rm "$HOME/.config/nvim"
success "Uninstall SpaceVim for neovim"
if [[ -d "$HOME/.config/nvim_back" ]]; then
mv "$HOME/.config/nvim_back" "$HOME/.config/nvim"
success "Recover from $HOME/.config/nvim_back"
fi
fi
fi
}
check_requirements () {
info "Checking Requirements for SpaceVim"
if hash "git" &>/dev/null; then
git_version=$(git --version)
success "Check Requirements: ${git_version}"
else
warn "Check Requirements : git"
fi
if hash "vim" &>/dev/null; then
is_vim8=$(vim --version | grep "Vi IMproved 8.0")
is_vim74=$(vim --version | grep "Vi IMproved 7.4")
if [ -n "$is_vim8" ]; then
success "Check Requirements: vim 8.0"
elif [ -n "$is_vim74" ]; then
success "Check Requirements: vim 7.4"
else
if hash "nvim" &>/dev/null; then
success "Check Requirements: nvim"
else
warn "SpaceVim need vim 7.4 or above"
fi
fi
if hash "nvim" &>/dev/null; then
success "Check Requirements: nvim"
fi
else
if hash "nvim" &>/dev/null; then
success "Check Requirements: nvim"
else
warn "Check Requirements : vim or nvim"
fi
fi
info "Checking true colors support in terminal:"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh)"
}
usage () {
echo "SpaceVim install script : V ${Version}"
echo ""
echo "Usage : curl -sLf https://spacevim.org/install.sh | bash -s -- [option] [target]"
echo ""
echo " This is bootstrap script for SpaceVim."
echo ""
echo "OPTIONS"
echo ""
echo " -i, --install install spacevim for vim or neovim"
echo " -v, --version Show version information and exit"
echo " -u, --uninstall Uninstall SpaceVim"
echo " -c, --checkRequirements checkRequirements for SpaceVim"
echo ""
echo "EXAMPLE"
echo ""
echo " Install SpaceVim for vim and neovim"
echo ""
echo " curl -sLf https://spacevim.org/install.sh | bash"
echo ""
echo " Install SpaceVim for vim only or neovim only"
echo ""
echo " curl -sLf https://spacevim.org/install.sh | bash -s -- --install vim"
echo " curl -sLf https://spacevim.org/install.sh | bash -s -- --install neovim"
echo ""
echo " Uninstall SpaceVim"
echo ""
echo " curl -sLf https://spacevim.org/install.sh | bash -s -- --uninstall"
}
download_font () {
url="https://raw.githubusercontent.com/wsdjeg/DotFiles/master/local/share/fonts/$1"
path="$HOME/.local/share/fonts/$1"
if [[ -f "$path" ]]
then
success "Downloaded $1"
else
info "Downloading $1"
wget -q -O "$path" "$url"
success "Downloaded $1"
fi
}
install_fonts () {
if [[ ! -d "$HOME/.local/share/fonts" ]]; then
mkdir -p $HOME/.local/share/fonts
fi
download_font "DejaVu Sans Mono Bold Oblique for Powerline.ttf"
download_font "DejaVu Sans Mono Bold for Powerline.ttf"
download_font "DejaVu Sans Mono Oblique for Powerline.ttf"
download_font "DejaVu Sans Mono for Powerline.ttf"
download_font "DroidSansMonoForPowerlinePlusNerdFileTypesMono.otf"
download_font "Ubuntu Mono derivative Powerline Nerd Font Complete.ttf"
download_font "WEBDINGS.TTF"
download_font "WINGDNG2.ttf"
download_font "WINGDNG3.ttf"
download_font "devicons.ttf"
download_font "mtextra.ttf"
download_font "symbol.ttf"
download_font "wingding.ttf"
echo -n "Updating font cache... "
if [ $System == "Darwin" ];then
if [ ! -e "$HOME/Library/Fonts" ];then
mkdir "$HOME/Library/Fonts"
fi
cp $HOME/.local/share/fonts/* $HOME/Library/Fonts/
else
fc-cache -fv
mkfontdir "$HOME/.local/share/fonts"
mkfontscale "$HOME/.local/share/fonts"
fi
echo "done"
}
if [ $# -gt 0 ]
then
case $1 in
--uninstall|-u)
info "Trying to uninstall SpaceVim"
uninstall_vim
uninstall_neovim
exit 0
;;
--checkRequirements|-c)
check_requirements
exit 0
;;
--install|-i)
need_cmd 'git'
fetch_repo
if [ $# -eq 2 ]
then
case $2 in
neovim)
install_neovim
exit 0
;;
vim)
install_vim
exit 0
esac
fi
install_vim
install_neovim
exit 0
;;
--help|-h)
usage
exit 0
;;
--version|-v)
msg "${Version}"
exit 0
esac
fi
# if no argv, installer will install SpaceVim
need_cmd 'git'
fetch_repo
install_vim
install_neovim
install_package_manager
install_fonts

View File

@ -0,0 +1,120 @@
---
title: "SpaceVim autocomplete layer"
description: "This layer provides auto-completion to SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) autocomplete
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Configuration](#configuration)
- [Key bindings](#key-bindings)
- [Snippets directories](#snippets-directories)
- [Show snippets in auto-completion popup](#show-snippets-in-auto-completion-popup)
- [LSP supported](#lsp-supported)
- [Key bindings](#key-bindings-1)
- [auto-complete](#auto-complete)
- [Neosnippet](#neosnippet)
<!-- vim-markdown-toc -->
## Description
This layer provides auto-completion to SpaceVim.
The following completion engines are supported:
- [neocomplete](https://github.com/Shougo/neocomplete.vim) - vim with `+lua`
- [neocomplcache](https://github.com/Shougo/neocomplcache.vim) - vim without `+lua`
- [deoplete](https://github.com/Shougo/deoplete.nvim) - neovim with `+python3`
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) - disabled by default, to enable ycm, see `:h g:spacevim_enable_ycm`
Snippets are supported via [neosnippet](https://github.com/Shougo/neosnippet.vim).
## Install
To use this configuration layer, add it to your custom configuration file.
```vim
call SpaceVim#layers#load('autocomplete')
```
## Configuration
### Key bindings
You can customize the user experience of auto-completion with the following layer variables:
1. `auto-completion-return-key-behavior` set the action to perform when the `Return`/`Enter` key is pressed, the possible values are:
- `complete` completes with the current selection
- `smart` completes with current selection and expand snippet or argvs
- `nil`
2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are:
- `smart` cycle candidates, expand snippets, jump parameters
- `complete` completes with the current selection
- `cycle` completes the common prefix and cycle between candidates
- `nil` insert a carriage return
3. `auto-completion-complete-with-key-sequence` is a string of two characters denoting a key sequence that will perform a `complete` action if the sequence as been entered quickly enough. If its value is `nil` then the feature is disabled.
4. `auto-completion-complete-with-key-sequence-delay` is the number of seconds to wait for the auto-completion key sequence to be entered. The default value is 0.1 seconds.
The default configuration of the layer is:
```vim
call SpaceVim#layers#load('autocomplete', {
\ 'auto-completion-return-key-behavior' : 'nil',
\ 'auto-completion-tab-key-behavior' : 'smart',
\ 'auto-completion-complete-with-key-sequence' : 'nil',
\ 'auto-completion-complete-with-key-sequence-delay' : 0.1,
\ })
```
`jk` is a good candidate for `auto-completion-complete-with-key-sequence` if you dont use it already.
### Snippets directories
The following snippets or directories are added by default:
- [Shougo/neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets) : neosnippet's default snippets.
- [honza/vim-snippets](https://github.com/honza/vim-snippets) : extra snippets
- `~/.SpaceVim/snippets/` : SpaceVim runtime snippets.
- `~/.SpaceVim.d/snippets/` : custom global snippets.
- `./.SpaceVim.d/snippets/` : custom local snippets (project's snippets)
You can provide additional directories by setting the variable `g:neosnippet#snippets_directory` which can take a string in case of a single path or a list of paths.
### Show snippets in auto-completion popup
By default, snippets are shown in the auto-completion popup. To disable this feature, set the variable `auto-completion-enable-snippets-in-popup` to 0.
```vim
call SpaceVim#layers#load('autocomplete', {
\ 'auto-completion-enable-snippets-in-popup' : 0
\ })
```
## LSP supported
## Key bindings
### auto-complete
| Key bindings | Description |
| ------------ | --------------------------------------------- |
| `<C-n>` | select next candidate |
| `<C-p>` | select previous candidate |
| `<Tab>` | base on `auto-completion-tab-key-behavior` |
| `<S-Tab>` | select previous candidate |
| `<Return>` | base on `auto-completion-return-key-behavior` |
### Neosnippet
| Key Binding | Description |
| ----------- | -------------------------------------------------------------- |
| `M-/` | Expand a snippet if text before point is a prefix of a snippet |
| `SPC i s` | List all current yasnippets for inserting |

27
docs/cn/layers/chat.md Normal file
View File

@ -0,0 +1,27 @@
---
title: "SpaceVim chat layer"
description: "SpaceVim chatting layer provide chatting with qq and weixin in vim."
---
# [Layers](https://spacevim.org/layers) > chat
SpaceVim chatting layer provide chatting feature in vim.
## plugins
Name | Description
----- | ------------------
[vim-chat](https://github.com/vim-chat/vim-chat) | chatting in vim.
## Key Mappings
`Alt + x` : open chatting buffer for qq.
`Alt + w` : open chatting buffer for weixin.
within chatting buffer:
`Alt + Left/Right` : switch between buffer.
`Alt + 1-9` : jump to specified channel.
for more mappings in chatting buffer, please read <kbd>:h vim-chat</kbd>.

View File

@ -0,0 +1,67 @@
---
title: "SpaceVim checkers layer"
description: "This layer provides syntax checking feature"
---
# [SpaceVim Layers:](https://spacevim.org/layers) checkers
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Configuration](#configuration)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provides syntax checking feature.
## Layer Installation
checkers layer is loaded by default.
## Configuration
By default, the error will be display below current line, if you want to disabled this feature, you may need to load this layer with `show_cursor_error` to 0.
```vim
call SpaceVim#layers#load('checkers', {
\ 'show_cursor_error' : 0,
\ })
```
| Name | default value | description |
| ---------------------------- | ------------- | -------------------------------------------------------- |
| `g:spacevim_enable_neomake` | 1 | Use neomake as default checking tools |
| `g:spacevim_enable_ale` | 0 | Use ale as default checking tools |
| `g:spacevim_lint_on_the_fly` | 0 | Syntax checking on the fly feature, disabled by default. |
**NOTE:** if you want to use ale, you need:
```viml
let g:spacevim_enable_neomake = 0
let g:spacevim_enable_ale = 1
```
and if you want to use syntastic, set this two options to 0.
## Key bindings
| Key | mode | description |
| --------- | ------ | ------------------------------------------------------------ |
| `SPC e .` | Normal | open error-transient-state |
| `SPC e c` | Normal | clear errors |
| `SPC e h` | Normal | describe current checker |
| `SPC e n` | Normal | jump to the position of next error |
| `SPC e N` | Normal | jump to the position of previous error |
| `SPC e p` | Normal | jump to the position of previous error |
| `SPC e l` | Normal | display a list of all the errors |
| `SPC e L` | Normal | display a list of all the errors and focus the errors buffer |
| `SPC e e` | Normal | explain the error at point |
| `SPC e s` | Normal | set syntax checker (TODO) |
| `SPC e S` | Normal | set syntax checker executable (TODO) |
| `SPC e v` | Normal | verify syntax setup |
| `SPC t s` | Normal | toggle syntax |

18
docs/cn/layers/chinese.md Normal file
View File

@ -0,0 +1,18 @@
---
title: "SpaceVim chinese layer"
description: "Layer for chinese users, include chinese docs and runtime messages"
---
# [Layers](https://spacevim.org/layers) > chinese
## Description
This layer is for chinese users, and provide chinese docs and runtime messages.
## Layer Installation
To use this configuration layer, add `splayer 'chinese'` to your custom configuration file.
## Configuration
if you want to enable this feature, add `let g:spacevim_vim_help_language = 'cn'` to your custom config file.

View File

@ -0,0 +1,28 @@
---
title: "SpaceVim colorscheme layer"
description: "colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme."
---
# [SpaceVim Layers:](https://spacevim.org/layers) colorscheme
This layer provides many Vim colorschemes for SpaceVim, the default colorscheme is gruvbox.
To change the colorscheme:
```vim
let g:spacevim_colorscheme = 'onedark'
```
Some colorschemes offer dark and light styles. Most of them are set by changing
Vim background color. SpaceVim support to change the background color with
`g:spacevim_colorscheme_bg`:
```vim
let g:spacevim_colorscheme_bg = 'dark'
```
Among SpaceVim colorschemes supported, there are some that looks like Atom
editor color styles: dark and light.
For Atom dark color scheme use _onedark_ or _neodark_ in `g:spacevim_colorscheme`.
For Atom light color scheme use _one_. vim-one plugin offer _one_ colorscheme and it
supports dark and light styles, but dark style doesn't work well with SpaceVim.
Check [#507](https://github.com/SpaceVim/SpaceVim/issues/507) for further discussion.

46
docs/cn/layers/cscope.md Normal file
View File

@ -0,0 +1,46 @@
---
title: "SpaceVim cscope layer"
description: "This layer provide cscope manager for project"
---
## Description
This layer provides a smart [Cscope](http://cscope.sourceforge.net/) and [PyCscope](https://github.com/portante/pycscope) helper for SpaceVim.
For more info about the differences between Cscope and other similar tools, please read [Comparison with Similar Tools](https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools)
## Features
- Tag indexing and searching for C-C++ via Cscope
- Tag indexing and searching for python via PyCscope
## Installation
### cscope
```shell
sudo pacman -S cscope
```
### layer
To use this configuration layer, add it to your `~/.SpaceVim.d/init.vim`.
```vim
call SpaceVim#layers#load('cscope')
```
## Key bindings
| Key Binding | Description |
| ----------- | -------------------------------------- |
| `SPC m c =` | Find assignments to this symbol |
| `SPC m c i` | Create cscope index |
| `SPC m c c` | Find functions called by this function |
| `SPC m c C` | Find functions calling this function |
| `SPC m c d` | find global definition of a symbol |
| `SPC m c r` | find references of a symbol |
| `SPC m c f` | find file |
| `SPC m c F` | find which files include a file |
| `SPC m c e` | search regular expression |
| `SPC m c t` | search text |

44
docs/cn/layers/debug.md Normal file
View File

@ -0,0 +1,44 @@
---
title: "SpaceVim debug layer"
description: "This layer provide debug workflow support in SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) debug
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provide a debug workflow for SpaceVim. All of the function is based on [vim-vebugger](https://github.com/idanarye/vim-vebugger).
## Install
To use this configuration layer, add `call SpaceVim#layers#load('debug')` to your custom configuration file.
## Key bindings
| Key Binding | Description |
| ----------- | ---------------------------------------- |
| `SPC d l` | launching debugger |
| `SPC d c` | Continue the execution |
| `SPC d b` | Toggle a breakpoint for the current line |
| `SPC d B` | Clear all breakpoints |
| `SPC d o` | step over |
| `SPC d i` | step into functions |
| `SPC d O` | step out of current function |
| `SPC d e s` | Evaluate and print the selected text |
| `SPC d e e` | Evaluate the `<cword>` under the cursor |
| `SPC d e S` | Execute the selected text |
| `SPC d k` | Terminates the debugger |
**Debug Transient State**
key bindings is too long? use `SPC d .` to open the debug transient state:
![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png)

View File

@ -0,0 +1,5 @@
# [Layers](https://spacevim.org/layers) > default
SpaceVim default layer contains none plugins, but it has some better default config for vim and neovim.
## Key Mappings

38
docs/cn/layers/git.md Normal file
View File

@ -0,0 +1,38 @@
---
title: "SpaceVim git layer"
description: "This layers adds extensive support for git"
---
# [SpaceVim Layers:](https://spacevim.org/layers) git
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Layer](#layer)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layers adds extensive support for [git](http://git-scm.com/).
### Features
## Install
### Layer
To use this configuration layer, add `call SpaceVim#layers#load('git')` to your custom configuration file.
## Key bindings
| Key Binding | Description |
| -------------- | ---------------------- |
| `<Leader> g a` | git add current file |
| `<Leader> g A` | git add All files |
| `<Leader> g b` | open git blame window |
| `<Leader> g s` | open git status window |
| `<Leader> g c` | open git commit window |

81
docs/cn/layers/index.md Normal file
View File

@ -0,0 +1,81 @@
---
title: Available layers
description: A list of available layers in SpaceVim.
keywords: layer,layers
---
<!-- vim-markdown-toc GFM -->
- [Introduction](#introduction)
- [Enable layers](#enable-layers)
- [Disable layers](#disable-layers)
- [Available layers](#available-layers)
<!-- vim-markdown-toc -->
## Introduction
SpaceVim is a community-driven vim distribution that seeks to provide layer feature.
Layers help collect related packages together to provide features.
This approach helps keep configuration organized and reduces overhead for the user by
keeping them from having to think about what packages to install.
### Enable layers
here is an example for loadding `shell` layer with some specified options:
```vim
call SpaceVim#layers#load('shell',
\ {
\ 'default_position' : 'top',
\ 'default_height' : 30,
\ }
\ )
```
### Disable layers
Some layers are enabled by defalut, here is an example for disable `shell` layer:
```vim
call SpaceVim#layers#disable('shell')
```
<!-- SpaceVim layer list start -->
## Available layers
| Name | Description |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [autocomplete](https://spacevim.org/layers/autocomplete/) | This layer provides auto-completion to SpaceVim |
| [chat](https://spacevim.org/layers/chat/) | SpaceVim chatting layer provide chatting with qq and weixin in vim. |
| [checkers](https://spacevim.org/layers/checkers/) | This layer provides syntax checking feature |
| [chinese](https://spacevim.org/layers/chinese/) | Layer for chinese users, include chinese docs and runtime messages |
| [colorscheme](https://spacevim.org/layers/colorscheme/) | colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme. |
| [cscope](https://spacevim.org/layers/cscope/) | This layer provide cscope manager for project |
| [debug](https://spacevim.org/layers/debug/) | This layer provide debug workflow support in SpaceVim |
| [default](https://spacevim.org/layers/default/) | lt layer contains none plugins, but it has some better default config for vim and neovim |
| [git](https://spacevim.org/layers/git/) | This layers adds extensive support for git |
| [lang#c](https://spacevim.org/layers/lang/c/) | This layer is for c/c++/object-c development |
| [lang#dart](https://spacevim.org/layers/lang/dart/) | This layer is for dart development, provide autocompletion, syntax checking, code format for dart file. |
| [lang#elixir](https://spacevim.org/layers/lang/elixir/) | This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file. |
| [lang#go](https://spacevim.org/layers/lang/go/) | This layer is for golang development. It also provides additional language-specific key mappings. |
| [lang#haskell](https://spacevim.org/layers/lang/haskell/) | This layer is for haskell development |
| [lang#java](https://spacevim.org/layers/lang/java/) | This layer is for Java development. All the features such as code completion, formatting, syntax checking, REPL and debug have be done in this layer. |
| [lang#javascript](https://spacevim.org/layers/lang/javascript/) | This layer is for JaveScript development |
| [lang#lisp](https://spacevim.org/layers/lang/lisp/) | for lisp development |
| [lang#lua](https://spacevim.org/layers/lang/lua/) | This layer is for lua development, provide autocompletion, syntax checking, code format for lua file. |
| [lang#markdown](https://spacevim.org/layers/lang/markdown/) | Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file. |
| [lang#php](https://spacevim.org/layers/lang/php/) | This layer adds PHP language support to SpaceVim |
| [lang#python](https://spacevim.org/layers/lang/python/) | This layer is for Python development, provide autocompletion, syntax checking, code format for python file. |
| [lang#ruby](https://spacevim.org/layers/lang/ruby/) | This layer is for ruby development, provide autocompletion, syntax checking, code format for ruby file. |
| [lang#typescript](https://spacevim.org/layers/lang/typescript/) | This layer is for TypeScript development |
| [lang#vim](https://spacevim.org/layers/lang/vim/) | This layer is for writting vim script, including code completion, syntax checking and buffer formatting |
| [language-server-protocol](https://spacevim.org/layers/language-server-protocol/) | This layers provides language server protocol for vim and neovim |
| [shell](https://spacevim.org/layers/shell/) | This layer provide shell support in SpaceVim |
| [tags](https://spacevim.org/layers/tags/) | This layer provide tags manager for project |
| [ui](https://spacevim.org/layers/ui/) | Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and vim in both TUI and GUI |
<!-- SpaceVim layer list end -->
<!-- vim:set nowrap: -->

68
docs/cn/layers/lang/c.md Normal file
View File

@ -0,0 +1,68 @@
---
title: "SpaceVim lang#c layer"
description: "This layer is for c/c++/object-c development"
---
# [Layers](https://spacevim.org/layers) > lang#c
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Features](#features)
- [Configuration](#configuration)
<!-- vim-markdown-toc -->
## Description
This layer is for c/c++/object-c development.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#c')` to your custom configuration file.
```vim
call SpaceVim#layers#load('lang#c',
\ {
\ 'enable_libclang' : 1,
\ }
\ )
```
## Features
- code completion
- syntax checking
- formatting
## Configuration
- `clang_executable` (string)
set the path to the clang executable
- `enable_libclang` (boolean)
use libclang instead of `clang -cc1`, by default it is 0.
- `libclang_path` (string)
The libclang shared object (dynamic library) file path. by default it is empty.
- `clang_std` (dict)
```json
{
"c": "c11",
"cpp": "c++1z",
"objc": "c11",
"objcpp": "c++1z",
}
```
- `clang_flag`
Create a `.clang` file at your project root. You should be able to just paste most of your compile flags in there. You can also use a list ['-Iwhatever', ...] when loadding this layer.

View File

@ -0,0 +1,90 @@
---
title: "SpaceVim lang#dart layer"
description: "This layer is for dart development, provide autocompletion, syntax checking, code format for dart file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#dart
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Installation](#installation)
- [Layer](#layer)
- [Syntax checking && Code formatting](#syntax-checking--code-formatting)
- [Install dart-repl](#install-dart-repl)
- [Key bindings](#key-bindings)
- [Inferior REPL process](#inferior-repl-process)
- [Running current script](#running-current-script)
- [Code formatting](#code-formatting)
- [Screenshots](#screenshots)
<!-- vim-markdown-toc -->
## Description
This layer is for dart development.
## Features
- code completion
- syntax checking
- code formatting
- REPL
- code runner
## Installation
### Layer
To use this configuration layer, add `call SpaceVim#layers#load('lang#dart')` to your custom configuration file.
### Syntax checking && Code formatting
To enable syntax checking and code formatting in spacevim, you need to install [dart sdk](https://github.com/dart-lang/sdk).
### Install dart-repl
you need to install the dart_repl via pub, pub is a build-in package manager in dart-sdk:
```sh
pub global activate dart_repl
```
## Key bindings
### Inferior REPL process
Start a `dart.repl` inferior REPL process with `SPC l s i`.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `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 |
### Running current script
To running a ruby script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.
### Code formatting
| Key Binding | Description |
| ----------- | --------------------- |
| `SPC b f` | format current buffer |
## Screenshots
**code formatting:**
![format-dart-file-in-spacevim](https://user-images.githubusercontent.com/13142418/34455939-b094db54-ed4f-11e7-9df0-80cf5de1128d.gif)
**auto completion:**
![complete-dart-in-spacevim](https://user-images.githubusercontent.com/13142418/34455816-ee77182c-ed4c-11e7-8f63-402849f60405.png)
**code runner:**
![dart-runner-in-spacevim](https://user-images.githubusercontent.com/13142418/34455403-1f6d4c3e-ed44-11e7-893f-09a6e64e27ed.png)

View File

@ -0,0 +1,56 @@
---
title: "SpaceVim lang#elixir layer"
description: "This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#elixir
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Layer](#layer)
- [Key bindings](#key-bindings)
- [Inferior REPL process](#inferior-repl-process)
- [Running current script](#running-current-script)
<!-- vim-markdown-toc -->
## Description
This layer is for Elixir development.
## Features
This layer include the plugin [slashmili/alchemist.vim](https://github.com/slashmili/alchemist.vim), which provides:
- Completion for Modules and functions.
- Documentation lookup for Modules and functions.
- Jump to the definition.
SpaceVim also provides REPL/Debug support for elixir.
## Install
### Layer
To use this configuration layer, add `SPLayer 'lang#elixir'` to your custom configuration file.
## Key bindings
### Inferior REPL process
Start a `iex` inferior REPL process with `SPC l s i`.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `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 |
### Running current script
To running current script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.

53
docs/cn/layers/lang/go.md Normal file
View File

@ -0,0 +1,53 @@
---
title: "SpaceVim golang layer"
description: "This layer is for golang development. It also provides additional language-specific key mappings."
---
# [SpaceVim Layers:](https://spacevim.org/layers) go
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Features](#features)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer is for golang development. It also provides additional language-specific key mappings.
## Install
To use this configuration layer, add `call SpaceVim#layers#load('lang#go')` to your custom configuration file.
## Features
- auto-completion
- syntax checking
- goto definition
- refernce finder
## Key bindings
**Import key bindings:**
| Key Binding | Description |
| ----------- | --------------- |
| SPC l i | go implements |
| SPC l f | go info |
| SPC l e | go rename |
| SPC l r | go run |
| SPC l b | go build |
| SPC l t | go test |
| SPC l d | go doc |
| SPC l v | go doc vertical |
| SPC l c | go coverage |
**Code formatting:**
the default key bindings for format current buffer is `SPC b f`, and this key bindings is defined in [format layer](<>). you can also use `g=` to indent current buffer.
To make neoformat support go files, you should have [go-fmt](http://golang.org/cmd/gofmt/) command available, or
install [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports). `go-fmt` is delivered by golang's default installation, so make sure you have correctly setup your go environment.

View File

@ -0,0 +1,31 @@
---
title: "SpaceVim lang#javascript layer"
description: "This layer is for haskell development"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#haskell
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Features](#features)
<!-- vim-markdown-toc -->
## Description
This layer is for haskell development.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#haskell')` to your custom configuration file.
## Features
- auto-completion
- syntax checking
- goto definition
- refernce finder
- language server protocol (need lsp layer)

View File

@ -0,0 +1,46 @@
---
title: "SpaceVim lang#html layer"
description: "Edit html in SpaceVim, with this layer, this layer provides code completion, syntax checking and code formatting for html."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#html
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Language server](#language-server)
- [Features](#features)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer adds support for editing HTML and CSS.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#html')` to your custom configuration file.
### Language server
To install the language server, you need `npm` on your machine:
```bash
npm install --global vscode-html-languageserver-bin
```
## Features
- Generate HTML and CSS coding using [neosnippet](https://github.com/Shougo/neosnippet.vim/) and [emmet-vim](https://github.com/mattn/emmet-vim)
- Tags navigation on key % using matchit.vim
- auto-completion
- syntax checking
- language server protocol (need `lsp` layer)
## Key bindings
| key bindings | Description |
| ------------ | ------------ |
| `<C-e>` | emmet prefix |

107
docs/cn/layers/lang/java.md Normal file
View File

@ -0,0 +1,107 @@
---
title: "SpaceVim lang#java layer"
description: "This layer is for Java development. All the features such as code completion, formatting, syntax checking, REPL and debug have be done in this layer."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#java
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Feature](#feature)
- [Install](#install)
- [Key bindings](#key-bindings)
- [Import key bindings](#import-key-bindings)
- [Generate key bindings](#generate-key-bindings)
- [Code formatting](#code-formatting)
- [Maven](#maven)
- [Jump](#jump)
- [Inferior REPL process](#inferior-repl-process)
<!-- vim-markdown-toc -->
## Description
This layer is for Java development.
## Feature
- code completion: `autocomplete` layer
- code formatting
- refactoring
- syntax checking: `checkers` layer
- REPL(need java8's jshell)
- debug: check out the `debug` layer
## Install
To use this configuration layer, add `SPLayer 'lang#java'` to your custom configuration file.
## Key bindings
### Import key bindings
| Key Binding | Description |
| -------------------- | ------------------------------- |
| `F4` (Insert/Normal) | Import class under cursor |
| `SPC l I` | Import missing classes |
| `SPC l R` | Remove unused classes |
| `SPC l i` | smart import class under cursor |
| `<C-j>I` (Insert) | Import missing classes |
| `<C-j>R` (Insert) | Remove unused classes |
| `<C-j>i` (Insert) | smart import class under cursor |
### Generate key bindings
| Mode | Key Binding | Description |
| ------------- | ----------- | ------------------------------------- |
| normal | `SPC l g A` | generate accessors |
| normal/visual | `SPC l g s` | generate setter accessor |
| normal/visual | `SPC l g g` | generate getter accessor |
| normal/visual | `SPC l g a` | generate setter and getter accessor |
| normal | `SPC l g M` | generate abstract methods |
| insert | `<c-j>s` | generate setter accessor |
| insert | `<c-j>g` | generate getter accessor |
| insert | `<c-j>a` | generate getter and setter accessor |
| normal | `SPC l g t` | generate toString function |
| normal | `SPC l g e` | generate equals and hashcode function |
| normal | `SPC l g c` | generate constructor |
| normal | `SPC l g C` | generate default constructor |
### Code formatting
the default key bindings for format current buffer is `SPC b f`. and this key bindings is defined in [format layer](<>). you can also use `g=` to indent current buffer.
To make neoformat support java file, you should install uncrustify. or
download [google's formater jar](https://github.com/google/google-java-format)
and add `let g:spacevim_layer_lang_java_formatter = 'path/to/google-java-format.jar'`
to SpaceVim custom configuration file.
### Maven
| Key Binding | Description |
| ----------- | ------------------------------ |
| `SPC l m i` | Run maven clean install |
| `SPC l m I` | Run maven install |
| `SPC l m p` | Run one already goal from list |
| `SPC l m r` | Run maven goals |
| `SPC l m R` | Run one maven goal |
| `SPC l m t` | Run maven test |
### Jump
| Key Binding | Description |
| ----------- | ---------------------- |
| `SPC l j a` | jump to alternate file |
### Inferior REPL process
Start a `jshell` inferior REPL process with `SPC l s i`.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `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 |

View File

@ -0,0 +1,66 @@
---
title: "SpaceVim lang#javascript layer"
description: "This layer is for JaveScript development"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#javascript
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Features](#features)
- [Layer configuration](#layer-configuration)
- [Key bindings](#key-bindings)
- [Import key bindings](#import-key-bindings)
- [Generate key bindings](#generate-key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer is for JavaScript development.
## Install
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
`auto_fix`: auto fix problems when save files, disabled by default. if you need this feature, you can load this layer via:
```vim
call SpaceVim#layers#load('lang#javascript',
\ {
\ 'auto_fix' : 1,
\ }
\ )
```
## 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 |

View File

@ -0,0 +1,19 @@
# [Layers](https://spacevim.org/layers) > lang#lisp
This layer is for lisp development.
## Install
To include this layer, add `SPLayer 'lang#lisp'` to your custom configuration file.
## Requirement
- Vim 8.0+ with +channel, or Neovim 0.2.0+ with ncat
- ASDF
- Quicklisp
- An Internet connection to install other dependencies from Quicklisp
## mappings
all the language special mappings is begin with `[SPC] l`, please checkout it in mapping guide.

View File

@ -0,0 +1,60 @@
---
title: "SpaceVim lang#lua layer"
description: "This layer is for lua development, provide autocompletion, syntax checking, code format for lua file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#lua
<!-- vim-markdown-toc GFM -->
* [Description](#description)
* [Installation](#installation)
* [Layer](#layer)
* [Syntax checking && Code formatting](#syntax-checking--code-formatting)
* [Key bindings](#key-bindings)
* [Inferior REPL process](#inferior-repl-process)
* [Running current script](#running-current-script)
<!-- vim-markdown-toc -->
## Description
This layer is for lua development.
## Installation
### Layer
To use this configuration layer, add `SPLayer 'lang#lua'` to your custom configuration file.
### Syntax checking && Code formatting
## Key bindings
### Inferior REPL process
Start a `lua` or `luap` inferior REPL process with `SPC l s i`. You may change the REPL command by layer option `repl_command`. For example, if you want to use `lua.repl`, load this layer via:
```vim
call SpaceVim#layers#load('lang#lua'
\ {
\ 'repl_command' : '~/.luarocks/lib/luarocks/rocks-5.3/luarepl/0.8-1/bin/rep.lua',
\ }
```
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `SPC l b` | compile current lua buffer |
| `SPC l r` | run current lua file |
| `SPC l f` | format current lua file |
| `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 |
### Running current script
To running a ruby script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.

View File

@ -0,0 +1,61 @@
---
title: "SpaceVim lang#markdown layer"
description: "Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#markdown
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [formatting](#formatting)
- [options](#options)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer is for editing markdown file.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#markdown')` to your custom configuration file.
## formatting
SpaceVim use remark to formatting markdown file, so you need to install this program. you can install it via npm:
```sh
npm -g install remark
npm -g install remark-cli
npm -g install remark-stringify
```
### options
**listItemIndent**
How to indent the content from list items (`tab`, `mixed` or 1 , default: 1).
- `'tab'`: use tab stops (4 spaces)
- `'1'`: use one space
- `'mixed'`: use `1` for tight and `tab` for loose list items
**enableWcwidth**
Enable/Disable wcwidth for detecting the length of a table cell, default is 0. To enable this option, you need to install [wcwidth](https://www.npmjs.com/package/wcwidth)
**listItemChar**
Bullet marker to use for list items (`'-'`, `'*'`, or `'+'`, default: `'-'`).
## Key bindings
| Key | mode | description |
| ---------- | ------ | -------------------------- |
| `SPC b f` | Normal | Format current buffer |
| `SPC l ft` | Normal | Format table under cursor |
| `SPC l p` | Normal | Real-time markdown preview |

View File

@ -0,0 +1,39 @@
---
title: "SpaceVim lang#php layer"
description: "This layer adds PHP language support to SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#php
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Layer Installation](#layer-installation)
- [Requirement](#requirement)
<!-- vim-markdown-toc -->
## Description
This layer adds PHP language support to SpaceVim.
## Features
- auto-completion
- syntax checking
- goto definition
- refernce finder
- lsp support (require [lsp](https://spacevim.org/layers/language-server-protocol/) layer)
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#php')` to your custom configuration file.
### Requirement
1. [PHP 5.3+](http://php.net/)
2. [PCNTL](http://php.net/manual/en/book.pcntl.php) Extension
3. [Msgpack 0.5.7+(for NeoVim)](https://github.com/msgpack/msgpack-php) Extension or [JSON(for Vim 7.4+)](http://php.net/manual/en/intro.json.php) Extension
4. [Composer](https://getcomposer.org/) Project

View File

@ -0,0 +1,102 @@
---
title: "SpaceVim lang#python layer"
description: "This layer is for Python development, provide autocompletion, syntax checking, code format for python file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#python
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Layer](#layer)
- [Syntax Checking](#syntax-checking)
- [Buffer formatting](#buffer-formatting)
- [Format imports](#format-imports)
- [Key bindings](#key-bindings)
- [Code generation](#code-generation)
- [Inferior REPL process](#inferior-repl-process)
- [Running current script](#running-current-script)
- [Testing](#testing)
- [Refactoring](#refactoring)
<!-- vim-markdown-toc -->
## Description
This layer is for Python development.
## Features
- Aoto-completion using [deoplete-jedi](https://github.com/zchee/deoplete-jedi) or [jedi-vim](https://github.com/davidhalter/jedi-vim)
- Documentation Lookup using [jedi-vim](https://github.com/davidhalter/jedi-vim)
## Install
### Layer
To use this configuration layer, add `SPLayer 'lang#python'` to your custom configuration file.
### Syntax Checking
`checker` layer provide syntax checking feature, and for python it uses `flake8` package:
```sh
pip install --user flake8
```
### Buffer formatting
The default key binding for formatting buffer is `SPC b f`, and you need to install `yapf`. To enable automatic buffer formatting on save, load this layer with setting `format-on-save` to `1`.
```sh
pip install --user yapf
```
### Format imports
To be able to suppress unused imports easily, install [autoflake](https://github.com/myint/autoflake):
```sh
pip install --user autoflake
```
To be able to sort your imports, install [isort](https://github.com/timothycrosley/isort)
```sh
pip install --user isort
```
## Key bindings
### Code generation
| Mode | Key Binding | Description |
| ------ | ----------- | ------------------------------------- |
| normal | `SPC l g d` | Generate docstring |
### Inferior REPL process
Start a Python or iPython inferior REPL process with `SPC l s i`. If `ipython` is available in system executable search paths, `ipython` will be used to launch python shell; otherwise, default `python` interpreter will be used. You may change your system executable search path by activating a virtual environment.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `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 |
### Running current script
To running a python script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.
### Testing
### Refactoring
| Key Binding | Description |
| ----------- | ------------------------------------ |
| `SPC l i r` | remove unused imports with autoflake |
| `SPC l i s` | sort imports with isort |

View File

@ -0,0 +1,62 @@
---
title: "SpaceVim lang#ruby layer"
description: "This layer is for ruby development, provide autocompletion, syntax checking, code format for ruby file."
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#ruby
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Installation](#installation)
- [Layer](#layer)
- [Syntax checking && Code formatting](#syntax-checking--code-formatting)
- [Key bindings](#key-bindings)
- [Inferior REPL process](#inferior-repl-process)
- [RuboCop](#rubocop)
- [Running current script](#running-current-script)
<!-- vim-markdown-toc -->
## Description
This layer is for ruby development.
## Installation
### Layer
To use this configuration layer, add `SPLayer 'lang#ruby'` to your custom configuration file.
### Syntax checking && Code formatting
To enable syntax checking and code formatting in spacevim, you need to install [cobocop](https://github.com/bbatsov/rubocop).
```sh
gem install rubocop
```
## Key bindings
### Inferior REPL process
Start a `irb` inferior REPL process with `SPC l s i`.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `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 |
### RuboCop
| Key Binding | Description |
| ----------- | ------------------------------------------ |
| `SPC l c f` | Runs RuboCop on the currently visited file |
### Running current script
To running a ruby script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.

View File

@ -0,0 +1,40 @@
---
title: "SpaceVim lang#typescript layer"
description: "This layer is for TypeScript development"
---
# [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.

View File

@ -0,0 +1,29 @@
---
title: "SpaceVim lang#vim layer"
description: "This layer is for writting vim script, including code completion, syntax checking and buffer formatting"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lang#vim
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer is for vim plugin development.
## Layer Installation
To use this configuration layer, add `call SpaceVim#layers#load('lang#vim')` to your custom configuration file.
## Key bindings
| Key Binding | Description |
| ----------- | ----------------------------------------- |
| `SPC l e` | print the eval under the cursor |
| `SPC l v` | print the helpfulversion under the cursor |

View File

@ -0,0 +1,119 @@
---
title: "SpaceVim language server protocol layer"
description: "This layers provides language server protocol for vim and neovim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) lsp
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Install language server](#install-language-server)
- [Configuration](#configuration)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layers adds extensive support for [language-server-protocol](https://microsoft.github.io/language-server-protocol/), This layer is a heavy wallpaper of [LanguageClient-neovim](https://github.com/SpaceVim/LanguageClient-neovim) (an old fork), The upstream is rewritten by rust.
we also want to include [vim-lsp](https://github.com/prabirshrestha/vim-lsp), which is wrote in pure vim script.
the neovim team is going to implement the build-in LSP support, the PR is [neovim#6856](https://github.com/neovim/neovim/pull/6856). and the author of this PR create another plugin [tjdevries/nvim-langserver-shim](https://github.com/tjdevries/nvim-langserver-shim)
SpaceVim should works well in different version of vim/neovim, so in the features, the logic of this layer should be:
```vim
if has('nvim')
" use neovim build-in lsp
elseif has('python3')
" use LanguageClient-neovim
else
" use vim-lsp
endif
```
## Features
- Asynchronous calls
- Code completion (provided by [autocomplet](https://spacevim.org/layers/autocomplete/) layer)
- Lint on the fly
- Rename symbol
- Hover/Get identifer info.
- Goto definition.
- Goto reference locations.
- Workspace/Document symbols query.
- Formatting.
- Code Action/Fix.
**Note:** All these features dependent on the implementation of the language server, please check the list of [Language Servers](https://microsoft.github.io/language-server-protocol/implementors/servers/)
## Install
To use this configuration layer, add `call SpaceVim#layers#load('lsp')` to your custom configuration file.
### Install language server
**JavaScript:**
```sh
npm install -g javascript-typescript-langserver
```
**Python:**
```sh
pip install --user python-language-server
```
## Configuration
To enable lsp support for a specified filetype, you may need to load this layer with `filtypes` option, for example:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'filetypes' : ['rust',
\ 'typescript',
\ 'javascript',
\ ],
\ }
```
default language server commands:
| language | server command |
| ------------ | ------------------------------------------------ |
| `javascript` | `['javascript-typescript-stdio']` |
| `haskell` | `['hie', '--lsp']` |
| `c` | `['clangd']` |
| `cpp` | `['clangd']` |
| `html` | `['html-languageserver', '--stdio']` |
| `objc` | `['clangd']` |
| `objcpp` | `['clangd']` |
| `dart` | `['dart_language_server']` |
| `go` | `['go-langserver', '-mode', 'stdio']` |
| `rust` | `['rustup', 'run', 'nightly', 'rls']` |
| `python` | `['pyls']` |
| `php` | `['php', 'path/to/bin/php-language-server.php']` |
To override the server command, you may need to use `override_cmd` option:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'override_cmd' : {
\ 'rust' : ['rustup', 'run', 'nightly', 'rls'],
\ }
\ }
```
## Key bindings
| Key Binding | Description |
| --------------- | ------------- |
| `K` / `SPC l d` | show document |
| `SPC l e` | rename symbol |

57
docs/cn/layers/shell.md Normal file
View File

@ -0,0 +1,57 @@
---
title: "SpaceVim shell layer"
description: "This layer provide shell support in SpaceVim"
---
# [SpaceVim Layers:](https://spacevim.org/layers) shell
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Configuration](#configuration)
- [Default shell](#default-shell)
- [Default shell position and height](#default-shell-position-and-height)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provide shell support in SpaceVim.
## Install
To use this configuration layer, add `SPLayer 'shell'` to your custom configuration file.
## Configuration
### Default shell
Vim support these kinds of shell:
To define the default shell you can set the layer variable `default_shell` to the following variables:
- terminal
- VimShell
The default shell is quickly accessible via a the default shortcut key `SPC '`.
### Default shell position and height
It is possible to choose where the shell should pop up by setting the variable `default_position` to either `top`, `bottom`, `left`, `right`, or `full`. Default value is `top`. It is also possible to set the default height in percents with the variable `default_height`. Default value is 30.
```vim
call SpaceVim#layers#load('shell',
\ {
\ 'default_position' : 'top',
\ 'default_height' : 30,
\ }
\ )
```
## Key bindings
| Key Binding | Description |
| ----------- | -------------------------------------- |
| `SPC '` | Open, close or go to the default shell |

199
docs/cn/layers/tags.md Normal file
View File

@ -0,0 +1,199 @@
---
title: "SpaceVim tags layer"
description: "This layer provide tags manager for project"
---
# [SpaceVim Layers:](https://spacevim.org/layers) tags
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [GNU Global (gtags)](#gnu-global-gtags)
- [Install on OSX using Homebrew](#install-on-osx-using-homebrew)
- [Install on \*nix from source](#install-on-nix-from-source)
- [Install recommended dependencies](#install-recommended-dependencies)
- [Install with recommended features](#install-with-recommended-features)
- [Configure your environment to use pygments and ctags](#configure-your-environment-to-use-pygments-and-ctags)
- [Load tags layer](#load-tags-layer)
- [Usage](#usage)
- [Language Support](#language-support)
- [Built-in languages](#built-in-languages)
- [Exuberant ctags languages](#exuberant-ctags-languages)
- [Universal ctags languages](#universal-ctags-languages)
- [Pygments languages (plus symbol and reference tags)](#pygments-languages-plus-symbol-and-reference-tags)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer provide tags manager for project. This layer need `core` layer's project manager feature.
## Features
- Select any tag in a project retrieved by gtags
- Resume previous helm-gtags session
- Jump to a location based on context
- Find definitions
- Find references
- Present tags in current function only
- Create a tag database
- Jump to definitions in file
- Show stack of visited locations
- Manually update tag database
- Jump to next location in context stack
- Jump to previous location in context stack
- Jump to a file in tag database
- Enables eldoc in modes that otherwise might not support it.
- Enables company complete in modes that otherwise might not support it.
## Install
### GNU Global (gtags)
To use gtags, you first have to install [GNU Global](https://www.gnu.org/software/global/download.html).
You can install global from the software repository of your OS; however, many OS distributions are out of date, and you will probably be missing support for pygments and exuberant ctags, and thus support for many languages. We recommend installing from source. If not for example to install on Ubuntu:
```sh
sudo apt-get install global
```
#### Install on OSX using Homebrew
```sh
brew install global --with-pygments --with-ctags
```
#### Install on \*nix from source
##### Install recommended dependencies
To take full advantage of global you should install 2 extra packages in addition to global: pygments and ctags (exuberant). You can do this using your normal OS package manager, e.g., on Ubuntu
```sh
sudo apt-get install exuberant-ctags python-pygments
```
or e.g., Archlinux:
```sh
sudo pacman -S ctags python-pygments
```
##### Install with recommended features
Download the latest tar.gz archive, then run these commands:
```sh
tar xvf global-6.5.3.tar.gz
cd global-6.5.3
./configure --with-exuberant-ctags=/usr/bin/ctags
make
sudo make install
```
##### Configure your environment to use pygments and ctags
To be able to use pygments and ctags, you need to copy the sample gtags.conf either to /etc/gtags.conf or $HOME/.globalrc. For example:
```sh
cp gtags.conf ~/.globalrc
```
Additionally you should define GTAGSLABEL in your shell startup file e.g. with sh/ksh:
```sh
echo export GTAGSLABEL=pygments >> .profile
```
### Load tags layer
To use this configuration layer, add it to your `~/.SpaceVim.d/init.vim`.
```vim
call SpaceVim#layers#load('tags')
```
## Usage
Before using the gtags, remember to create a GTAGS database by the following methods:
- From within SpaceVim, press `SPC m g c` to generate GTAGS database. If the language is not directly supported by GNU Global, you can choose ctags or pygments as a backend to generate tag database.
- From inside terminal, runs gtags at your project root in terminal:
```sh
cd /path/to/project/root
gtags
```
If the language is not directly supported by gtags, and you have not set the GTAGSLABEL environment variable, use this command instead:
```sh
gtags --gtagslabel=pygments
```
### Language Support
#### Built-in languages
If you do not have `ctags` or `pygments` enabled gtags will only produce tags for the following languages:
- asm
- c/c++
- java
- php
- yacc
#### Exuberant ctags languages
If you have enabled `exuberant ctags` and use that as the backend (i.e., GTAGSLABEL=ctags or gtagslabel=ctags) the following additional languages will have tags created for them:
- c#
- erlang
- javascript
- common-lisp
- emacs-lisp
- lua
- ocaml
- python
- ruby
- scheme
- vimscript
- windows-scripts (.bat .cmd files)
#### Universal ctags languages
Instead, If you have installed the newer/beta [universal ctags](https://github.com/universal-ctags/ctags) and use that as the backend (i.e., GTAGSLABEL=ctags or gtagslabel=ctags) the following additional languages will have tags created for them:
- clojure
- d
- go
- rust
#### Pygments languages (plus symbol and reference tags)
In order to look up symbol references for any language not in the built in parser you must use the pygments backend. When this backend is used global actually uses both ctags and pygments to find the definitions and uses of functions and variables as well as “other symbols”.
If you enabled pygments (the best choice) and use that as the backend (i.e., GTAGSLABEL=pygments or gtagslabel=pygments) the following additional languages will have tags created for them:
- elixir
- fsharp
- haskell
- octave
- racket
- scala
- shell-scripts
- tex
## Key bindings
| Key Binding | Description |
| ----------- | --------------------------------------------------------- |
| `SPC m g c` | create a tag database |
| `SPC m g u` | manually update tag database |
| `SPC m g f` | jump to a file in tag database |
| `SPC m g d` | find definitions |
| `SPC m g r` | find references |

24
docs/cn/layers/ui.md Normal file
View File

@ -0,0 +1,24 @@
---
title: "SpaceVim ui layer"
description: "Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and vim in both TUI and GUI"
---
# [SpaceVim Layers:](https://spacevim.org/layers) ui
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Plugins](#plugins)
<!-- vim-markdown-toc -->
## Description
This is UI layer for SpaceVim, and it is loaded by default.
## Plugins
- [mhinz/vim-startify](https://github.com/mhinz/vim-startify)
- [majutsushi/tagbar](https://github.com/majutsushi/tagbar)

View File

@ -0,0 +1,45 @@
---
title: "入门指南"
description: "SpaceVim 入门教程,包括安装初始化配置等内容"
lang: cn
---
# SpaceVim 快速入门
<!-- vim-markdown-toc GFM -->
- [依赖](#依赖)
- [安装](#安装)
- [Linux 或 macOS](#linux-或-macos)
- [Windows](#windows)
<!-- vim-markdown-toc -->
## 依赖
At a minimum, SpaceVim requires `git` and `wget` to be installed. These tools
are needed for downloading plugins and fonts.
If you are new to vim, you should learning about Vim in general, read
[vim-galore](https://github.com/mhinz/vim-galore).
## 安装
### Linux 或 macOS
```bash
curl -sLf https://spacevim.org/cn/install.sh | bash
```
After SpaceVim is installed, launch `vim` and SpaceVim will **automatically** install plugins.
For more info about the install script, please check:
```bash
curl -sLf https://spacevim.org/cn/install.sh | bash -s -- -h
```
### Windows
The easist way is to download [install.cmd](https://spacevim.org/install.cmd) and run it as administrator, or install SpaceVim manually.

60
docs/cn/roadmap.md Normal file
View File

@ -0,0 +1,60 @@
---
title: "Roadmap"
description: "The roadmap and milestones define the project direction and priorities."
lang: cn
---
# Roadmap
The roadmap and [milestones](https://github.com/SpaceVim/SpaceVim/milestones) define the project direction and priorities.
## Next
### [0.7](https://github.com/SpaceVim/SpaceVim/milestone/10)
## Meta
There are release milestones and meta milestones ("buckets").
- Version-number milestones (0.1, 0.2, 0.3, …) assign issues to production releases.
- The nearest upcoming version is assigned a target date.
- Low-risk fixes in the current branch are first committed to the stable branch, then merged to master. For example, if the current stable release is `0.1.1` and a bug-fix is assigned to the `0.2` milestone, it does not mean users need to wait until 0.2 to get the fix. The patch will be committed to the stable branch and released in `0.1.2`.
- [todo](https://github.com/SpaceVim/SpaceVim/milestone/4) is a bucket for triaged tickets which should be on the roadmap but cannot yet be assigned to a concrete milestone.
- [unplanned](https://github.com/SpaceVim/SpaceVim/milestone/5) is a bucket for low-priority items or items lacking a feasible path to completion.
## Completed
### [0.6](https://github.com/SpaceVim/SpaceVim/milestone/9)
see the release note: [V0.5.0](https://github.com/SpaceVim/SpaceVim/milestone/9)
### [0.5](https://github.com/SpaceVim/SpaceVim/milestone/8)
see the release note: [V0.5.0](https://github.com/SpaceVim/SpaceVim/milestone/9)
### [0.4](https://github.com/SpaceVim/SpaceVim/milestone/7)
- Improve git work flow
- completion in commit message buffer
- manager github issues annd PRs
- Improve autocomplete layer
### [0.3](https://github.com/SpaceVim/SpaceVim/milestone/3)
- statusline with mode support
- Plugin manager ui for dein
- Improve mapping guide
- Tabs manager
- Layers manager
### [0.2](https://github.com/SpaceVim/SpaceVim/milestone/2)
- Mnemonic key bindings
- Denite support
- Unite work flow
- Windows support
### [0.1](https://github.com/SpaceVim/SpaceVim/milestone/1)
- The primary goal of the 0.1 release ("first public release") is to reach a stable, functional baseline that can be built upon and used as a benchmark for further progress.
- Layers feature

55
docs/cn/sponsors.md Normal file
View File

@ -0,0 +1,55 @@
---
title: "赞助"
description: "SpaceVim 赞助方式,以及历史赞助,如果你想赞助 SpaceVim或者希望 SpaceVim 开发的更快一点,可以选择以下某种方式进行赞助"
lang: cn
---
![Bountysource](https://spacevim.org/img/bountysource.png)
如果你想赞助 SpaceVim或者希望 SpaceVim 开发的更快一点,可以选择以下某种方式进行赞助:
或者,也许你可以给我买杯咖啡:
<a href='https://ko-fi.com/A538L6H' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
| 微信                                                                  | 支付宝                                                                     |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| <img src="https://spacevim.org/img/weixin.png" height="150" width="150"> | <img src="https://spacevim.org/img/zhifubao.png" height="150" width="150"> |
比特币: 1DtuVeg81c2L9NEhDaVTAAbrCR3pN5xPFv
## 历史赞助
以下是所有的历史赞助,记住那些曾经爱心赞助的人们,非常感谢,你们的鼓励就是我坚持的动力 (排名不分先后,如有遗漏疏忽,请务必告知)
同时,你也可以查看 [Bountysource campaign](https://www.bountysource.com/teams/spacevim) 获取更多信息.
| 日期     | 金额 | 描述                                   |
| --------- | --- | --------------------------------------------- |
| 2017-2-23 | ¥40 | |
| 2017-2-14 | ¥100 | |
2017-06-20 | $ 2.57 | Шепелев​Григорий |
2017-06-24 | $ 14.04 | Vowell Jason |
2017-06-24 | $ 2.57 | Senaud Nicolas
2017-09-16 | $ 2.57 | D'Avezac Mayeul
2017-11-26 | $ 14.04 | Hermans Tim
2017-12-13 | $ 5.44 | Ma Fei
2017-12-27 | $ 8.30 | Módolo Marcelo
2016-11-22 | ¥20 |
2017-3-18 | ¥20 |
2017-3-30 | ¥20 |
2017-4-7 | ¥ 20 |
2017-11-2 | ¥ 10 |
2017-11-2 | ¥10 |
2017-12-28 | ¥20 |
2017-12-29 | ¥10 |
2017-12-28   | ¥10.24 | bts
2017-1-22 | ¥ 10 |
## 历史支出
| 日期     | 金额 | 描述                                   |
| --------- | --- | --------------------------------------------- |
2017-06-10 | - $ 5 | 主机
2017-01-03 | - ¥ 225 | 域名

View File

@ -42,18 +42,6 @@ See the [Quick start guide](quick-start-guide), [documentation](documentation) o
{% endfor %}
</ul>
## Blogs
<ul>
{% assign relevant = site.posts | except:"categories","feature" %}
{% for post in relevant offset: 0 limit: 5 %}
<strong><a href="{{ post.url }}">{{ post.title }}</a></strong>
<br>
<span class="post-date">{{ post.date | date_to_string }}</span>
<p>{{ post.excerpt | truncatewords: 100 }}</p>
{% endfor %}
</ul>
More posts are in the [SpaceVim's Blog](https://spacevim.org/blog/)
[Follow @SpaceVim](https://twitter.com/SpaceVim)

View File

@ -1,12 +1,10 @@
[![SpaceVim](https://spacevim.org/logo.png)](https://spacevim.org)
[![SpaceVim](https://spacevim.org/logo.png)](https://spacevim.org/cn/)
[![Build Status](https://travis-ci.org/SpaceVim/SpaceVim.svg?branch=dev)](https://travis-ci.org/SpaceVim/SpaceVim)
![Version](https://img.shields.io/badge/version-0.6.0--dev-FF00CC.svg)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE)
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://github.com/SpaceVim/SpaceVim/blob/dev/doc/SpaceVim.txt)
[![Doc](https://img.shields.io/badge/doc-%3Ah%20SpaceVim-orange.svg?style=flat-square)](https://github.com/SpaceVim/SpaceVim/blob/master/doc/SpaceVim.txt)
[![QQ](https://img.shields.io/badge/QQ群-121056965-blue.svg)](https://jq.qq.com/?_wv=1027&k=43DB6SG)
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/SpaceVim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Facebook](https://img.shields.io/badge/FaceBook-SpaceVim-blue.svg)](https://www.facebook.com/SpaceVim)
[![GitHub watchers](https://img.shields.io/github/watchers/SpaceVim/SpaceVim.svg?style=social&label=Watch)](https://github.com/SpaceVim/SpaceVim)
[![GitHub stars](https://img.shields.io/github/stars/SpaceVim/SpaceVim.svg?style=social&label=Star)](https://github.com/SpaceVim/SpaceVim)
@ -15,7 +13,7 @@
![welcome-page](https://cloud.githubusercontent.com/assets/13142418/26402270/28ad72b8-40bc-11e7-945e-003f41e057be.png)
项 目 主 页:<https://spacevim.org>
项 目 主 页:<https://spacevim.org/cn/>
码 云 地 址:<https://gitee.com/spacevim/SpaceVim/>