From 0f2a73df99a8e4d75d2ff4fb36c7645469065ae0 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Thu, 13 Jan 2022 19:23:34 +0800 Subject: [PATCH] feat(org): improve lang#org layer --- autoload/SpaceVim/layers/lang/org.vim | 15 +++++++++++++ autoload/SpaceVim/layers/org.vim | 6 +----- docs/cn/layers.md | 21 ++++++++++++++---- docs/cn/layers/lang/org.md | 31 +++++++++++++++++++++++++++ docs/layers.md | 24 ++++++++------------- docs/layers/lang/org.md | 29 +++++++++++++++++++++++++ 6 files changed, 102 insertions(+), 24 deletions(-) create mode 100644 autoload/SpaceVim/layers/lang/org.vim create mode 100644 docs/cn/layers/lang/org.md create mode 100644 docs/layers/lang/org.md diff --git a/autoload/SpaceVim/layers/lang/org.vim b/autoload/SpaceVim/layers/lang/org.vim new file mode 100644 index 000000000..9008ab010 --- /dev/null +++ b/autoload/SpaceVim/layers/lang/org.vim @@ -0,0 +1,15 @@ +"============================================================================= +" org.vim --- lang#org for SpaceVim +" Copyright (c) 2016-2020 Wang Shidong & Contributors +" Author: Wang Shidong < wsdjeg at 163.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + + +function! SpaceVim#layers#lang#org#plugins() abort + let plugins = [] + call add(plugins, ['SpaceVim/org-mode', {'merged' : 0}]) + return plugins +endfunction + diff --git a/autoload/SpaceVim/layers/org.vim b/autoload/SpaceVim/layers/org.vim index a96362abb..3cb89b886 100644 --- a/autoload/SpaceVim/layers/org.vim +++ b/autoload/SpaceVim/layers/org.vim @@ -1,6 +1,4 @@ "============================================================================= -" org.vim --- org layer for SpaceVim -" Copyright (c) 2016-2021 Wang Shidong & Contributors " Author: Wang Shidong < wsdjeg at 163.com > " URL: https://spacevim.org " License: GPLv3 @@ -8,9 +6,7 @@ function! SpaceVim#layers#org#plugins() abort - let plugins = [] - call add(plugins, ['SpaceVim/org-mode', {'merged' : 0}]) - return plugins + return SpaceVim#layers#lang#org#plugins() endfunction function! SpaceVim#layers#org#config() abort diff --git a/docs/cn/layers.md b/docs/cn/layers.md index e5519a55f..3516a577e 100644 --- a/docs/cn/layers.md +++ b/docs/cn/layers.md @@ -20,17 +20,29 @@ lang: zh SpaceVim 是一个社区驱动的 Vim 配置集合,通常一个 Vim 的配置集合包含了诸多的 Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管理这些插件以及相关 -的配置。默认情况下,这些模块都是禁用的,用户可以根据自己需要或是项目需要 +的配置。默认情况下,大部分模块都是禁用的,用户可以根据自己需要或是项目需要 来载入指定的模块以获取相关功能。 通过模块的方式管理插件和相关配置,为使用者节省了大量的搜索插件和调试插件的时 -间。用户仅仅需要根据自己的实际需求,来启用相关模块。比如,当我需要频繁调用终 -端时,可以启用终端支持的 `shell` 模块。 +间。用户仅仅需要根据自己的实际需求,来启用相关模块。比如,当需要做 python +开发时,启用 [`lang#python`](lang/python/) 模块. + +默认已启用的模块: + +- [autocomplete](autocomplete/) +- [checkers](checkers/) +- [format](format/) +- [edit](edit/) +- [ui](ui/) +- [core](core/) +- [core#banner](core/banner/) +- [core#statusline](core/statusline/) +- [core#tabline](core/tabline/) ### 启用模块 以 `shell` 模块为例,启用该模块,并且通过设定一些模块选项,指定终端打开位置为 -顶部,高度 30。 +顶部,高度 30,使用快捷键 `SPC f v d` 打开配置文件,加入: ```toml [[layers]] @@ -133,6 +145,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管 | [lang#moonscript](lang/moonscript/) | 这一模块为 moonscript 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#nim](lang/nim/) | 该模块为 SpaceVim 提供 Nim 开发支持,包括语法高亮、代码补全、编译运行以及交互式编程等功能。 | | [lang#ocaml](lang/ocaml/) | 这一模块为 OCaml 开发提供了支持,包括语法高亮、代码补全、以及定义处跳转等功能。 | +| [lang#org](lang/org/) | 这一模块为 SpaceVim 提供了 org 的编辑支持,包括格式化、自动生成文章目录、代码块等特性。 | | [lang#pact](lang/pact/) | 这一模块为 pact 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#pascal](lang/pascal/) | 这一模块为 pascal 开发提供支持,包括一键运行等特性。 | | [lang#perl](lang/perl/) | 这一模块为 Perl 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 | diff --git a/docs/cn/layers/lang/org.md b/docs/cn/layers/lang/org.md new file mode 100644 index 000000000..9042026ae --- /dev/null +++ b/docs/cn/layers/lang/org.md @@ -0,0 +1,31 @@ +--- +title: "SpaceVim lang#org layer" +description: "这一模块为 SpaceVim 提供了 org 的编辑支持,包括格式化、自动生成文章目录、代码块等特性。" +lang: zh +--- + +# [Available Layers](../../) >> lang#org + +![org](https://user-images.githubusercontent.com/13142418/92319337-7554ec00-f049-11ea-90fb-ad663dceea12.png) + + + +- [模块简介](#模块简介) +- [启用模块](#启用模块) + + + +## 模块简介 + +这一模块为 SpaceVim 提供了 org 的编辑支持,包括格式化、自动生成文章目录、代码块等特性。 + +## 启用模块 + +可通过在配置文件内加入如下配置来启用该模块: + +```toml +[[layers]] + name = "lang#org" +``` + + diff --git a/docs/layers.md b/docs/layers.md index 83542b9d6..60c94952f 100644 --- a/docs/layers.md +++ b/docs/layers.md @@ -26,15 +26,15 @@ keeping them from having to think about what packages to install. By default SpaceVim enables these layers: -- `autocomplete` -- `checkers` -- `format` -- `edit` -- `ui` -- `core` -- `core#banner` -- `core#statusline` -- `core#tabline` +- [autocomplete](autocomplete/) +- [checkers](checkers/) +- [format](format/) +- [edit](edit/) +- [ui](ui/) +- [core](core/) +- [core#banner](core/banner/) +- [core#statusline](core/statusline/) +- [core#tabline](core/tabline/) To enable a specific layer you need to edit SpaceVim's custom configuration files. The key binding for opening the configuration files is `SPC f v d`. @@ -85,8 +85,6 @@ Some layers are enabled by default. The following example shows how to disable ` | [floobits](floobits/) | This layer adds support for the peer programming tool floobits to SpaceVim. | | [foldsearch](foldsearch/) | This layer provides functions that fold away lines that don't match a specific search pattern. | | [format](format/) | Code formatting layer for SpaceVim, includes a variety of formatters for many filetypes | -| [fzf](fzf/) | This layer provides a heavily customized fzf centric workflow | -| [git](git/) | This layer adds extensive support for git | | [github](github/) | This layer provides GitHub integration for SpaceVim | | [gtags](gtags/) | This layer provides gtags manager for project | | [japanese](japanese/) | Layer for japanese users, includes japanese docs and runtime messages | @@ -145,10 +143,6 @@ Some layers are enabled by default. The following example shows how to disable ` | [lang#moonscript](lang/moonscript/) | This layer is for moonscript development, provides syntax checking, code runner and repl support for moonscript files. | | [lang#nim](lang/nim/) | This layer adds Nim language support to SpaceVim | | [lang#nix](lang/nix/) | This layer adds Nix language support to SpaceVim. | -| [lang#ocaml](lang/ocaml/) | This layer is for OCaml development, provides autocompletion, syntax checking, and code formatting for OCaml files. | -| [lang#pact](lang/pact/) | This layer is for pact development, provides syntax checking, code runner and repl support for pact files. | -| [lang#pascal](lang/pascal/) | This layer is for pascal development, provides syntax highlighting, and code runner for pascal files. | -| [lang#perl](lang/perl/) | This layer is for Perl development, provides autocompletion, syntax checking, and code formatting for Perl files. | | [lang#php](lang/php/) | PHP language support, including code completion, syntax lint and code runner | | [lang#plantuml](lang/plantuml/) | This layer is for PlantUML development, provides syntax highlighting for PlantUML files. | | [lang#pony](lang/pony/) | This layer is for pony development, provides syntax checking, code runner and repl support for pony files. | diff --git a/docs/layers/lang/org.md b/docs/layers/lang/org.md new file mode 100644 index 000000000..29e3e6b3d --- /dev/null +++ b/docs/layers/lang/org.md @@ -0,0 +1,29 @@ +--- +title: "SpaceVim lang#org layer" +description: "Edit org file within vim, autopreview org in the default browser, with this layer you can also format org file." +--- + +# [Available Layers](../../) >> lang#org + +![org](https://user-images.githubusercontent.com/13142418/92319337-7554ec00-f049-11ea-90fb-ad663dceea12.png) + + + +- [Description](#description) +- [Install](#install) + + + +## Description + +This layer is for editing org file. Including syntax highlighting, indent and syntax lint. + +## Install + +To use this configuration layer, update custom configuration file with: + +```toml +[[layers]] + name = "lang#org" +``` +