From 105ba4edb136e26a9b1ef369d09185b4f72f2d77 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Sat, 17 Oct 2020 12:28:34 +0800 Subject: [PATCH] Add enable_Indentline option for ui layer (#3909) --- .projections.json | 12 ++++++------ autoload/SpaceVim/layers/ui.vim | 5 +++++ docs/cn/layers/ui.md | 9 +-------- docs/layers/ui.md | 30 +----------------------------- 4 files changed, 13 insertions(+), 43 deletions(-) diff --git a/.projections.json b/.projections.json index a5f5bc301..0ffbf2af6 100644 --- a/.projections.json +++ b/.projections.json @@ -7,13 +7,13 @@ "test/plugin/a.vader": { "alternate": "autoload/SpaceVim/plugins/a.vim" }, "autoload/SpaceVim/layers/lang/*.vim": { "doc": "docs/layers/lang/{}.md" }, "test/api/*.vader": { "alternate": "autoload/SpaceVim/api/{}.vim" }, - "docs/layers/lang/*.md": { - "alternate": "docs/cn/layers/lang/{}.md", - "code": "autoload/SpaceVim/layers/lang/{}.vim" + "docs/layers/*.md": { + "alternate": "docs/cn/layers/{}.md", + "code": "autoload/SpaceVim/layers/{}.vim" }, - "docs/cn/layers/lang/*.md": { - "alternate": "docs/layers/lang/{}.md", - "code": "autoload/SpaceVim/layers/lang/{}.vim" + "docs/cn/layers/*.md": { + "alternate": "docs/layers/{}.md", + "code": "autoload/SpaceVim/layers/{}.vim" }, "docs/*.md": { "alternate": "docs/cn/{}.md" }, "docs/cn/*.md": { "alternate": "docs/{}.md" }, diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index a11eb1fd8..fb36db37e 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -13,6 +13,7 @@ if exists('s:enable_sidebar') else let s:enable_sidebar = 0 let s:enable_scrollbar = 0 + let s:enable_indentline = 1 endif function! SpaceVim#layers#ui#plugins() abort @@ -44,6 +45,7 @@ function! SpaceVim#layers#ui#config() abort let g:indentLine_char = get(g:, 'indentLine_char', '┊') let g:indentLine_concealcursor = 'niv' let g:indentLine_conceallevel = 2 + let g:indentLine_enabled = s:enable_indentline let g:indentLine_fileTypeExclude = ['help', 'man', 'startify', 'vimfiler', 'json'] let g:better_whitespace_filetypes_blacklist = ['diff', 'gitcommit', 'unite', \ 'qf', 'help', 'markdown', 'leaderGuide', @@ -426,6 +428,9 @@ function! SpaceVim#layers#ui#set_variable(var) abort let s:enable_scrollbar = get(a:var, \ 'enable_scrollbar', \ 0) + let s:enable_indentline = get(a:var, + \ 'enable_indentline', + \ 1) endfunction diff --git a/docs/cn/layers/ui.md b/docs/cn/layers/ui.md index bd88c9aea..e93189471 100644 --- a/docs/cn/layers/ui.md +++ b/docs/cn/layers/ui.md @@ -11,7 +11,6 @@ lang: zh - [模块描述](#模块描述) - [启用模块](#启用模块) - [模块选项](#模块选项) -- [集成插件](#集成插件) @@ -31,10 +30,4 @@ SpaceVim ui 模块提供了一个 IDE-like 的界面,包括状态栏、文件 ## 模块选项 - `enable_scrollbar`:启用/禁用悬浮滚动条,默认为禁用的,该功能需要 Neovim 的悬浮窗口支持。 - - -## 集成插件 - -- [mhinz/vim-startify](https://github.com/mhinz/vim-startify) -- [majutsushi/tagbar](https://github.com/majutsushi/tagbar) - +- `enable_indentline`: 启用/禁用对齐线,默认为启用的。 diff --git a/docs/layers/ui.md b/docs/layers/ui.md index 3f2ed2ee4..8691f1fbc 100644 --- a/docs/layers/ui.md +++ b/docs/layers/ui.md @@ -10,8 +10,6 @@ description: "Awesome UI layer for SpaceVim, provide IDE-like UI for neovim and - [Description](#description) - [Install](#install) - [Layer Options](#layer-options) -- [Plugins](#plugins) -- [Tips](#tips) @@ -32,30 +30,4 @@ To use this configuration layer, update custom configuration file with: - `enable_scrollbar`: Enable/disable floating scrollbar of current buffer. Disabled by default. This feature requires neovim's floating window. - - - - -## Plugins - -- [startify](https://github.com/mhinz/vim-startify): welcome page, default key binding is `SPC a s`. -- [tagbar](https://github.com/majutsushi/tagbar): outline sidebar, default key binding is ``. -- [indentLine](https://github.com/Yggdroot/indentLine): code indent line, toggle key binding is `SPC t i`. - -## Tips - -SpaceVim provide default statusline and tabline plugin which are provided by `core#statusline` and `core#tabline` layer, If you want to use airline, just disable that layer: - -```toml -[[layers]] - name = "core#statusline" - enable = false -``` - -Use sidebar to manager file tree and outline: - -```toml -[[layers]] - name = "ui" - enable_sidebar = true -``` +- `enable_indentline`: Enable/disable indentline of current buffer. Enabled by default.