mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
@ -26,7 +26,6 @@ before_script: |
|
||||
fi
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
curl https://bootstrap.pypa.io/get-pip.py | sudo python
|
||||
sudo -H easy_install pip
|
||||
fi
|
||||
sudo -H pip install virtualenv
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
Syntax highlighting, matching rules and mappings for [the original Markdown](http://daringfireball.net/projects/markdown/) and extensions.
|
||||
|
||||
1. [Installation](#installation)
|
||||
1. [Basic usage](#basic-usage)
|
||||
1. [Options](#options)
|
||||
1. [Mappings](#mappings)
|
||||
1. [Commands](#commands)
|
||||
@ -52,6 +53,37 @@ cd ~/.vim
|
||||
tar --strip=1 -zxf vim-markdown-master.tar.gz
|
||||
```
|
||||
|
||||
## Basic usage
|
||||
|
||||
### Folding
|
||||
|
||||
Folding is enabled for headers by default.
|
||||
|
||||
The following commands are useful to open and close folds:
|
||||
|
||||
- `zr`: reduces fold level throughout the buffer
|
||||
- `zR`: opens all folds
|
||||
- `zm`: increases fold level throughout the buffer
|
||||
- `zM`: folds everything all the way
|
||||
- `za`: open a fold your cursor is on
|
||||
- `zA`: open a fold your cursor is on recursively
|
||||
- `zc`: close a fold your cursor is on
|
||||
- `zC`: close a fold your cursor is on recursively
|
||||
|
||||
[Options](#options) are available to disable folding or change folding style.
|
||||
|
||||
Try `:help fold-expr` and `:help fold-commands` for details.
|
||||
|
||||
### Concealing
|
||||
|
||||
Concealing is set for some syntax such as bold, italic, code block and link.
|
||||
|
||||
Concealing lets you conceal text with other text. The actual source text is not modified. If you put your cursor on the concealed line, the conceal goes away.
|
||||
|
||||
[Options](#options) are available to disable or change concealing.
|
||||
|
||||
Try `:help concealcursor` and `:help conceallevel` for details.
|
||||
|
||||
## Options
|
||||
|
||||
### Disable Folding
|
||||
@ -293,6 +325,30 @@ If you would like to use a file extension other than `.md` you may do so using t
|
||||
let g:vim_markdown_auto_extension_ext = 'txt'
|
||||
```
|
||||
|
||||
### Do not automatically insert bulletpoints
|
||||
|
||||
Automatically inserting bulletpoints can lead to problems when wrapping text
|
||||
(see issue #232 for details), so it can be disabled:
|
||||
|
||||
```vim
|
||||
let g:vim_markdown_auto_insert_bullets = 0
|
||||
```
|
||||
|
||||
In that case, you probably also want to set the new list item indent to 0 as
|
||||
well, or you will have to remove an indent each time you add a new list item:
|
||||
|
||||
```vim
|
||||
let g:vim_markdown_new_list_item_indent = 0
|
||||
```
|
||||
|
||||
### Change how to open new files
|
||||
|
||||
By default when following a link the target file will be opened in your current buffer. This behavior can change if you prefer using splits or tabs by using the `vim_markdown_edit_url_in` variable. Possible values are `tab`, `vsplit`, `hsplit`, `current` opening in a new tab, vertical split, horizontal split, and current buffer respectively. Defaults to current buffer if not set:
|
||||
|
||||
```vim
|
||||
let g:vim_markdown_edit_url_in = 'tab'
|
||||
```
|
||||
|
||||
## Mappings
|
||||
|
||||
The following work on normal and visual modes:
|
||||
|
@ -5,7 +5,10 @@ Contents ~
|
||||
|
||||
1. Introduction |vim-markdown-introduction|
|
||||
2. Installation |vim-markdown-installation|
|
||||
3. Options |vim-markdown-options|
|
||||
3. Basic usage |vim-markdown-basic-usage|
|
||||
1. Folding |vim-markdown-folding|
|
||||
2. Concealing |vim-markdown-concealing|
|
||||
4. Options |vim-markdown-options|
|
||||
1. Disable Folding |vim-markdown-disable-folding|
|
||||
2. Change fold style |vim-markdown-change-fold-style|
|
||||
3. Set header folding level |vim-markdown-set-header-folding-level|
|
||||
@ -26,12 +29,16 @@ Contents ~
|
||||
|vim-markdown-do-not-require-.md-extensions-for-markdown-links|
|
||||
13. Auto-write when following link
|
||||
|vim-markdown-auto-write-when-following-link|
|
||||
14. Change default file extension |vim-markdown-auto-extension-ext|
|
||||
4. Mappings |vim-markdown-mappings|
|
||||
5. Commands |vim-markdown-commands|
|
||||
6. Credits |vim-markdown-credits|
|
||||
7. License |vim-markdown-license|
|
||||
8. References |vim-markdown-references|
|
||||
14. Change default file extension
|
||||
|vim-markdown-change-default-file-extension|
|
||||
15. Do not automatically insert bulletpoints
|
||||
|vim-markdown-do-not-automatically-insert-bulletpoints|
|
||||
16. Change how to open new files |vim-markdown-change-how-to-open-new-files|
|
||||
5. Mappings |vim-markdown-mappings|
|
||||
6. Commands |vim-markdown-commands|
|
||||
7. Credits |vim-markdown-credits|
|
||||
8. License |vim-markdown-license|
|
||||
9. References |vim-markdown-references|
|
||||
|
||||
===============================================================================
|
||||
*vim-markdown-introduction*
|
||||
@ -73,6 +80,52 @@ If you are not using any package manager, download the tarball [5] and do this:
|
||||
cd ~/.vim
|
||||
tar --strip=1 -zxf vim-markdown-master.tar.gz
|
||||
<
|
||||
===============================================================================
|
||||
*vim-markdown-basic-usage*
|
||||
Basic usage ~
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-folding*
|
||||
Folding ~
|
||||
|
||||
Folding is enabled for headers by default.
|
||||
|
||||
The following commands are useful to open and close folds:
|
||||
|
||||
*vim-markdown-zr*
|
||||
- 'zr': reduces fold level throughout the buffer
|
||||
*vim-markdown-zR*
|
||||
- 'zR': opens all folds
|
||||
*vim-markdown-zm*
|
||||
- 'zm': increases fold level throughout the buffer
|
||||
*vim-markdown-zM*
|
||||
- 'zM': folds everything all the way
|
||||
*vim-markdown-za*
|
||||
- 'za': open a fold your cursor is on
|
||||
*vim-markdown-zA*
|
||||
- 'zA': open a fold your cursor is on recursively
|
||||
*vim-markdown-zc*
|
||||
- 'zc': close a fold your cursor is on
|
||||
*vim-markdown-zC*
|
||||
- 'zC': close a fold your cursor is on recursively
|
||||
|
||||
Options are available to disable folding or change folding style.
|
||||
|
||||
Try ':help fold-expr' and ':help fold-commands' for details.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-concealing*
|
||||
Concealing ~
|
||||
|
||||
Concealing is set for some syntax such as bold, italic, code block and link.
|
||||
|
||||
Concealing lets you conceal text with other text. The actual source text is not
|
||||
modified. If you put your cursor on the concealed line, the conceal goes away.
|
||||
|
||||
Options are available to disable or change concealing.
|
||||
|
||||
Try ':help concealcursor' and ':help conceallevel' for details.
|
||||
|
||||
===============================================================================
|
||||
*vim-markdown-options*
|
||||
Options ~
|
||||
@ -144,7 +197,7 @@ never increases its default size (half screen), it only shrinks.
|
||||
Text emphasis restriction to single-lines ~
|
||||
|
||||
By default text emphasis works across multiple lines until a closing token is
|
||||
found. However, it's possible to restrict text emphasis to a single line (ie,
|
||||
found. However, it's possible to restrict text emphasis to a single line (i.e.,
|
||||
for it to be applied a closing token must be found on the same line). To do so:
|
||||
>
|
||||
let g:vim_markdown_emphasis_multiline = 0
|
||||
@ -197,9 +250,9 @@ Default is "['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini']".
|
||||
*vim-markdown-follow-named-anchors*
|
||||
Follow named anchors ~
|
||||
|
||||
This feature allows ge to follow named anchors in links of the form
|
||||
'file#anchor' or just '#anchor', where file may omit the '.md' extension as
|
||||
usual. Two variables control its operation:
|
||||
This feature allows the 'ge' command to follow named anchors in links of the
|
||||
form 'file#anchor' or just '#anchor', where file may omit the '.md' extension
|
||||
as usual. Two variables control its operation:
|
||||
>
|
||||
let g:vim_markdown_follow_anchor = 1
|
||||
<
|
||||
@ -311,7 +364,7 @@ this option will automatically save any edits you made before moving you:
|
||||
let g:vim_markdown_autowrite = 1
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-auto-extension-ext*
|
||||
*vim-markdown-change-default-file-extension*
|
||||
Change default file extension ~
|
||||
|
||||
If you would like to use a file extension other than '.md' you may do so using
|
||||
@ -319,6 +372,32 @@ the 'vim_markdown_auto_extension_ext' variable:
|
||||
>
|
||||
let g:vim_markdown_auto_extension_ext = 'txt'
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-do-not-automatically-insert-bulletpoints*
|
||||
Do not automatically insert bulletpoints ~
|
||||
|
||||
Automatically inserting bulletpoints can lead to problems when wrapping text
|
||||
(see issue #232 for details), so it can be disabled:
|
||||
>
|
||||
let g:vim_markdown_auto_insert_bullets = 0
|
||||
<
|
||||
In that case, you probably also want to set the new list item indent to 0 as
|
||||
well, or you will have to remove an indent each time you add a new list item:
|
||||
>
|
||||
let g:vim_markdown_new_list_item_indent = 0
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*vim-markdown-change-how-to-open-new-files*
|
||||
Change how to open new files ~
|
||||
|
||||
By default when following a link the target file will be opened in your current
|
||||
buffer. This behavior can change if you prefer using splits or tabs by using
|
||||
the 'vim_markdown_edit_url_in' variable. Possible values are 'tab', 'vsplit',
|
||||
'hsplit', 'current' opening in a new tab, vertical split, horizontal split, and
|
||||
current buffer respectively. Defaults to current buffer if not set:
|
||||
>
|
||||
let g:vim_markdown_edit_url_in = 'tab'
|
||||
<
|
||||
===============================================================================
|
||||
*vim-markdown-mappings*
|
||||
Mappings ~
|
||||
|
@ -609,7 +609,23 @@ if !exists('*s:EditUrlUnderCursor')
|
||||
endif
|
||||
endif
|
||||
let l:url = fnameescape(fnamemodify(expand('%:h').'/'.l:url.l:ext, ':.'))
|
||||
execute 'edit' l:url
|
||||
let l:editmethod = ''
|
||||
" determine how to open the linked file (split, tab, etc)
|
||||
if exists('g:vim_markdown_edit_url_in')
|
||||
if g:vim_markdown_edit_url_in == 'tab'
|
||||
let l:editmethod = 'tabnew'
|
||||
elseif g:vim_markdown_edit_url_in == 'vsplit'
|
||||
let l:editmethod = 'vsp'
|
||||
elseif g:vim_markdown_edit_url_in == 'hsplit'
|
||||
let l:editmethod = 'sp'
|
||||
else
|
||||
let l:editmethod = 'edit'
|
||||
endif
|
||||
else
|
||||
" default to current buffer
|
||||
let l:editmethod = 'edit'
|
||||
endif
|
||||
execute l:editmethod l:url
|
||||
endif
|
||||
if l:anchor != ''
|
||||
silent! execute '/'.l:anchor
|
||||
|
@ -5,15 +5,15 @@ setlocal indentexpr=GetMarkdownIndent()
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
|
||||
" Automatically insert bullets
|
||||
setlocal formatoptions+=r
|
||||
" Do not automatically insert bullets when auto-wrapping with text-width
|
||||
setlocal formatoptions-=c
|
||||
" Accept various markers as bullets
|
||||
setlocal comments=b:*,b:+,b:-
|
||||
|
||||
" Automatically continue blockquote on line break
|
||||
setlocal comments+=b:>
|
||||
setlocal formatoptions+=r
|
||||
setlocal comments=b:>
|
||||
if get(g:, "vim_markdown_auto_insert_bullets", 1)
|
||||
" Do not automatically insert bullets when auto-wrapping with text-width
|
||||
setlocal formatoptions-=c
|
||||
" Accept various markers as bullets
|
||||
setlocal comments+=b:*,b:+,b:-
|
||||
endif
|
||||
|
||||
" Only define the function once
|
||||
if exists("*GetMarkdownIndent") | finish | endif
|
||||
|
@ -82,25 +82,25 @@ syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
|
||||
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained
|
||||
|
||||
"HTML headings
|
||||
syn region htmlH1 start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH2 start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH3 start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH4 start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH5 start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH6 start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH1 matchgroup=mkdHeading start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH2 matchgroup=mkdHeading start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH3 matchgroup=mkdHeading start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH4 matchgroup=mkdHeading start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH5 matchgroup=mkdHeading start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn region htmlH6 matchgroup=mkdHeading start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn match htmlH1 /^.\+\n=\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
||||
syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
||||
|
||||
"define Markdown groups
|
||||
syn match mkdLineBreak / \+$/
|
||||
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
||||
syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
|
||||
syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
|
||||
syn region mkdCode start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/
|
||||
syn region mkdCode start=/\s*\~\~[^\~]*/ end=/[^\~]*\~\~\s*/
|
||||
syn region mkdCode start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/
|
||||
syn region mkdCode start="<pre[^>]*\\\@<!>" end="</pre>"
|
||||
syn region mkdCode start="<code[^>]*\\\@<!>" end="</code>"
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre[^>]*\\\@<!>" end="</pre>"' . s:concealends
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>" end="</code>"' . s:concealends
|
||||
syn region mkdFootnote start="\[^" end="\]"
|
||||
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
||||
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
||||
@ -115,7 +115,7 @@ syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/
|
||||
" YAML frontmatter
|
||||
if get(g:, 'vim_markdown_frontmatter', 0)
|
||||
syn include @yamlTop syntax/yaml.vim
|
||||
syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend
|
||||
syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^\(---\|...\)$" contains=@yamlTop keepend
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
|
||||
@ -150,6 +150,7 @@ syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,
|
||||
"highlighting for Markdown groups
|
||||
HtmlHiLink mkdString String
|
||||
HtmlHiLink mkdCode String
|
||||
HtmlHiLink mkdCodeDelimiter String
|
||||
HtmlHiLink mkdCodeStart String
|
||||
HtmlHiLink mkdCodeEnd String
|
||||
HtmlHiLink mkdFootnote Comment
|
||||
|
@ -1139,19 +1139,19 @@ Given markdown;
|
||||
###### h6
|
||||
|
||||
Execute (atx headers):
|
||||
AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
|
||||
AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
|
||||
AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
|
||||
AssertEqual SyntaxOf('#### h4'), 'htmlH4'
|
||||
AssertEqual SyntaxOf('##### h5'), 'htmlH5'
|
||||
AssertEqual SyntaxOf('###### h6'), 'htmlH6'
|
||||
AssertEqual SyntaxOf(' h1 space'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('h1 nospace'), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' h1 2 spaces'), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' h1 trailing hash '), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' h2 space'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('h2 nospace'), 'htmlH2'
|
||||
AssertEqual SyntaxOf(' h2 trailing hash '), 'htmlH2'
|
||||
AssertEqual SyntaxOf(' h3 space'), 'htmlH3'
|
||||
AssertEqual SyntaxOf('h3 nospace'), 'htmlH3'
|
||||
AssertEqual SyntaxOf(' h3 trailing hash '), 'htmlH3'
|
||||
AssertEqual SyntaxOf(' h4'), 'htmlH4'
|
||||
AssertEqual SyntaxOf(' h5'), 'htmlH5'
|
||||
AssertEqual SyntaxOf(' h6'), 'htmlH6'
|
||||
|
||||
Given markdown;
|
||||
# h1 before h2
|
||||
@ -1161,9 +1161,9 @@ Given markdown;
|
||||
# h1 after h2
|
||||
|
||||
Execute (atx headers relative positions):
|
||||
AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' h1 before h2'), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' h2 between h1s'), 'htmlH2'
|
||||
AssertEqual SyntaxOf(' h1 after h2'), 'htmlH1'
|
||||
|
||||
Given markdown;
|
||||
setex h1
|
||||
@ -1214,9 +1214,9 @@ setex h2
|
||||
Execute (mixed atx and setex headers):
|
||||
AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('==================='), 'htmlH1'
|
||||
AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
|
||||
AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
|
||||
AssertEqual SyntaxOf(' atx h2'), 'htmlH2'
|
||||
AssertEqual SyntaxOf(' atx h3'), 'htmlH3'
|
||||
AssertEqual SyntaxOf(' atx h1'), 'htmlH1'
|
||||
AssertEqual SyntaxOf('setex h2'), 'htmlH2'
|
||||
AssertEqual SyntaxOf('------------------'), 'htmlH2'
|
||||
|
||||
|
Reference in New Issue
Block a user