1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 07:09:11 +08:00

Doc: improve SpaceVim doc (#1758)

* Update shell layer doc

* Update script for update layer index

* Update script for update layer index

* Update colorscheme layer doc

* Update autocomplete layer doc

* Update checkers layer doc

* Update chinese layer doc

* Update chat layer doc

* Update faq

* Update VersionControl layer doc

* Update help file

* Update cscope layer doc

* Use cn group

* Update debug layer doc

* Update ctrlp layer doc

* Update default layer doc

* Improve the community page

* Improve the community page

* Update default layer doc

* Update denite layer doc

* Update git layer doc

* Update ui layer doc

* Update tags layer doc

* Update leaderf layer doc

* Update fzf layer doc

* Update unite layer doc

* Update tools layer doc

* Update index

* Update tools#dash layer doc

* Update lsp layer doc

* Update faq
This commit is contained in:
Wang Shidong 2018-05-27 13:05:57 +08:00 committed by GitHub
parent 0ab979b833
commit 1472a549c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 1221 additions and 638 deletions

View File

@ -1,3 +1,13 @@
"=============================================================================
" layers.vim --- Develop script for update layer index
" Copyright (c) 2016-2017 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
scriptencoding utf-8
function! SpaceVim#dev#layers#update() abort
let [start, end] = s:find_position()
@ -11,18 +21,43 @@ function! SpaceVim#dev#layers#update() abort
endfunction
function! SpaceVim#dev#layers#updateCn() abort
let [start, end] = s:find_position_cn()
if start != 0 && end != 0
if end - start > 1
exe (start + 1) . ',' . (end - 1) . 'delete'
endif
call append(start, s:generate_content_cn())
silent! Neoformat
endif
endfunction
function! s:find_position() abort
let start = search('^<!-- SpaceVim layer list start -->$','bwnc')
let end = search('^<!-- SpaceVim layer list end -->$','bnwc')
return sort([start, end])
endfunction
function! s:find_position_cn() abort
let start = search('^<!-- SpaceVim layer cn list start -->$','bwnc')
let end = search('^<!-- SpaceVim layer cn list end -->$','bnwc')
return sort([start, end])
endfunction
function! s:generate_content() abort
let content = ['', '## Available layers', '']
let content += s:layer_list()
return content
endfunction
function! s:generate_content_cn() abort
let content = ['', '## 可用模块', '']
let content += s:layer_list_cn()
return content
endfunction
function! s:layer_list() abort
let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/layers/**/*.md')
let list = [
@ -43,3 +78,24 @@ function! s:layer_list() abort
endfor
return list
endfunction
function! s:layer_list_cn() abort
let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/cn/layers/**/*.md')
let list = [
\ '| 名称 | 描述 |',
\ '| ---------- | ------------ |'
\ ]
call remove(layers, index(layers, '/home/wsdjeg/.SpaceVim/docs/cn/layers/index.md'))
for layer in layers
let name = split(layer, '/docs/cn/layers/')[1][:-4] . '/'
let url = name
let content = readfile(layer)
if len(content) > 3
let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | ' . content[2][14:-2] . ' | '
else
let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | can not find Description |'
endif
call add(list, line)
endfor
return list
endfunction

View File

@ -10,20 +10,27 @@
" @section Introduction, intro
" @stylized spacevim
" @library
" @order intro version dicts functions exceptions layers api faq
" @order intro options config layers api faq
" SpaceVim is a bundle of custom settings and plugins with a modular
" configuration for Vim. It was inspired by Spacemacs.
"
""
" @section CONFIGURATION, config
" SpaceVim uses `~/.SpaceVim.d/init.vim` as its default global config file.
" @section Options, options
" SpaceVim uses `~/.SpaceVim.d/init.toml` as its default global config file.
" You can set all the SpaceVim options and layers in it. `~/.SpaceVim.d/` will
" also be added to runtimepath, so you can write your own scripts in it.
" SpaceVim also supports local config for each project. Place local config
" settings in `.SpaceVim.d/init.vim` in the root directory of your project.
" settings in `.SpaceVim.d/init.toml` in the root directory of your project.
" `.SpaceVim.d/` will also be added to runtimepath.
""
" @section Configuration, config
" If you still want to use `~/.SpaceVim.d/init.toml` as configuration file,
" please check bellowing options.
"
" Public SpaceVim Options {{{
scriptencoding utf-8
@ -778,5 +785,4 @@ endfunction
" <
" vim:set et sw=2 cc=80:

View File

@ -17,10 +17,11 @@ wsdjeg *spacevim* *SpaceVim*
==============================================================================
CONTENTS *SpaceVim-contents*
1. Introduction.............................................|SpaceVim-intro|
2. CONFIGURATION...........................................|SpaceVim-config|
3. Commands..............................................|SpaceVim-commands|
4. Functions............................................|SpaceVim-functions|
5. Layers..................................................|SpaceVim-layers|
2. Options................................................|SpaceVim-options|
3. Configuration...........................................|SpaceVim-config|
4. Commands..............................................|SpaceVim-commands|
5. Functions............................................|SpaceVim-functions|
6. Layers..................................................|SpaceVim-layers|
1. autocomplete..................................|SpaceVim-autocomplete|
2. checkers....................................|SpaceVim-layer-checkers|
3. colorscheme....................................|SpaceVim-colorscheme|
@ -52,13 +53,13 @@ CONTENTS *SpaceVim-contents*
29. shell.........................................|SpaceVim-layer-shell|
30. tmux...........................................|SpaceVim-layer-tmux|
31. tools#dash...............................|SpaceVim-layer-tools-dash|
6. API........................................................|SpaceVim-api|
7. API........................................................|SpaceVim-api|
1. cmdlinemenu................................|SpaceVim-api-cmdlinemenu|
2. data#list....................................|SpaceVim-api-data-list|
3. prompt..........................................|SpaceVim-api-prompt|
4. sid............................................|SpaceVim-api-vim-sid|
5. vim#message................................|SpaceVim-api-vim-message|
7. FAQ........................................................|SpaceVim-faq|
8. FAQ........................................................|SpaceVim-faq|
==============================================================================
INTRODUCTION *SpaceVim-intro*
@ -68,15 +69,22 @@ configuration for Vim. It was inspired by Spacemacs.
==============================================================================
CONFIGURATION *SpaceVim-config*
OPTIONS *SpaceVim-options*
SpaceVim uses `~/.SpaceVim.d/init.vim` as its default global config file. You
SpaceVim uses `~/.SpaceVim.d/init.toml` as its default global config file. You
can set all the SpaceVim options and layers in it. `~/.SpaceVim.d/` will also
be added to runtimepath, so you can write your own scripts in it. SpaceVim
also supports local config for each project. Place local config settings in
`.SpaceVim.d/init.vim` in the root directory of your project. `.SpaceVim.d/`
`.SpaceVim.d/init.toml` in the root directory of your project. `.SpaceVim.d/`
will also be added to runtimepath.
==============================================================================
CONFIGURATION *SpaceVim-config*
If you still want to use `~/.SpaceVim.d/init.toml` as configuration file,
please check bellowing options.
*g:spacevim_version*
Version of SpaceVim , this value can not be changed.

View File

@ -23,11 +23,21 @@
s.parentNode.insertBefore(hm, s);
})();
</script>
{% if page.lang == "cn" %}
<script>
((window.gitter = {}).chat = {}).options = {
room: 'SpaceVim/cn'
};
</script>
{% else %}
<script>
((window.gitter = {}).chat = {}).options = {
room: 'SpaceVim/SpaceVim'
};
</script>
{% endif %}
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">

View File

@ -1,37 +1,57 @@
---
title: "中文社区"
description: "SpaceVim 中文社区,让沟通更加便利,包括讨论、提问、和聊天频道。"
description: "SpaceVim 中文社区,包括中文技术问答、资讯订阅、Bug 提交以及需求提交,让沟通更加便利。"
lang: cn
---
# SpaceVim 中文社区
为了方便中文交流,开通以下中文社区,选择合适的频道寻求帮助或参与讨论。
为了方便 SpaceVim 用户使用中文交流,提供以下中文频道,请根据实际需求选择合适的频道寻求帮助或参与讨论。
## 技术问答
<!-- vim-markdown-toc GFM -->
SpaceVim 的中文问答社区主要集中在知乎 SpaceVim 话题,
与此同时《[知乎专栏](https://zhuanlan.zhihu.com/SpaceVim)》定期更新最新资讯、
新特性预览以及使用技巧。
- [资讯订阅](#资讯订阅)
- [问题及需求提交](#问题及需求提交)
- [技术问答](#技术问答)
- [聊天](#聊天)
- [知乎主页](https://www.zhihu.com/people/SpaceVim/)
- [segmentfault](https://segmentfault.com/t/spacevim)
<!-- vim-markdown-toc -->
## 资讯订阅
### 资讯订阅
- <i class="fab fa-weibo"></i> [新浪微博](https://weibo.com/SpaceVim)
关注 SpaceVim 官方微博或微信公众号以获取最新资讯、新特性介绍、使用技巧等。
- <i class="fab fa-weibo"></i> 新浪微博:[@SpaceVim](https://weibo.com/SpaceVim)
- <i class="fab fa-weixin"></i> 微信公众号SpaceVim
## 提交问题
- [GitHub英文](https://github.com/SpaceVim/SpaceVim)
- [码云(中文)](https://gitee.com/spacevim/SpaceVim/issues)
### 问题及需求提交
## 聊天
在正常使用 SpaceVim 时,如果遇到 Bug 或者有新的特性需求可以通过 Github 或者 码云的问题列表来提交。
进群后,请不要发布无意义的内容,在你提问前,请务必要阅读[《提问的智慧》](http://doc.zengrong.net/smart-questions/cn.html)。
- [码云](https://gitee.com/spacevim/SpaceVim/issues) - (中文)
- [GitHub](https://github.com/SpaceVim/SpaceVim) - (英文)
- <i class="fab fa-qq"></i> [`121056965` SpaceVim 中文交流①群](https://jq.qq.com/?_wv=1027&k=43DB6SG)
- <i class="fab fa-qq"></i> [`755208473` SpaceVim 中文交流②群](https://jq.qq.com/?_wv=1027&k=5uBbMuA)
- <i class="fab fa-qq"></i> [`748697811` SpaceVim 中文交流③群](https://jq.qq.com/?_wv=1027&k=5DqbuMV)
- <i class="fab fa-telegram-plane"></i> [`t.me/VimHub` Vim 中文 telegram 群](https://t.me/VimHub)
### 技术问答
在使用 SpaceVim 时请阅读官网提供的中文文档和常见问题列表。如若还有问题,可以在知乎或者思否上提问,
并标记 `SpaceVim` 话题。
- [知乎问题列表](https://www.zhihu.com/topic/20168681/hot)
- [segmentfault 问题列表](https://segmentfault.com/t/spacevim)
与此同时[《知乎专栏》](https://zhuanlan.zhihu.com/SpaceVim)定期更新最新资讯、
新特性预览以及使用技巧。
### 聊天
作为 SpaceVim 用户的日常交流群,进群后,请不要发布无意义的内容,在你提问前,
请务必要阅读[《提问的智慧》](http://doc.zengrong.net/smart-questions/cn.html)。
- <i class="fab fa-gitter"></i> [`SpaceVim/cn` SpaceVim gitter 聊天室](https://gitter.im/SpaceVim/cn)
- <i class="fab fa-telegram-plane"></i> [`t.me/SpaceVim_cn` SpaceVim 中文 telegram 群](https://t.me/SpaceVim_cn)
- <i class="fab fa-qq"></i> [`121056965` SpaceVim 中文交流 ① 群](https://jq.qq.com/?_wv=1027&k=43DB6SG)
- <i class="fab fa-qq"></i> [`755208473` SpaceVim 中文交流 ② 群](https://jq.qq.com/?_wv=1027&k=5uBbMuA)
- <i class="fab fa-qq"></i> [`748697811` SpaceVim 中文交流 ③ 群](https://jq.qq.com/?_wv=1027&k=5DqbuMV)
**注:** 为了避免各种广告营销号的加入QQ 群为付费交流群,进群后请不要发跟 SpaceVim 完全无关的内容。

View File

@ -1,29 +1,73 @@
---
title: "FAQ"
description: "SpaceVim 常见问题详解,包括安装、更新、设置等等"
title: "常见问题"
description: "在使用 SpaceVim 过程中比较常见的一些问题,包括并不限于安装、配置及使用。"
lang: cn
---
# SpaceVim 常见问题解答
这里罗列了一些关于 SpaceVim 的常见问题,如果你觉得需要添加某些问题,欢迎帮助改进本页面。
这里根据社区反馈的情况,罗列了一些大家经常会问的问题,如果有需要补充的,欢迎使用
使用 SpaceVim 中文社区频道参与套路,也可以直接编辑本页,提交 PR。
## 我应该把我的配置文件放到什么位置?
SpaceVim 默认从 ~/.SpaceVim.d/init.vim 中加载配置文件.
<!-- vim-markdown-toc GFM -->
## E492: 未编辑的命令: ^M
- [为什么选择 Toml 作为默认配置语言?](#为什么选择-toml-作为默认配置语言)
- [为什么 SpaceVim 颜色主题和官网不一致?](#为什么-spacevim-颜色主题和官网不一致)
- [如何增加自定义快捷键?](#如何增加自定义快捷键)
这个问题是git在克隆过程中,自动添加了^M, 可以通过下面的方法来解决:
<!-- vim-markdown-toc -->
```sh
git config --global core.autocrlf input
```
## 为什么 SpaceVim 颜色怪异?
### 为什么选择 Toml 作为默认配置语言?
在往期的版本中,一直使用的 Vim 脚本作为配置文件,而 SpaceVim 读取配置文件的机制是
直接载入该脚本。Vim 在载入脚本时是边载入边执行的,这就意味着当你的配置文件中间部分
出现语法错误时,并不能阻止前半部分配置被载入,排错时非常有影响。
因此我们选择了另外一种更加健壮的语言来配置 SpaceVimSpaceVim 会完整读取该配置文件,
如果文件中间出现语法错误,导致解析失败。那么该配置会被完全舍弃,而使用 SpaceVim 的
默认配置,这就大大降低了因配置文件错误导致 SpaceVim 运行出错的可能性。
在配置文件格式选择时,我们在 json、yaml、xml、toml 这四中文件格式之间也做了比较。
1. yaml 依赖缩进,配置转移时易出错,不与考虑
2. xml 缺少 vim 解析库, 不与考虑
3. json 时一个比较好的配置信息传输格式,并且 Vim 有一个解析的函数,但是 json 格式
不支持注释,手写编辑时,阅读性太差。
因此,我们选择了 Toml 作为默认的配置格式,并且解析后,缓存为 json 文件。SpaceVim
在启动时直接读取缓存 json 文件,效率更高。
### 为什么 SpaceVim 颜色主题和官网不一致?
因为在 SpaceVim 中,默认情况下是启用了终端真色,因此你需要确保你的终端支持真色。
当然如果实在没有办法支持真色,你可以禁用 SpaceVim 的真色选项, 在 `~/.SpaceVim.d/init.vim`
文件中添加:
但是并不是每种终端默认都支持真色的。因此,当你的终端不支持真色时,
你可以在配置文件里面禁用真色支持:
```toml
enable_guicolors = false
```
### 如何增加自定义快捷键?
使用 Toml 作为默认配置文件后,无法在配置文件里面直接添加 Vim 快捷键,
这点让很多用户感到困惑。实际上SpaceVim 支持指定载入配置时需要调用的函数。
比如,我需要加入这样一个快捷键,使用 `<Leader> w` 来保存当前文件。那么,
我需要修改配置文件,并指定一个载入时需要调用的方法:
修改 `~/.SpaceVim.d/init.toml`,加入 `bootstrap_before` 选项:
```toml
[options]
bootstrap_before = "myspacevim#init"
```
添加文件 `~/.SpaceVim.d/autoload/myspacevim.vim`, 并加入如下内容:
```vim
let g:spacevim_enable_guicolors = 0
function! myspacevim#init() abort
nnoremap <Leader>w :w<cr>
endfunction
```

View File

@ -1,26 +1,25 @@
---
title: "主页"
description: "SpaceVim 是一个社区驱动的模块化 Vim IDE"
description: "SpaceVim 是一个社区驱动的模块化 Vim IDE,以模块的方式组织和管理插件,提高 Vim 环境配置效率。"
lang: cn
---
[![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/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)
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master)
[![Version](https://img.shields.io/badge/version-0.8.0--dev-FF69B4.svg)](https://github.com/SpaceVim/SpaceVim/releases)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE)
![welcome-page](https://user-images.githubusercontent.com/13142418/37595020-273b5bca-2bb2-11e8-8aba-638ed5f1c7ea.png)
# SpaceVim - 模块化 Vim IDE
SpaceVim 是一个社区驱动的模块化 Vim IDE以模块的方式组织管理插件以
及相关配置,为不同的语言开发量身定制了相关的开发模块,该模块提供代码自动补全,
语法检查、格式化、调试、REPL 等特性。用户仅需载入相关语言的模块即可得到一个开箱
即用的Vim-IDE。
SpaceVim 是一个社区驱动的模块化 Vim IDE以模块的方式组织管理插件以及相关配置
为不同的语言开发量身定制了相关的开发模块,该模块提供代码自动补全,
语法检查、格式化、调试、REPL 等特性。用户仅需载入相关语言的模块即可得到一个开箱即用的Vim-IDE。
请查阅[入门指南](quick-start-guide/)[用户文档](documentation/)[可用模块](layers/)以获取更多信息。
请查阅[入门指南](quick-start-guide/)、[用户文档](documentation/)和[可用模块](layers/)以获取更多信息。
## 最新特新
@ -35,13 +34,11 @@ SpaceVim 是一个社区驱动的模块化 Vim IDE以模块的方式组织管
{% endfor %}
</ul>
更多精彩博客请订阅 [SpaceVim 中文博客](blog/)
[关注微博 @SpaceVim](https://weibo.com/SpaceVim)
更多精彩博客请订阅 [SpaceVim 中文博客](blog/) 或关注微博 [@SpaceVim](https://weibo.com/SpaceVim)。
## 参与
常规的项目讨论主要是使用[QQ群(点击加入)](https://jq.qq.com/?_wv=1027&k=43zWPlT)
常规的项目讨论和问答主要是使用 [Gitter 聊天室](https://gitter.im/SpaceVim/cn) 和 [知乎](https://www.zhihu.com/topic/20168681/hot)
而提交问题和贡献代码主要是在 [Github](https://github.com/SpaceVim/SpaceVim) 上。
同时SpaceVim 开通了[码云仓库](https://gitee.com/spacevim/SpaceVim),主要用于中文交流。
@ -49,8 +46,8 @@ SpaceVim 是一个社区驱动的模块化 Vim IDE以模块的方式组织管
- 最新的状态是什么?
当前最新发布的稳定版本是 v0.7.0。可以查看[时间表](https://github.com/SpaceVim/SpaceVim/milestones)获取开发进度,
或者阅读 [roadmap](roadmap/) 获取开发计划。
当前最新发布的稳定版本是 v0.7.0。可以查看 [时间表](https://github.com/SpaceVim/SpaceVim/milestones) 获取开发进度,
或者阅读 [Roadmap](roadmap/) 获取开发计划。
- SpaceVim 是尝试搭建一个 IDE 吗?
@ -60,5 +57,6 @@ SpaceVim 是一个社区驱动的模块化 Vim IDE以模块的方式组织管
建议使用 Vim7.4 或者 Neovim v0.1.7及其以上版本。
更多常见问题请阅读 [《SpaceVim FAQ》](faq/)
<!-- vim:set nowrap: -->

View File

@ -1,54 +1,52 @@
---
title: "SpaceVim VersionControl layer"
description: "This layers provides general version control feature for vim. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc…"
title: "SpaceVim VersionControl 模块"
description: "这一模块为 SpaceVim 提供了通用的代码版本控制支持,该模块支持 Git、Mercurial、Bazaar、SVN 等等多种后台工具。"
lang: cn
---
# [SpaceVim Layers:](../) VersionControl
# [可用模块](../) >> VersionControl
<!-- vim-markdown-toc GFM -->
- [Intro](#intro)
- [Features](#features)
- [Key bindings](#key-bindings)
- [模块介绍](#模块介绍)
- [快捷键](#快捷键)
<!-- vim-markdown-toc -->
## Intro
## 模块介绍
This layer provides general function for version control. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc…
这一模块为 SpaceVim 提供了通用的代码版本控制支持,该模块支持 Git、Mercurial、Bazaar、SVN 等等多种后台工具。
为 SpaceVim 提供如下特性:
## Features
- 在左侧栏显示代码改动标记
- 在状态栏显示 vcs 版本信息
- Show a diff using Vim its sign column
- Show vcs info on statusline
## 快捷键
## Key bindings
| 按键 | 描述 |
| --------- | -------------------------- |
| `SPC g .` | 打开版本控制临时快捷键菜单 |
| Key Binding | Description |
| ----------- | ------------------------------- |
| `SPC g .` | version control transient-state |
**临时快捷键菜单**
**Version Control Transient-state**
| 按键 | 描述 |
| ----- | ---------------------------- |
| `w` | Stage 当前文件 |
| `u` | Unstage 当前文件 |
| `n` | 下一个 vcs hunk |
| `N/p` | 上一个 vcs hunk |
| `t` | 启用/禁用 diff signs |
| `l` | 显示仓库 log |
| `D` | Show diffs of unstaged hunks |
| `f` | Fetch for repo with popup |
| `F` | Pull repo with popup |
| `P` | Push repo with popup |
| `c` | Commit with popup |
| `C` | Commit |
| Key Binding | Description |
| ----------- | ---------------------------- |
| `w` | Stage file |
| `u` | Unstage file |
| `n` | next hunk |
| `N/p` | previous hunk |
| `t` | toggle diff signs |
| `l` | Show repo log |
| `D` | Show diffs of unstaged hunks |
| `f` | Fetch for repo with popup |
| `F` | Pull repo with popup |
| `P` | Push repo with popup |
| `c` | Commit with popup |
| `C` | Commit |
**通用快捷键**
**Unimpaired bindings**
| Key Binding | Description |
| ----------- | --------------------------- |
| `[ c` | Go to the previous vcs hunk |
| `] c` | Go to the next vcs hunk |
| 按键 | 描述 |
| ----- | ------------------- |
| `[ c` | 跳至上一个 vcs hunk |
| `] c` | 跳至下一个 vcs hunk |

View File

@ -1,120 +1,123 @@
---
title: "SpaceVim autocomplete layer"
description: "This layer provides auto-completion to SpaceVim"
title: "SpaceVim autocomplete 模块"
description: "这一模块为 SpaceVim 提供了自动补全的框架,包括语法补全等多种补全来源,同时提供了代码块自动完成等特性。"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) autocomplete
# [可用模块](../) >> 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.
这一模块为 SpaceVim 提供了代码自动补全的框架,同时提供了代码块自动完成的特性。默认情况
下根据当前 Vim 所具备的特性,自动选择补全引擎:
The following completion engines are supported:
- [deoplete](https://github.com/Shougo/deoplete.nvim) - neovim/Vim 具备 `+python3` 特性,并且安装了 neovim 的 python-client
- [neocomplete](https://github.com/Shougo/neocomplete.vim) - 需要 Vim 具备 `+lua` 特性
- [neocomplcache](https://github.com/Shougo/neocomplcache.vim) - 当都不具备以上特性时
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) - 默认 Ycm 是不会自动启用的,可通过 SpaceVim 选项 `enable_ycm` 来启用
- [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`
代码块自动完成框架默认为[neosnippet](https://github.com/Shougo/neosnippet.vim),可通过
SpaceVim 选项 `snippet_engien` 设置为 ultisnips
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')
```toml
[[layers]]
name = "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`
- `auto-completion-return-key-behavior` 选项控制当按下 `Return`/`Enter` 键时的行为,
默认为 `smart`可用的值包括如下3种
2. `auto-completion-tab-key-behavior` set the action to perform when the `TAB` key is pressed, the possible values are:
1. `complete` 补全模式,插入当前选中的列表选项
2. `smart` 智能模式,插入当前选中的列表选项,若当前选择的时 snippet则自动展开代码块。
3. `nil` 当设为 nil 时,则采用 Vim 默认的按键行为,插入新行
- `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
- `auto-completion-tab-key-behavior` 选项控制当按下 `Tab` 键时的行为,默认为
`smart`可用的值包括如下4种
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.
1. `smart` 智能模式,自动循环补全列表、展开代码块以及跳至下一个代码块的锚点
2. `complete` 补全模式,插入当前选中的列表选项
3. `cycle` 循环模式,自动再补全列表之间循环
4. `nil` 当设为 nil 时,该行为和 `Tab` 的默认行为一致
The default configuration of the layer is:
- `auto-completion-complete-with-key-sequence` 设置一个手动补全的按键序列,输入模式下按下这一快捷键,
可以启动补全,设为 `nil` 时,这一特性将被禁用。
- `auto-completion-complete-with-key-sequence-delay` 设置手动补全按键序列延迟时间,默认是 0.1
```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,
\ })
自动补全模块默认载入状态如下:
```toml
[[layers]]
name = "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.
通常会建议将 `auto-completion-complete-with-key-sequence` 的值设为 `jk`,如果你不用
这一组按键的话。
### 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)
- [Shougo/neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)neosnippet 的默认代码块模板
- [honza/vim-snippets](https://github.com/honza/vim-snippets):额外的代码块模板
- `~/.SpaceVim/snippets/`SpaceVim 内置代码块模板
- `~/.SpaceVim.d/snippets/`:用户全局代码块模板
- `./.SpaceVim.d/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.
同时,可以通过修改 bootstrap 方法来设置 `g` 的值,进而设置自定义的代码块模板路径,该值
可以是一个 string表示单个目录也可以是一个 list每一个元素表示一个路径。
### Show snippets in auto-completion popup
默认情况下,代码块模板缩写词会在补全列表里面显示,以提示当前输入的内容为一个代码块模板的缩写,
如果需要禁用这一特性,可以设置 `auto-completion-enable-snippets-in-popup` 为 false。
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
\ })
```toml
[[layers]]
name = "autocomplete"
auto-completion-enable-snippets-in-popup = false
```
## 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` |
| `<C-n>` | 选择下一个列表选项 |
| `<C-p>` | 选择上一个列表选项 |
| `<Tab>` | 依据 `auto-completion-tab-key-behavior` |
| `<S-Tab>` | 选择上一个列表选项 |
| `<Return>` | 依据 `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 |
| `M-/` | 如果光标前的词语为一代码块模板缩写,则展开该代码块 |
| `SPC i s` | 列出所有可用的代码块模板,选择后并插入 |

View File

@ -1,27 +1,63 @@
---
title: "SpaceVim chat layer"
description: "SpaceVim chatting layer provide chatting with qq and weixin in vim."
title: "SpaceVim chat 模块"
description: "chat 模块为 SpaceVim 提供了一个聊天框架,目前支持微信聊天和 QQ 聊天,同时支持自定义聊天服务器。"
---
# [Layers](https://spacevim.org/layers) > chat
# [可用模块](../) >> chat
SpaceVim chatting layer provide chatting feature in vim.
<!-- vim-markdown-toc GFM -->
## plugins
- [模块介绍](#模块介绍)
- [启用模块](#启用模块)
- [快捷键](#快捷键)
<!-- vim-markdown-toc -->
Name | Description
----- | ------------------
[vim-chat](https://github.com/vim-chat/vim-chat) | chatting in vim.
## 模块介绍
## Key Mappings
chat 模块为 SpaceVim 提供了一个聊天框架,目前支持微信聊天和 QQ 聊天,同时支持自定义聊天服务器。
`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.
```toml
[[layers]]
name = "chat"
```
for more mappings in chatting buffer, please read <kbd>:h vim-chat</kbd>.
## 快捷键
**打开/关闭聊天窗口**
| 按键 | 描述 |
| --------- | --------------------- |
| `Alt + x` | 打开/关闭 QQ 聊天窗口 |
| `Alt + w` | 打开/关闭微信聊天窗口 |
**聊天窗口内快捷键**
输入消息是,可以使用如下快捷键快速编辑消息。
| 按键 | 描述 |
| ---------------- | ------------------ |
| `<C-w>` | 删除光标前单词 |
| `<Home>/<C-a>` | 将光标移至行首 |
| `<Left>/<Right>` | 左右移动光标 |
| `<End>/<C-e>` | 将光标移至行末 |
| `<C-h>/<Del>` | 删除光标前字符 |
| `<C-k>` | 自光标处删除至行末 |
| `<C-u>` | 自光标处删除至行首 |
| `<Tab>` | 补全历史消息 |
| `<C-d>` | 删除光标处字符 |
| `Alt + f` | 按单词向前移动 |
| `Alt + d` | 从光标处删除至词尾 |
**切换聊天频道**
在聊天窗口内,会在状态栏上显示已经打开的聊天频道,可以通过以下快捷键进行切换。
| 按键 | 描述 |
| ------------------ | ---------------------- |
| `Alt + Left/Right` | 左右切换聊天频道 |
| `Alt + 1-9` | 跳至指定标签的聊天频道 |

View File

@ -1,67 +1,72 @@
---
title: "SpaceVim checkers layer"
description: "This layer provides syntax checking feature"
title: "SpaceVim checkers 模块"
description: "这一模块为 SpaceVim 提供了代码语法检查的特性,同时提供代码实时检查,并列出语法错误的位置"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) checkers
# [可用模块](../) >> 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.
这一模块为 SpaceVim 提供了自动语法检查的特性,并且可设置为输入时实时检查。默认情况
下已经支持多种语言工具。
## Layer Installation
## 启用模块
checkers layer is loaded by default.
checkers 模块默认情况下是启用的。
## 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.
默认会在光标的下一行显示当前行错误的详细信息,如果需要禁用这一特性,可以在载入模块
时指定 `show_cursor_error` 的值为 false。
```vim
call SpaceVim#layers#load('checkers', {
\ 'show_cursor_error' : 0,
\ })
```toml
[[layers]]
name = "checkers"
show_cursor_error = false
```
SpaceVim 选项:
| 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. |
| 选项名称 | 默认值 | 描述 |
| ----------------- | ------ | ----------------------------------- |
| `enable_neomake` | true | 使用 Neomake 作为默认的语法检查插件 |
| `enable_ale` | false | 使用 Ale 作为默认语法检查插件 |
| `lint_on_the_fly` | false | 启用实时语法检查 |
**NOTE:** if you want to use ale, you need:
**NOTE:** 如果你需要使用 Ale 作为默认检查工具SpaceVim 选项需要加入:
```viml
let g:spacevim_enable_neomake = 0
let g:spacevim_enable_ale = 1
```toml
[options]
enable_neomake = false
enable_ale = true
```
and if you want to use syntastic, set this two options to 0.
如果需要使用 syntastic将两者都设置为 false。
## 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 |
| 按键 | 描述 |
| --------- | ------------------------------- |
| `SPC e .` | 打开错误临时快捷键菜单 |
| `SPC e c` | 清除错误列表 |
| `SPC e h` | 描述当前检查工具 |
| `SPC e n` | 跳至下一个语法错误位置 |
| `SPC e N` | 跳至上一个语法错误位置 |
| `SPC e p` | 跳至上一个语法错误位置 |
| `SPC e l` | 列出错误列表窗口 |
| `SPC e L` | 列出错误列表窗口并跳至该窗口 |
| `SPC e e` | 解释光标处的语法错误 |
| `SPC e s` | 设置语法检查工具 (TODO) |
| `SPC e S` | 设置语法检查工具执行命令 (TODO) |
| `SPC e v` | 确认语法检查工具启动状态 |
| `SPC t s` | 临时启用/禁用语法检查 |

View File

@ -1,18 +1,38 @@
---
title: "SpaceVim chinese layer"
description: "Layer for chinese users, include chinese docs and runtime messages"
title: "SpaceVim chinese 模块"
description: "该模块为中文用户提供了中文的 Vim 帮助文档,同时提供部分插件的中文帮助文档。"
lang: cn
---
# [Layers](https://spacevim.org/layers) > chinese
# [可用模块](https://spacevim.org/layers) >> chinese
## Description
<!-- vim-markdown-toc GFM -->
This layer is for chinese users, and provide chinese docs and runtime messages.
- [模块描述](#模块描述)
- [启用模块](#启用模块)
- [模块配置](#模块配置)
## Layer Installation
<!-- vim-markdown-toc -->
To use this configuration layer, add `splayer 'chinese'` to your custom configuration file.
## 模块描述
## Configuration
该模块为中文用户提供了中文的 Vim 帮助文档,同时提供部分插件的中文帮助文档。
if you want to enable this feature, add `let g:spacevim_vim_help_language = 'cn'` to your custom config file.
## 启用模块
中文用户,可以在配置文件里面启用该模块,以获取中文帮助文档:
```toml
[[layers]]
name = "chinese"
```
## 模块配置
加在该模块后,默认的帮助文件语言并为设置为中文,可以通过 SpaceVim 选项
`vim_help_language` 来设置,可将其值设为 `"cn"`
```toml
[options]
vim_help_language = "cn"
```

View File

@ -1,28 +1,70 @@
---
title: "SpaceVim colorscheme layer"
description: "colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme."
title: "SpaceVim colorscheme 模块"
description: "colorscheme 模块为 SpaceVim 提供了一系列的常用颜色主题,默认情况下使用深色 gruvbox 作为默认主题。该模块提供了快速切换主题、随即主题等特性"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) colorscheme
# [可用模块](https://spacevim.org/layers) >> colorscheme
This layer provides many Vim colorschemes for SpaceVim, the default colorscheme is gruvbox.
<!-- vim-markdown-toc GFM -->
To change the colorscheme:
- [模块描述](#模块描述)
- [启用模块](#启用模块)
- [模块配置](#模块配置)
```vim
let g:spacevim_colorscheme = 'onedark'
<!-- vim-markdown-toc -->
## 模块描述
colorscheme 模块为 SpaceVim 提供了一系列常用的颜色主题,默认情况为深色的 gruvbox 主题。
## 启用模块
默认情况下,这一模块并为启用,如果需要使用更多的颜色主题,可以启用该模块,在配置
文件内加入如下内容:
```toml
[[layers]]
name = 'colorscheme'
```
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'
## 模块配置
如果需要修改默认主题,可在配置文件中修改 colorscheme 选项,改为主题名称即可。
```toml
[options]
colorscheme = "onedark"
```
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.
**主题列表**
| 名称 | 深色主题 | 浅色主题 | 终端支持 | Gui支持 | 状态栏支持 |
| ---------- | -------- | -------- | -------- | ------- | ---------- |
| gruvbox | yes | yes | yes | yes | yes |
| one | yes | yes | yes | yes | yes |
| molokai | yes | no | yes | yes | yes |
| jellybeans | yes | no | yes | yes | yes |
| nord | yes | no | yes | yes | yes |
| onedark | yes | no | yes | yes | yes |
部分主题提供了深色和浅色两系列的主题,可以通过设置主题背景色来切换这两种主题。
SpaceVim 支持在配置文件中通过 `colorscheme_bg` 这一选项来设置。
比如,设置默认主题为 onedark并且使用其深色系列主题
```toml
[options]
colorscheme = "onedark"
colorscheme_bg = 'dark'
```
这一模块提供了,在启动时随机选择主题,而不是使用默认的主题。这一特性可以很
大限度地消除视觉疲劳:
```toml
[[layers]]
name = 'colorscheme'
random-theme = true
```

View File

@ -1,48 +1,63 @@
---
title: "SpaceVim cscope layer"
description: "This layer provide cscope manager for project"
title: "SpaceVim cscope 模块"
description: "cscope 模块为 SpaceVim 他提供了一个智能的 cscope 和 pycscope 辅助工具,可以快速调用 cscope 常用命令"
lang: cn
---
# [Layers](../) > cscope
# [可用模块](../) > cscope
## Description
<!-- vim-markdown-toc GFM -->
This layer provides a smart [Cscope](http://cscope.sourceforge.net/) and [PyCscope](https://github.com/portante/pycscope) helper for SpaceVim.
- [模块描述](#模块描述)
- [模块特性](#模块特性)
- [安装依赖及启用模块](#安装依赖及启用模块)
- [安装 cscope](#安装-cscope)
- [启用模块](#启用模块)
- [快捷键](#快捷键)
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)
<!-- vim-markdown-toc -->
## Features
## 模块描述
- Tag indexing and searching for C-C++ via Cscope
- Tag indexing and searching for python via PyCscope
这以模块为 SpaceVim 提供了一个智能的[Cscope](http://cscope.sourceforge.net/) 和 [PyCscope](https://github.com/portante/pycscope) 辅助工具。
## Installation
如果想要了解更多关于 cscope 和其他类似工具之间的区别,请阅读 [Comparison with Similar Tools](https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools)
### cscope
## 模块特性
- 通过 cscope 为 c 和 c++ 建立索引,并提供查询功能
- 通过 Pycscope 为 python 建立索引,并提供查询功能
## 安装依赖及启用模块
### 安装 cscope
ArchLinux 下安装 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')
```toml
[[layers]]
name = "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 |
| 按键 | 描述 |
| ----------- | ------------------------------- |
| `SPC m c =` | Find assignments to this symbol |
| `SPC m c i` | 建立 cscope 索引 |
| `SPC m c c` | 列出某个方法调用的所有函数 |
| `SPC m c C` | 列出某个方法被哪些函数调用 |
| `SPC m c d` | 查询 symbol 的定义处 |
| `SPC m c r` | 查询 symbol 的引用 |
| `SPC m c f` | 搜索文件 |
| `SPC m c F` | 列出 include 某个文件的所有文件 |
| `SPC m c e` | 搜索正则表达式 |
| `SPC m c t` | 搜索文本 |

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

@ -0,0 +1,38 @@
---
title: "SpaceVim ctrlp 模块"
description: "提供以 ctrlp 为核心的模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。"
lang: cn
---
# [可用模块](../) >> ctrlp
## 模块介绍
这一模块在 ctrlp 的基础上做了时当的包装和定制,提供了搜索文件、函数列表、
命令历史等等特性。
## 启用模块
ctrlp 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "ctrlp"
```
## 快捷键
下列快捷键均以 `<Leader> f` 为前置键,`<Leader>` 在 SpaceVim 中默认没有修改,
`\` 键。
| 按键 | 描述 |
| -------------------- | ------------------------------ |
| `<Leader> f <space>` | 模糊查找快捷键,并执行该快捷键 |
| `<Leader> f e` | 模糊搜索寄存器 |
| `<Leader> f h` | 模糊搜索 history/yank |
| `<Leader> f j` | 模糊搜索 jump, change |
| `<Leader> f l` | 模糊搜索 location list |
| `<Leader> f m` | 模糊搜索 output messages |
| `<Leader> f o` | 模糊搜索函数列表 |
| `<Leader> f q` | 模糊搜索 quickfix list |
| `<Leader> f r` | 重置上次搜索窗口 |

View File

@ -1,44 +1,52 @@
---
title: "SpaceVim debug layer"
description: "This layer provide debug workflow support in SpaceVim"
title: "SpaceVim debug 模块"
description: "这一模块为 SpaceVim 提供了 debug 的常用功能,采用 vebugger 作为后台框架,支持多种 debug 工具。"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) debug
# [可用模块](../) >> 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).
这一模块为 SpaceVim 提供了基本的 debug 框架,高度定制
[vim-vebugger](https://github.com/idanarye/vim-vebugger) 插件,支持多种 debug
工具。
## Install
## 启用模块
To use this configuration layer, add `call SpaceVim#layers#load('debug')` to your custom configuration file.
SpaceVim 默认未载入该模块,如需载入模块,可以在配置文件中加入:
## Key bindings
```toml
[[layers]]
name = "debug"
```
| 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**
| 按键 | 描述 |
| ----------- | ------------------------- |
| `SPC d l` | 启动 debugger |
| `SPC d c` | 继续下一步 |
| `SPC d b` | 添加/去除当前行断点 |
| `SPC d B` | 清除所有断点 |
| `SPC d o` | 单步执行 |
| `SPC d i` | 跳至方法体 |
| `SPC d O` | 运行至当前方法结束 |
| `SPC d e s` | 打印并求值选中的文本 |
| `SPC d e e` | 打印并求值光标所在变量 |
| `SPC d e S` | Execute the selected text |
| `SPC d k` | 关闭 debugger |
key bindings is too long? use `SPC d .` to open the debug transient state:
**Debug 临时快捷键菜单**
debug 的快捷键太长了? 可以使用 `SPC d .` 调出 debug 临时快捷键菜单。
![Debug Transient State](https://user-images.githubusercontent.com/13142418/33996076-b03c05bc-e0a5-11e7-90fd-5f31e2703d7e.png)

View File

@ -1,5 +1,20 @@
# [Layers](https://spacevim.org/layers) > default
---
title: "SpaceVim default 模块"
description: "SpaceVim default 模块并不包含插件,但提供了一些更好的默认设置,"
lang: cn
---
SpaceVim default layer contains none plugins, but it has some better default config for vim and neovim.
# [SpaceVim Layers:](../) default
## Key Mappings
## 模块描述
这一模块主要优化了一些 Vim 设置,包含了一些默认的设置选项,和快捷键。
## 快捷键
一些编辑常用的快捷键
| 按键 | 描述 |
| ------------ | ---------------- |
| `<Leader> y` | 复制到系统剪切板 |
| `<Leader> p` | 从系统剪切板粘贴 |

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

@ -0,0 +1,38 @@
---
title: "SpaceVim denite 模块"
description: "提供以 denite 为核心的异步模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。"
lang: cn
---
# [可用模块](../) >> denite
## 模块描述
提供以 denite 为核心的异步模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。这一模块需要 Vim
或者 Neovim 支持 `+python3`
## 启用模块
denite 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "denite"
```
## 快捷键
下列快捷键均以 `<Leader> f` 为前置键,`<Leader>` 在 SpaceVim 中默认没有修改,
`\` 键。
| 按键 | 描述 |
| -------------------- | ------------------------------ |
| `<Leader> f <space>` | 模糊查找快捷键,并执行该快捷键 |
| `<Leader> f e` | 模糊搜索寄存器 |
| `<Leader> f h` | 模糊搜索 history/yank |
| `<Leader> f j` | 模糊搜索 jump, change |
| `<Leader> f l` | 模糊搜索 location list |
| `<Leader> f m` | 模糊搜索 output messages |
| `<Leader> f o` | 模糊搜索函数列表 |
| `<Leader> f q` | 模糊搜索 quickfix list |
| `<Leader> f r` | 重置上次搜索窗口 |

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

@ -0,0 +1,38 @@
---
title: "SpaceVim fzf 模块"
description: "提供以 fzf 为核心的异步模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。"
lang: cn
---
# [可用模块](../) >> fzf
## 模块介绍
这一模块在 fzf 的基础上做了时当的包装和定制,提供了搜索文件、函数列表、
命令历史等等特性。
## 启用模块
fzf 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "fzf"
```
## 快捷键
下列快捷键均以 `<Leader> f` 为前置键,`<Leader>` 在 SpaceVim 中默认没有修改,
`\` 键。
| 按键 | 描述 |
| -------------------- | ------------------------------ |
| `<Leader> f <space>` | 模糊查找快捷键,并执行该快捷键 |
| `<Leader> f e` | 模糊搜索寄存器 |
| `<Leader> f h` | 模糊搜索 history/yank |
| `<Leader> f j` | 模糊搜索 jump, change |
| `<Leader> f l` | 模糊搜索 location list |
| `<Leader> f m` | 模糊搜索 output messages |
| `<Leader> f o` | 模糊搜索函数列表 |
| `<Leader> f q` | 模糊搜索 quickfix list |
| `<Leader> f r` | 重置上次搜索窗口 |

View File

@ -1,38 +1,41 @@
---
title: "SpaceVim git layer"
description: "This layers adds extensive support for git"
title: "SpaceVim git 模块"
description: "这一模块为 SpaceVim 提供了 git 支持,根据当前 Vim 版本特性,选择 gina 或者 gita 作为默认的后台 git 插件。"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) git
# [可用模块](../) >> 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/).
这一模块为 SpaceVim 提供了 [git](http://git-scm.com/) 支持,根据当前 Vim 版本特性,选择 gina 或者 gita 作为默认的后台 git 插件。
### Features
## 启用模块
## Install
默认情况下,这一模块并为启用,如果需要启用该模块,可在配置文件内加入:
### Layer
```toml
[[layers]]
name = "git"
```
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 |
| 按键 | 描述 |
| --------- | -------------------- |
| `SPC g s` | 打开 git status 窗口 |
| `SPC g S` | stage 当前文件 |
| `SPC g U` | unstage 当前文件 |
| `SPC g c` | 打开 git commit 窗口 |
| `SPC g p` | 执行 git push |
| `SPC g d` | 打开 git diff 窗口 |
| `SPC g A` | git add 所有文件 |
| `SPC g b` | 打开 git blame 窗口 |

View File

@ -1,93 +1,95 @@
---
title: Available layers
description: A list of available layers in SpaceVim.
title: 可用模块
description: "简述什么是模块,如何启用和禁用 SpaceVim 模块,以及如何设置模块选项。并罗列出 SpaceVim 中所有内置的模块。"
keywords: layer,layers
lang: cn
---
<!-- 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.
SpaceVim 是一个社区驱动的 vim 配置集合,通常一个 Vim 的配置集合包含了诸多的
Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管理这些插件以及相关
的配置。默认情况下,这些模块都是禁用的,用户可以根据自己需要,或者是项目需要
来载入指定的模块以获取相关功能。
### Enable layers
通过模块的方式管理插件和相关配置,为使用者节省了大量的搜索插件和调试插件的时
间。用户仅仅需要根据自己的实际需求,来启用相关模块。比如,当我需要频繁调用终
端时,可以启用终端支持的 `shell` 模块。
here is an example for loadding `shell` layer with some specified options:
### 如何启用模块
```vim
call SpaceVim#layers#load('shell',
\ {
\ 'default_position' : 'top',
\ 'default_height' : 30,
\ }
\ )
`shell` 模块为例,启用该模块,并且设定一些模块选项,指定终端打开位置为
顶部,高度 30。
```toml
[[layers]]
name = "shell"
default_position = "top"
default_height = 30
```
### Disable layers
### 如何禁用模块
Some layers are enabled by defalut, here is an example for disable `shell` layer:
在 SpaceVim 内,默认启用了一些模块,当你需要禁用某一个模块时,需要指定模块
选项 `enable` 为 false。`enable` 这一选项缺省为 true所以启用模块时这一
选项可以省略。
```vim
call SpaceVim#layers#disable('shell')
```toml
[[layers]]
name = "shell"
enable = false
```
<!-- SpaceVim layer list start -->
<!-- 更新模块列表 call SpaceVim#dev#layers#updateCn() -->
## Available layers
<!-- SpaceVim layer cn list start -->
| Name | Description |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [VersionControl](VersionControl/) | This layers provides general version control feature for vim. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc… |
| [autocomplete](autocomplete/) | Autocomplete code within SpaceVim, fuzzy find the candidates from multiple completion sources, expand snippet before cursor automatically |
| [chat](chat/) | SpaceVim chatting layer provide chatting with qq and weixin in vim. |
| [checkers](checkers/) | Syntax checking automatically within SpaceVim, display error on the sign column and statusline. |
| [chinese](chinese/) | Layer for chinese users, include chinese docs and runtime messages |
| [colorscheme](colorscheme/) | colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme. |
| [cscope](cscope/) | cscope layer provides a smart cscope and pycscope helper for SpaceVim, help users win at cscope |
| [ctrlp](ctrlp/) | This layers provide a heavily customized ctrlp centric work-flow |
| [debug](debug/) | This layer provide debug workflow support in SpaceVim |
| [default](default/) | lt layer contains none plugins, but it has some better default config for vim and neovim |
| [denite](denite/) | This layers provide a heavily customized Denite centric work-flow |
| [fzf](fzf/) | This layers provide a heavily customized fzf centric work-flow |
| [git](git/) | This layers adds extensive support for git |
| [github](github/) | This layer provides GitHub integration for SpaceVim |
| [lang#c](lang/c/) | c/c++/object-c language support for SpaceVim, include code completion, jump to definition, quick runner. |
| [lang#csharp](lang/csharp/) | This layer is for csharp development |
| [lang#dart](lang/dart/) | This layer is for dart development, provide autocompletion, syntax checking, code format for dart file. |
| [lang#elixir](lang/elixir/) | This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file. |
| [lang#go](lang/go/) | This layer is for golang development. It also provides additional language-specific key mappings. |
| [lang#haskell](lang/haskell/) | haskell language support for SpaceVim, includes code completion, syntax checking, jumping to definition, also provides language server protocol support for haskell |
| [lang#html](lang/html/) | Edit html in SpaceVim, with this layer, this layer provides code completion, syntax checking and code formatting for html. |
| [lang#java](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](lang/javascript/) | This layer is for JaveScript development |
| [lang#lisp](lang/lisp/) | This layer is for lisp development, provide autocompletion, syntax checking, code format for lisp file. |
| [lang#lua](lang/lua/) | This layer is for lua development, provide autocompletion, syntax checking, code format for lua file. |
| [lang#markdown](lang/markdown/) | Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file. |
| [lang#ocaml](lang/ocaml/) | This layer is for Python development, provide autocompletion, syntax checking, code format for ocaml file. |
| [lang#php](lang/php/) | This layer adds PHP language support to SpaceVim |
| [lang#python](lang/python/) | This layer is for Python development, provide autocompletion, syntax checking, code format for python file. |
| [lang#ruby](lang/ruby/) | This layer is for ruby development, provide autocompletion, syntax checking, code format for ruby file. |
| [lang#typescript](lang/typescript/) | This layer is for TypeScript development |
| [lang#vim](lang/vim/) | This layer is for writting vim script, including code completion, syntax checking and buffer formatting |
| [language-server-protocol](language-server-protocol/) | This layers provides language server protocol for vim and neovim |
| [leaderf](leaderf/) | This layers provide a heavily customized LeaderF centric work-flow |
| [shell](shell/) | This layer provide shell support in SpaceVim |
| [tags](tags/) | This layer provide tags manager for project |
| [tools#dash](tools/dash/) | This layer provides Dash integration for SpaceVim |
| [tools](tools/) | This layer provides some tools for vim |
| [ui](ui/) | Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and vim in both TUI and GUI |
| [unite](unite/) | This layers provide a heavily customized Unite centric work-flow |
## 可用模块
<!-- SpaceVim layer list end -->
| 名称 | 描述 |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [VersionControl](VersionControl/) | 这一模块为 SpaceVim 提供了通用的代码版本控制支持,该模块支持 Git、Mercurial、Bazaar、SVN 等等多种后台工具。 |
| [autocomplete](autocomplete/) | 这一模块为 SpaceVim 提供了自动补全的框架,包括语法补全等多种补全来源,同时提供了代码块自动完成等特性。 |
| [chat](chat/) | chat 模块为 SpaceVim 提供了一个聊天框架,目前支持微信聊天和 QQ 聊天,同时支持自定义聊天服务器。 |
| [checkers](checkers/) | 这一模块为 SpaceVim 提供了代码语法检查的特性,同时提供代码实时检查,并列出语法错误的位置 |
| [chinese](chinese/) | 该模块为中文用户提供了中文的 Vim 帮助文档,同时提供部分插件的中文帮助文档。 |
| [colorscheme](colorscheme/) | colorscheme 模块为 SpaceVim 提供了一系列的常用颜色主题,默认情况下使用深色 gruvbox 作为默认主题。该模块提供了快速切换主题、随即主题等特性 |
| [cscope](cscope/) | cscope 模块为 SpaceVim 他提供了一个智能的 cscope 和 pycscope 辅助工具,可以快速调用 cscope 常用命令 |
| [ctrlp](ctrlp/) | 提供以 ctrlp 为核心的模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。 |
| [debug](debug/) | 这一模块为 SpaceVim 提供了 debug 的常用功能,采用 vebugger 作为后台框架,支持多种 debug 工具。 |
| [default](default/) | SpaceVim default 模块并不包含插件,但提供了一些更好的默认设置, |
| [denite](denite/) | This layers provide a heavily customized Denite centric work-flow |
| [git](git/) | 这一模块为 SpaceVim 提供了 git 支持,根据当前 Vim 版本特性,选择 gina 或者 gita 作为默认的后台 git 插件。 |
| [lang#c](lang/c/) | This layer is for c/c++/object-c development |
| [lang#dart](lang/dart/) | This layer is for dart development, provide autocompletion, syntax checking, code format for dart file. |
| [lang#elixir](lang/elixir/) | This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file. |
| [lang#go](lang/go/) | This layer is for golang development. It also provides additional language-specific key mappings. |
| [lang#haskell](lang/haskell/) | This layer is for haskell development |
| [lang#html](lang/html/) | Edit html in SpaceVim, with this layer, this layer provides code completion, syntax checking and code formatting for html. |
| [lang#java](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](lang/javascript/) | This layer is for JaveScript development |
| [lang#lisp](lang/lisp/) | for lisp development |
| [lang#lua](lang/lua/) | This layer is for lua development, provide autocompletion, syntax checking, code format for lua file. |
| [lang#markdown](lang/markdown/) | Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file. |
| [lang#php](lang/php/) | This layer adds PHP language support to SpaceVim |
| [lang#python](lang/python/) | This layer is for Python development, provide autocompletion, syntax checking, code format for python file. |
| [lang#ruby](lang/ruby/) | This layer is for ruby development, provide autocompletion, syntax checking, code format for ruby file. |
| [lang#typescript](lang/typescript/) | This layer is for TypeScript development |
| [lang#vim](lang/vim/) | This layer is for writting vim script, including code completion, syntax checking and buffer formatting |
| [language-server-protocol](language-server-protocol/) | This layers provides language server protocol for vim and neovim |
| [shell](shell/) | 这一模块为 SpaceVim 提供了终端集成特性,优化内置终端的使用体验 |
| [tags](tags/) | This layer provide tags manager for project |
| [ui](ui/) | Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and vim in both TUI and GUI |
<!-- SpaceVim layer cn list end -->
<!-- vim:set nowrap: -->

View File

@ -1,30 +1,33 @@
---
title: "SpaceVim language server protocol layer"
description: "This layers provides language server protocol for vim and neovim"
title: "SpaceVim lsp 模块"
description: "lsp 模块为 SpaceVim 提供 language server protocol 的支持,提供更多语言相关服务"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) lsp
# [可用模块](../) >> 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.
lsp 模块提供了 [language-server-protocol](https://microsoft.github.io/language-server-protocol/) 的支持,
这以模块在 [LanguageClient-neovim](https://github.com/SpaceVim/LanguageClient-neovim) 基础上做了许多定制,
这一链接为一克隆的版本,需要 `+python` 支持。
we also want to include [vim-lsp](https://github.com/prabirshrestha/vim-lsp), which is wrote in pure vim script.
同时,当你的 Vim 不支持 `+python3` 时,我们采用 [vim-lsp](https://github.com/prabirshrestha/vim-lsp) 这一使用纯 vim 脚本书写的插件。
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)
neovim 团队也在尝试实现一个内置的 [lsp 框架](https://github.com/neovim/neovim/pull/6856),后续该框架完成后,在 neovim 内将默认使用该框架。
SpaceVim should works well in different version of vim/neovim, so in the features, the logic of this layer should be:
在 SpaceVim 内部lsp 的框架选择逻辑大致时这样的:
```vim
if has('nvim')
@ -36,26 +39,31 @@ else
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.
- 异步调用,避免卡顿
- 代码补全,(需要载入 [autocomplet](https://spacevim.org/layers/autocomplete/) 模块)
- 实时代码语法检查
- 重命名函数
- 显示错误信息
- 跳至定义处
- 列举所有引用
- 文档检索
- 代码格式化
- 代码自动修复
**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/)
**注:** 以上所有信息依赖于语言服务器所实现的功能,请查阅 [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
```toml
[[layers]]
name = "lsp"
```
### 安装语言服务器
**JavaScript:**
@ -69,23 +77,22 @@ npm install -g javascript-typescript-langserver
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:
为指定模块启用语言服务器支持,需要在载入模块时,指定 `filetypes` 选项:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'filetypes' : ['rust',
\ 'typescript',
\ 'javascript',
\ ],
\ }
```toml
[[layers]]
name = "lsp"
filetypes = [
"rust",
"javascript"
]
```
default language server commands:
默认语言服务器的执行命令列表如下:
| language | server command |
| 语言 | 命令 |
| ------------ | ------------------------------------------------ |
| `javascript` | `['javascript-typescript-stdio']` |
| `haskell` | `['hie', '--lsp']` |
@ -100,20 +107,22 @@ default language server commands:
| `python` | `['pyls']` |
| `php` | `['php', 'path/to/bin/php-language-server.php']` |
To override the server command, you may need to use `override_cmd` option:
如果需要修改语言服务器的命令,在载入模块时,需要指定 `override_cmd` 选项:
```vim
call SpaceVim#layers#load('lsp',
\ {
\ 'override_cmd' : {
\ 'rust' : ['rustup', 'run', 'nightly', 'rls'],
\ }
\ }
```toml
[[layers]]
name = "lsp"
filetypes = [
"rust",
"javascript"
]
[layers.override_cmd]
rust = ["rustup", "run", "nightly", "rls"]
```
## Key bindings
## 快捷键
| Key Binding | Description |
| 按键 | 描述 |
| --------------- | ------------- |
| `K` / `SPC l d` | show document |
| `SPC l e` | rename symbol |
| `K` / `SPC l d` | 显示文档 |
| `SPC l e` | 重命名 symbol |

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

@ -0,0 +1,38 @@
---
title: "SpaceVim leaderf模块"
description: "提供以 leaderf 为核心的异步模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。"
lang: cn
---
# [可用模块](../) >> leaderf
## 模块介绍
这一模块在 leaderf 的基础上做了时当的包装和定制,提供了搜索文件、函数列表、
命令历史等等特性。
## 启用模块
leaderf 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "leaderf"
```
## 快捷键
下列快捷键均以 `<Leader> f` 为前置键,`<Leader>` 在 SpaceVim 中默认没有修改,
`\` 键。
| 按键 | 描述 |
| -------------------- | ------------------------------ |
| `<Leader> f <space>` | 模糊查找快捷键,并执行该快捷键 |
| `<Leader> f e` | 模糊搜索寄存器 |
| `<Leader> f h` | 模糊搜索 history/yank |
| `<Leader> f j` | 模糊搜索 jump, change |
| `<Leader> f l` | 模糊搜索 location list |
| `<Leader> f m` | 模糊搜索 output messages |
| `<Leader> f o` | 模糊搜索函数列表 |
| `<Leader> f q` | 模糊搜索 quickfix list |
| `<Leader> f r` | 重置上次搜索窗口 |

View File

@ -1,57 +1,61 @@
---
title: "SpaceVim shell layer"
description: "This layer provide shell support in SpaceVim"
title: "SpaceVim shell 模块"
description: "这一模块为 SpaceVim 提供了终端集成特性,优化内置终端的使用体验"
---
# [SpaceVim Layers:](https://spacevim.org/layers) shell
# [SpaceVim 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)
- [描述](#描述)
- [安装](#安装)
- [配置](#配置)
- [设置默认 shell](#设置默认-shell)
- [设置终端打开位置及高度](#设置终端打开位置及高度)
- [快捷键](#快捷键)
<!-- vim-markdown-toc -->
## Description
## 描述
This layer provide shell support in SpaceVim.
这一模块为 SpaceVim 提供了 shell 集成,根据当前 vim/neovim 的版本,优化自带的内置终端。
## Install
## 安装
To use this configuration layer, add `SPLayer 'shell'` to your custom configuration file.
如果需要启用该模块,需要在 SpaceVim 的配置文件内添加如下代码:
## Configuration
```toml
[[layers]]
name = "shell"
```
### Default shell
## 配置
Vim support these kinds of shell:
### 设置默认 shell
To define the default shell you can set the layer variable `default_shell` to the following variables:
SpaceVim 支持两种 shell用户在启用该模块时可以通过 `default_shell` 这一模块选项来指定默认的 shell 工具。
- terminal
- VimShell
- terminal:使用 vim/neovim 内置终端
- VimShell使用 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.
在启用该模块时,可以通过 `default_position` 这一模块选项来指定终端打开的位置,
目前可以选的值为:`top`, `bottom`, `left`, `right`, or `full`,默认的值为 `top`
```vim
call SpaceVim#layers#load('shell',
\ {
\ 'default_position' : 'top',
\ 'default_height' : 30,
\ }
\ )
同时,可以通过 `default_height` 这一模块选项指定终端打开的高度,默认值为 30。
```toml
[[layers]]
name = "shell"
default_position = "top"
default_height = 30
```
## Key bindings
## 快捷键
| Key Binding | Description |
| ----------- | -------------------------------------- |
| `SPC '` | Open, close or go to the default shell |
| 按键 | 描述 |
| ------- | ------------------------------ |
| `SPC '` | 打开终端或跳至已打开的终端窗口 |

View File

@ -1,91 +1,84 @@
---
title: "SpaceVim tags layer"
description: "This layer provide tags manager for project"
title: "SpaceVim tags 模块"
description: "tags 模块提供全局的 tags 索引管理,提供快速检索定义和引用的功能。"
---
# [SpaceVim Layers:](https://spacevim.org/layers) tags
# [可用模块](../) >> 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)
- [从源码编译安装](#从源码编译安装)
- [安装依赖环境](#安装依赖环境)
- [编译安装](#编译安装)
- [配置 pygments 和 ctags 环境](#配置-pygments-和-ctags-环境)
- [启用模块](#启用模块)
- [使用模块](#使用模块)
- [语言支持](#语言支持)
- [内置的语言支持](#内置的语言支持)
- [通过 exuberant ctags 支持的语言](#通过-exuberant-ctags-支持的语言)
- [通过 Universal ctags 支持的语言](#通过-universal-ctags-支持的语言)
- [通过 Pygments 支持的语言](#通过-pygments-支持的语言)
- [快捷键](#快捷键)
<!-- vim-markdown-toc -->
## Description
## 模块简介
This layer provide tags manager for project. This layer need `core` layer's project manager feature.
tags 模块提供了项目 tags 管理工具,依赖 SpaceVim 自身的项目管理特性。
## 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.
- 自动/手动新建 tag 数据库
- 自动/手动更新 tag 数据库
- 查找所有引用处
- 查找所有定义处
- 列出当前项目所有 tag
- 重置上次查询窗口
- 根据文本内容跳至定义/引用处
## 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:
首先需要安装 [GNU Global](https://www.gnu.org/software/global/download.html),可更具当前使用的操作系统,
使用自带的软件包管理工具安装。
```sh
sudo apt-get install global
```
#### Install on OSX using Homebrew
**OSX 下使用 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
如果需要启用 global 的所有特性,你需要安装 2 个额外的软件包pygments 和 ctags。
这两个可以使用系统自带的包管理器安装:
**Ubuntu**
```sh
sudo apt-get install exuberant-ctags python-pygments
```
or e.g., Archlinux:
**ArchLinux**
```sh
sudo pacman -S ctags python-pygments
```
##### Install with recommended features
##### 编译安装
Download the latest tar.gz archive, then run these commands:
下载最新的 tar.gz 文件,执行如下命令:
```sh
tar xvf global-6.5.3.tar.gz
@ -95,105 +88,109 @@ make
sudo make install
```
##### Configure your environment to use pygments and ctags
##### 配置 pygments 和 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:
To be able to use pygments and ctags, you need to copy the sample gtags.conf either to /etc/gtags.conf or
如果需要启用 pygments 和 ctags需要复制示例 gtags.conf 至 `/etc/gtags.conf` 或者 `$HOME/.globalrc`。例如:
```sh
cp gtags.conf ~/.globalrc
```
Additionally you should define GTAGSLABEL in your shell startup file e.g. with sh/ksh:
此外,启动 shell 时需要设置环境变量 `GTAGSLABEL`,通常需要修改 `.profile` 文件。
```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')
```toml
[[layers]]
name = "tags"
```
## Usage
## 使用模块
Before using the gtags, remember to create a GTAGS database by the following methods:
在使用 gtags 之前,建议先新建 GTAGS 数据库,可通过如下两种方式新建数据库:
- 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:
- 在 SpaceVim 内,使用快捷键 `SPC m g c` 来新建 GTAGS 数据库,
如果 GUN Global 不能直接支持当墙语言,可以选择 ctags 或者 pygments 作为生成数据库的后台工具。
- 在命令行,可以直接在项目根目录执行 gtags 命令。
```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:
对于 gtags 不直接支持的语言,并且未 GTAGSLABEL 环境变量,此时可以使用如下命令以达到同样效果:
```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:
如果你不使用 `ctags` 或者 `pygments`gtags 默认将只支持如下语言:
- asm
- c/c++
- java
- php
- yacc
- asm
- c/c++
- java
- php
- yacc
#### Exuberant ctags languages
#### 通过 exuberant ctags 支持的语言
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:
如果你启用了 `exuberant ctags`,并且使用其作为后台(i.e., GTAGSLABEL=ctags or gtagslabel=ctags),那么如下的语言将也得到支持:
- c#
- erlang
- javascript
- common-lisp
- emacs-lisp
- lua
- ocaml
- python
- ruby
- scheme
- vimscript
- windows-scripts (.bat .cmd files)
- c#
- erlang
- javascript
- common-lisp
- emacs-lisp
- lua
- ocaml
- python
- ruby
- scheme
- vimscript
- windows-scripts (.bat .cmd files)
#### Universal ctags languages
#### 通过 Universal ctags 支持的语言
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:
作为 `exuberant ctags` 的替代,如果你启用 `Universal ctags`,除了上述语言以外,将还可以支持如下语言:
- clojure
- d
- go
- rust
- clojure
- d
- go
- rust
#### Pygments languages (plus symbol and reference tags)
#### 通过 Pygments 支持的语言
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”.
为了查找更多语言 symbol 的引用,而不仅仅时内置的语言分析器,你需要使用 pygments 作为后端,当启用
pygments 后,可以通过 gtags 查询函数和变量的定义以及引用处。
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:
当 pygments 启用后,如下语言将得以支持:
- elixir
- fsharp
- haskell
- octave
- racket
- scala
- shell-scripts
- tex
- 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 |
| 按键 | 描述 |
| ----------- | -------------------------- |
| `SPC m g c` | 新建 tag 数据库 |
| `SPC m g u` | 手动更新 tag 数据库 |
| `SPC m g f` | 列出数据库中所涉及到的文件 |
| `SPC m g d` | 查找 definitions |
| `SPC m g r` | 查找 references |

39
docs/cn/layers/tools.md Normal file
View File

@ -0,0 +1,39 @@
---
title: "SpaceVim tools 模块"
description: "集成多种常用工具,包括日历、计算器、等等多种工具类插件,该模块针对 vim8 以及 neovim 提供了更好的插件选择。"
---
# [可用模块](../) >> tools
<!-- vim-markdown-toc GFM -->
- [模块介绍](#模块介绍)
- [启用模块](#启用模块)
- [Commands](#commands)
<!-- vim-markdown-toc -->
## 模块介绍
这一模块集成了多种工具类的 Vim 插件,这些插件都可用通过命令来调用,
并且这些插件的载入方式都是按需载入,只有首次执行相关命令时,
才会载入该插件。
## 启用模块
tools 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "tools"
```
## Commands
这里列出本模块加入的命令,如果需要查阅命令的详细介绍,可以执行 `:help 命令`
| 命令 | 描述 |
| ---------------- | ----------------------- |
| `:SourceCounter` | 项目代码统计 |
| `:MundoToggle` | 打开/关闭文件编辑历史树 |
| `:Cheat` | 查阅工具表 |

View File

@ -0,0 +1,35 @@
---
title: "SpaceVim tools#dash 模块"
description: "该模块提供对 Dash 支持,可快速查找光标位置的单词"
lang: cn
---
# [可用模块](../) >> tools#dash
<!-- vim-markdown-toc GFM -->
- [模块描述](#模块描述)
- [启用模块](#启用模块)
- [快捷键](#快捷键)
<!-- vim-markdown-toc -->
## 模块描述
该模块为 SpaceVim 提供了 Dash 集成
## 启用模块
tools#dash 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "tools#dash"
```
## 快捷键
| 按键 | 描述 |
| --------- | ------------------------ |
| `SPC D d` | 查询光标下单词 |
| `SPC D D` | 在所有文档中查询光标单词 |

View File

@ -1,23 +1,23 @@
---
title: "SpaceVim ui layer"
description: "Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and vim in both TUI and GUI"
title: "SpaceVim ui 模块"
description: "SpaceVim ui 模块提供了一个 IDE-like 的界面,包括状态栏、文件树、语法数等等特性。"
lang: cn
---
# [SpaceVim Layers:](https://spacevim.org/layers) ui
# [可用模块](../) >> 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.
SpaceVim ui 模块提供了一个 IDE-like 的界面,包括状态栏、文件树、语法数等等特性。
## Plugins
## 集成插件
- [mhinz/vim-startify](https://github.com/mhinz/vim-startify)
- [majutsushi/tagbar](https://github.com/majutsushi/tagbar)

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

@ -0,0 +1,38 @@
---
title: "SpaceVim unite 模块"
description: "提供以 unite 为核心的模糊查找机制,支持模糊搜索文件、历史纪录、函数列表等。"
lang: cn
---
# [可用模块](../) >> unite
## 模块介绍
这一模块在 unite 的基础上做了时当的包装和定制,提供了搜索文件、函数列表、
命令历史等等特性。
## 启用模块
unite 模块默认并为启用,如果需要启用该模块,需要在配置文件里面加入:
```toml
[[layers]]
name = "unite"
```
## 快捷键
下列快捷键均以 `<Leader> f` 为前置键,`<Leader>` 在 SpaceVim 中默认没有修改,
`\` 键。
| 按键 | 描述 |
| -------------------- | ------------------------------ |
| `<Leader> f <space>` | 模糊查找快捷键,并执行该快捷键 |
| `<Leader> f e` | 模糊搜索寄存器 |
| `<Leader> f h` | 模糊搜索 history/yank |
| `<Leader> f j` | 模糊搜索 jump, change |
| `<Leader> f l` | 模糊搜索 location list |
| `<Leader> f m` | 模糊搜索 output messages |
| `<Leader> f o` | 模糊搜索函数列表 |
| `<Leader> f q` | 模糊搜索 quickfix list |
| `<Leader> f r` | 重置上次搜索窗口 |

View File

@ -5,9 +5,9 @@ description: "SpaceVim is a community-driven vim distribution that seeks to prov
[![Gitter](https://badges.gitter.im/SpaceVim/SpaceVim.svg)](https://gitter.im/SpaceVim/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.8.0--dev-FF69B4.svg)](https://github.com/SpaceVim/SpaceVim)
[![Build status](https://ci.appveyor.com/api/projects/status/eh3t5oph70abp665/branch/dev?svg=true)](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/master)
[![codecov](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev/graph/badge.svg)](https://codecov.io/gh/SpaceVim/SpaceVim/branch/master)
[![Version](https://img.shields.io/badge/version-0.8.0--dev-FF69B4.svg)](https://github.com/SpaceVim/SpaceVim/releases)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE)
![welcome-page](https://user-images.githubusercontent.com/13142418/37595020-273b5bca-2bb2-11e8-8aba-638ed5f1c7ea.png)

View File

@ -1,5 +1,17 @@
# [Layers](https://spacevim.org/layers) > default
---
title: "SpaceVim default layer"
description: "SpaceVim default layer contains no plugins, but It provides some better default config for SpaceVim."
---
# [SpaceVim Layers:](../) default
## Intro
SpaceVim default layer contains none plugins, but it has some better default config for vim and neovim.
## Key Mappings
| Key binding | Description |
| ------------ | --------------------------- |
| `<Leader> y` | yank to system clipboard |
| `<Leader> p` | paste from system clipboard |

View File

@ -8,9 +8,7 @@ description: "This layers adds extensive support for git"
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Layer](#layer)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
@ -19,20 +17,24 @@ description: "This layers adds extensive support for git"
This layers adds extensive support for [git](http://git-scm.com/).
### Features
## Install
### Layer
To use this configuration layer, add following snippet to your custom configuration file.
To use this configuration layer, add `call SpaceVim#layers#load('git')` to your custom configuration file.
```toml
[[layers]]
name = "git"
```
## 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 |
| Key Binding | Description |
| ----------- | ---------------------- |
| `SPC g s` | view git status |
| `SPC g S` | stage current file |
| `SPC g U` | unstage current file |
| `SPC g c` | edit git commit |
| `SPC g p` | git push |
| `SPC g d` | view git diff |
| `SPC g A` | stage all files |
| `SPC g b` | open git blame windows |

View File

@ -22,7 +22,12 @@ This layer provide shell support in SpaceVim.
## Install
To use this configuration layer, add `SPLayer 'shell'` to your custom configuration file.
To use this configuration layer, add following snippet to your custom configuration file.
```toml
[[layers]]
name = "shell"
```
## Configuration
@ -39,15 +44,16 @@ 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.
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,
\ }
\ )
```toml
[[layers]]
name = "shell"
default_position = "top"
default_height = 30
```
## Key bindings