From 1cc77cffa9cd7a6b166c65f4ae24ceda8af50d82 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 17 Mar 2017 16:18:19 +0800 Subject: [PATCH] Add markdown style guide --- docs/README_zh_cn.md | 1 + docs/development/conventions.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/README_zh_cn.md b/docs/README_zh_cn.md index 89e2d9bb4..6938de343 100644 --- a/docs/README_zh_cn.md +++ b/docs/README_zh_cn.md @@ -1,5 +1,6 @@ --- title: "chinese totur" +redirect_from: "/README_zh_cn/" --- # SpaceVim 中文手册 diff --git a/docs/development/conventions.md b/docs/development/conventions.md index 317778085..4930c5090 100644 --- a/docs/development/conventions.md +++ b/docs/development/conventions.md @@ -6,7 +6,9 @@ permalink: "/conventions" # Conventions ## Content + - [viml coding style guild](#viml-coding-style-guide) +- [markdown style guide](#markdown-style-guide) ## Viml coding style guide ### Portability @@ -139,8 +141,12 @@ When using catch, match the error code rather than the error text. Use :setlocal and &l: instead of :set and & unless you have explicit reason to do otherwise. ### Style -Follow google style conventions. When in doubt, treat vimscript style like python style. + +Follow google style conventions. When in doubt, treat vimscript style like +python style. + #### Whitespace + **Similar to python.** - Use two spaces for indents @@ -156,7 +162,8 @@ command -range=% MyCommand You need not go out of your way to remove it. -Trailing whitespace is allowed in mappings which prep commands for user input, such as "noremap gf :grep -f ". +Trailing whitespace is allowed in mappings which prep commands for user input, +such as "noremap gf :grep -f ". - Restrict lines to 80 columns wide - Indent continued lines by four spaces @@ -220,8 +227,10 @@ Always prefix variables with their scope. - b: changes the variable semantics; use it when you want buffer-local semantics. - l: and v: should be used for consistency, future proofing, and to avoid subtle bugs. They are not strictly required. Add them in new code but don’t go out of your way to add them elsewhere. +## Markdown style guide ## Thanks: - link : https://google.github.io/styleguide/vimscriptguide.xml - link : https://google.github.io/styleguide/vimscriptfull.xml - link : https://github.com/noahfrederick/vim-scripting-style-guide/blob/master/doc/scripting-style.txt +- [google's markdown style guide](https://github.com/google/styleguide/blob/3591b2e540cbcb07423e02d20eee482165776603/docguide/style.md)