1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:40:05 +08:00
SpaceVim/docs/layers/lang/markdown.md

62 lines
1.7 KiB
Markdown
Raw Normal View History

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