1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 02:40:05 +08:00

Update markdown layer

This commit is contained in:
wsdjeg 2017-09-03 23:38:24 +00:00
parent f3c114951c
commit 416e18a2d7
3 changed files with 213 additions and 167 deletions

View File

@ -1,3 +1,17 @@
"=============================================================================
" markdown.vim --- lang#markdown layer for SpaceVim
" Copyright (c) 2016-2017 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
let s:md_listItemIndent = 1
let s:md_enableWcwidth = 0
function! SpaceVim#layers#lang#markdown#set_variable(var) abort
let s:md_listItemIndent
endfunction
function! SpaceVim#layers#lang#markdown#plugins() abort
let plugins = []
call add(plugins, ['tpope/vim-markdown',{ 'on_ft' : 'markdown'}])
@ -30,7 +44,7 @@ function! SpaceVim#layers#lang#markdown#config() abort
let g:neoformat_enabled_markdown = ['remark']
let g:neoformat_markdown_remark = {
\ 'exe': 'remark',
\ 'args': ['--no-color', '--silent', '--use', 'remark-frontmatter', "-s '\"listItemIndent\": \"1\"'"],
\ 'args': ['--no-color', '--silent'] + (empty(remarkrc) ? [] : ['-r', remarkrc]),
\ 'stdin': 1,
\ }
endfunction
@ -45,5 +59,24 @@ function! s:mappings() abort
endfunction
function! s:generate_remarkrc() abort
return ''
let conf = [
\ 'module.exports = {',
\ ' settings: {',
\ ]
" TODO add settings
call add(conf, " listItemIndent: '" . s:md_listItemIndent . "'")
if s:md_enableWcwidth
call add(conf, " stringLength: require('wcwidth'),")
endif
call add(conf, ' },')
call add(conf, ' plugins: [')
" TODO add plugins
call add(conf, " require('remark-frontmatter'),")
call add(conf, ' ]')
call add(conf, '};')
let f = tempname()
call writefile(conf, f)
return f
endfunction

View File

@ -267,7 +267,7 @@ SpaceVim 所有的快捷键都不需要去记忆,有强大的快捷键导航
这一导航提示将所有以空格为前缀的快捷键分组展示,比如 `b` 是所以 buffer 相关的快捷键, `p` 是所有工程管理相关的快捷键。在导航模式下按下 `<C-h>` 你将在状态栏上看见相应的帮助信息,按键介绍如下:
| 按键 | 描述 |
| --- | ------- |
| ---- | -------------- |
| `u` | 撤销前一按键 |
| `n` | 导航系统下一页 |
| `p` | 导航系统前一页 |
@ -423,7 +423,7 @@ let g:spacevim_colorscheme_bg = 'dark'
```
| 快捷键 | 描述 |
| ------------------ | ------------- |
| ------------------ | -------------------- |
| <kbd>SPC T n</kbd> | 切换至下一个随机主题 |
| <kbd>SPC T s</kbd> | 通过 Unite 选择主题 |
@ -448,7 +448,7 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
大多数界面元素可以通过快捷键来隐藏或者显示(这一组快捷键以 `t``T` 开头):
| 快捷键 | 描述 |
| ----------- | ------------------------ |
| ----------- | ----------------------------------- |
| `SPC t 8` | 高亮所有超过80列的字符 |
| `SPC t f` | 高亮临界列默认是第80列 |
| `SPC t h h` | 高亮当前行 |
@ -479,7 +479,7 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
- 展示搜索结果序号
| 快捷键 | 描述 |
| ----------- | --------- |
| ----------- | ------------------ |
| `SPC [1-9]` | 跳至制定序号的窗口 |
##### 状态栏
@ -496,7 +496,7 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
默认主题 gruvbox 的状态栏颜色和模式对照表:
| 模式 | 颜色 |
| ------- | --- |
| ------- | ------ |
| Normal | 灰色 |
| Insert | 蓝色 |
| Visual | 橙色 |
@ -545,7 +545,7 @@ _acpi_ 可展示电池电量剩余百分比.
使用不同颜色展示不同的电池状态:
| 电池状态 | 颜色 |
| ---------- | --- |
| ---------- | ---- |
| 75% - 100% | 绿色 |
| 30% - 75% | 黄色 |
| 0 - 30% | 红色 |
@ -577,7 +577,7 @@ SpaceVim 所支持的分割符以及截图如下:
状态栏中功能模块内的字符显示与否,同如下快捷键功能保持一致:
| 快捷键 | Unicode | ASCII | 功能 |
| --------- | ------- | ----- | --------- |
| --------- | ------- | ----- | ---------------- |
| `SPC t 8` | ⑧ | 8 | 高亮80列之后信息 |
| `SPC t f` | ⓕ | f | 高亮第80列 |
| `SPC t s` | ⓢ | s | 语法检查 |
@ -589,7 +589,7 @@ SpaceVim 所支持的分割符以及截图如下:
如果只有一个Tab, Buffers 将被罗列在标签栏上,每一个包含:序号、文件类型图标、文件名。如果有不止一个 Tab, 那么所有 Tab 将被罗列在标签栏上。标签栏上每一个 Tab 或者 Baffer 可通过快捷键 `<Leader> number` 进行快速访问,默认的 `<Leader>``\`
| 快捷键 | 描述 |
| ------------ | --------- |
| ------------ | ---------------- |
| `<Leader> 1` | 跳至标签栏序号 1 |
| `<Leader> 2` | 跳至标签栏序号 2 |
| `<Leader> 3` | 跳至标签栏序号 3 |
@ -611,7 +611,7 @@ SpaceVim 所支持的分割符以及截图如下:
##### Unite/Denite buffer 中的快捷键
| 快捷键 | 模式 | 功能描述 |
| ---------------- | ------------- | --------------- |
| ---------------- | ------------- | ---------------------- |
| `Ctrl`+`h/k/l/r` | Normal | 无效 |
| `Ctrl`+`l` | Normal | 刷新界面 |
| `Tab` | Insert | 下一结果 |
@ -639,7 +639,7 @@ SpaceVim 所支持的分割符以及截图如下:
这些前缀的按键为:
| 前缀名称 | 用户选项以及默认值 | 描述 |
| ---------- | ----------------------------------------------------------------------------- | ---------------------- |
| ---------- | ---------------------------------------------------------------------------------- | --------------------------- |
| `[SPC]` | 空格键 | SpaceVim 默认前缀键 |
| `[Window]` | `g:spacevim_windows_leader` / `s` | SpaceVim 默认窗口前缀键 |
| `[denite]` | `g:spacevim_denite_leader` / `F` | SpaceVim 默认 Denite 前缀键 |
@ -2125,7 +2125,7 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
### SpaceVim选项
| 选项名称 | 默认值 | 描述 |
| ---------------------------------- | :-----------------: | --------------- |
| ---------------------------------- | :-----------------: | ------------------------------ |
| `g:spacevim_default_indent` | 2 | 对齐空格 |
| `g:spacevim_enable_guicolors` | 1 | 启用/禁用终端使用真色彩 |
| `g:spacevim_windows_leader` | `s` | 窗口管理快捷键前缀 |

View File

@ -5,9 +5,11 @@ title: "SpaceVim lang#markdown layer"
# [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 -->
@ -30,6 +32,17 @@ 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).
**enableWcwidth**
Enable/Disable wcwidth for detecting the length of a table cell
## Key bindings
| Key | mode | description |