From: Yue Xin Date: Sun, 16 Aug 2015 11:50:10 +0000 (+0800) Subject: swap out mkd, successfully... X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/ef44c9e7fc839bec7bb17f8264442912f38c903c?ds=sidebyside;hp=-c swap out mkd, successfully... Signed-off-by: yuexin --- ef44c9e7fc839bec7bb17f8264442912f38c903c diff --git a/Makefile b/Makefile index a39492a..d929849 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,12 @@ all: install: mkdir -pv ${ADDONS}/ftdetect - cp -v ftdetect/mkd.vim ${ADDONS}/ftdetect/mkd.vim + cp -v ftdetect/markdown.vim ${ADDONS}/ftdetect/markdown.vim mkdir -pv ${ADDONS}/ftplugin - cp -v ftplugin/mkd.vim ${ADDONS}/ftplugin/mkd.vim + cp -v ftplugin/markdown.vim ${ADDONS}/ftplugin/markdown.vim mkdir -pv ${ADDONS}/syntax - cp -v syntax/mkd.vim ${ADDONS}/syntax/mkd.vim + cp -v syntax/markdown.vim ${ADDONS}/syntax/markdown.vim mkdir -pv ${ADDONS}/after/ftplugin - cp -v after/ftplugin/mkd.vim ${ADDONS}/after/ftplugin/mkd.vim + cp -v after/ftplugin/markdown.vim ${ADDONS}/after/ftplugin/markdown.vim mkdir -pv ${REGISTRY} - cp -v registry/mkd.yaml ${REGISTRY}/mkd.yaml + cp -v registry/markdown.yaml ${REGISTRY}/markdown.yaml diff --git a/README.md b/README.md index a5bdbbe..5ddf6ed 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ To install without Pathogen using the Debian [vim-addon-manager](http://packages git clone https://github.com/plasticboy/vim-markdown.git cd vim-markdown sudo make install -vim-addon-manager install mkd +vim-addon-manager install markdown ``` If you are not using any package manager, download the [tarball](https://github.com/plasticboy/vim-markdown/archive/master.tar.gz) and do this: diff --git a/after/ftplugin/mkd.vim b/after/ftplugin/markdown.vim similarity index 100% rename from after/ftplugin/mkd.vim rename to after/ftplugin/markdown.vim diff --git a/ftdetect/mkd.vim b/ftdetect/markdown.vim similarity index 100% rename from ftdetect/mkd.vim rename to ftdetect/markdown.vim diff --git a/ftplugin/mkd.vim b/ftplugin/markdown.vim similarity index 100% rename from ftplugin/mkd.vim rename to ftplugin/markdown.vim diff --git a/indent/mkd.vim b/indent/markdown.vim similarity index 90% rename from indent/mkd.vim rename to indent/markdown.vim index 68e385a..fb8d95d 100755 --- a/indent/mkd.vim +++ b/indent/markdown.vim @@ -1,12 +1,12 @@ if exists("b:did_indent") | finish | endif let b:did_indent = 1 -setlocal indentexpr=GetMkdIndent() +setlocal indentexpr=GetMarkdownIndent() setlocal nolisp setlocal autoindent " Only define the function once -if exists("*GetMkdIndent") | finish | endif +if exists("*GetMarkdownIndent") | finish | endif function! s:is_li_start(line) return a:line !~ '^ *\([*-]\)\%( *\1\)\{2}\%( \|\1\)*$' && @@ -25,7 +25,7 @@ function! s:prevnonblank(lnum) return i endfunction -function GetMkdIndent() +function GetMarkdownIndent() let list_ind = 4 " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) diff --git a/registry/markdown.yaml b/registry/markdown.yaml new file mode 100644 index 0000000..63648a3 --- /dev/null +++ b/registry/markdown.yaml @@ -0,0 +1,7 @@ +addon: markdown +description: "Markdown syntax highlighting" +files: + - ftdetect/markdown.vim + - ftplugin/markdown.vim + - syntax/markdown.vim + - after/ftplugin/markdown.vim diff --git a/registry/mkd.yaml b/registry/mkd.yaml deleted file mode 100644 index d0ea467..0000000 --- a/registry/mkd.yaml +++ /dev/null @@ -1,7 +0,0 @@ -addon: mkd -description: "Markdown syntax highlighting" -files: - - ftdetect/mkd.vim - - ftplugin/mkd.vim - - syntax/mkd.vim - - after/ftplugin/mkd.vim diff --git a/syntax/mkd.vim b/syntax/markdown.vim similarity index 100% rename from syntax/mkd.vim rename to syntax/markdown.vim diff --git a/test/map.vader b/test/map.vader index ea96182..e6d2dff 100644 --- a/test/map.vader +++ b/test/map.vader @@ -1,46 +1,46 @@ -Given mkd; +Given markdown; a c Execute (gx autolink): let b:url = 'http://b' let b:line = getline(1) - let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition') AssertEqual b:func(1, match(b:line, 'a') + 1), '' AssertEqual b:func(1, match(b:line, '<') + 1), b:url AssertEqual b:func(1, match(b:line, 'h') + 1), b:url AssertEqual b:func(1, match(b:line, '>') + 1), b:url AssertEqual b:func(1, match(b:line, 'c') + 1), '' -Given mkd; +Given markdown; a http://b.bb c Execute (gx implicit autolink): let b:url = 'http://b.bb' let b:line = getline(1) - let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition') AssertEqual b:func(1, match(b:line, 'a') + 1), '' AssertEqual b:func(1, match(b:line, 'h') + 1), b:url AssertEqual b:func(1, match(b:line, 'c') + 1), '' -Given mkd; +Given markdown; [a]: http://b "c" Execute (gx link reference definition): let b:url = 'http://b' let b:line = getline(1) - let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition') " TODO would be cool if all of the following gave the link. AssertEqual b:func(1, match(b:line, 'a') + 1), '' AssertEqual b:func(1, match(b:line, 'h') + 1), b:url AssertEqual b:func(1, match(b:line, 'c') + 1), '' -Given mkd; +Given markdown; a [b](c) d Execute (gx autolink): let b:url = 'c' let b:line = getline(1) - let b:func = Markdown_GetFunc('vim-markdown/ftplugin/mkd.vim', 'Markdown_GetUrlForPosition') + let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition') AssertEqual b:func(1, match(b:line, 'a') + 1), '' AssertEqual b:func(1, match(b:line, '[') + 1), b:url AssertEqual b:func(1, match(b:line, 'b') + 1), b:url @@ -50,7 +50,7 @@ Execute (gx autolink): AssertEqual b:func(1, match(b:line, ')') + 1), b:url AssertEqual b:func(1, match(b:line, 'd') + 1), '' -Given mkd; +Given markdown; # a b @@ -66,7 +66,7 @@ Execute (]] same level): normal [[ AssertEqual line('.'), 1 -Given mkd; +Given markdown; # a b @@ -82,7 +82,7 @@ Execute (]] different levels level): normal [[ AssertEqual line('.'), 1 -Given mkd; +Given markdown; # a b @@ -102,7 +102,7 @@ Execute (][ different levels level): normal [] AssertEqual line('.'), 1 -Given mkd; +Given markdown; # a b @@ -113,7 +113,7 @@ Execute (]c): normal ]c AssertEqual line('.'), 1 -Given mkd; +Given markdown; # a Execute (Toc does not set nomodifiable on other files): diff --git a/test/syntax.vader b/test/syntax.vader index c3dc02d..bb9ef2f 100644 --- a/test/syntax.vader +++ b/test/syntax.vader @@ -1,4 +1,4 @@ -Given mkd; +Given markdown; a **b** c Execute (bold): @@ -6,7 +6,7 @@ Execute (bold): AssertEqual SyntaxOf('b'), 'htmlBold' AssertNotEqual SyntaxOf('c'), 'htmlBold' -Given mkd; +Given markdown; a *b* c Execute (italic): @@ -16,14 +16,14 @@ Execute (italic): # Links -Given mkd; +Given markdown; [a](b) Execute (link with title): AssertEqual SyntaxOf('a'), 'mkdLink' AssertEqual SyntaxOf('b'), 'mkdURL' -Given mkd; +Given markdown; (a) (b) @@ -32,7 +32,7 @@ Execute (parenthesis not in link): AssertNotEqual SyntaxOf('a'), 'mkdURL' AssertNotEqual SyntaxOf('b'), 'mkdURL' -Given mkd; +Given markdown; [a](b) c [d](e) Execute (multiple links on a line): @@ -40,7 +40,7 @@ Execute (multiple links on a line): # Autolinks -Given mkd; +Given markdown; a c Execute (autolink): @@ -50,25 +50,25 @@ Execute (autolink): AssertEqual SyntaxOf('>'), 'mkdDelimiter' AssertNotEqual SyntaxOf('c'), 'mkdInlineURL' -Given mkd; +Given markdown; Execute (autolink with scheme case is insensitive): AssertEqual SyntaxOf('a'), 'mkdInlineURL' -Given mkd; +Given markdown; Execute (autolink without known scheme is not a link): AssertNotEqual SyntaxOf('n'), 'mkdInlineURL' -Given mkd; +Given markdown; Execute (autolink without scheme is not a link): AssertNotEqual SyntaxOf('a'), 'mkdInlineURL' -Given mkd; +Given markdown; < http://a > Execute (autolinks can be backslash escaped): @@ -89,7 +89,7 @@ Execute (autolinks can be backslash escaped): # Code Blocks -Given mkd; +Given markdown; ~~~ code ~~~ @@ -97,7 +97,7 @@ code Execute (code blocks can be fenced with tildes): AssertEqual SyntaxOf('c'), 'mkdCode' -Given mkd; +Given markdown; ~~~ruby code ~~~ @@ -107,7 +107,7 @@ Execute (code blocks can have a language specifier): # Math -Given mkd; +Given markdown; a $x$ b c $$y$$ d \$e\$ @@ -131,7 +131,7 @@ Execute (math): AssertNotEqual SyntaxOf('x'), 'mkdMath' AssertNotEqual SyntaxOf('y'), 'mkdMath' -Given mkd; +Given markdown; a $ @@ -149,7 +149,7 @@ Execute (multiline math): # YAML frontmatter -Given mkd; +Given markdown; --- a: b --- @@ -163,7 +163,7 @@ Execute (YAML frontmatter is controlled by the option): syn off | syn on AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' -Given mkd; +Given markdown; --- a: b @@ -174,7 +174,7 @@ Execute (YAML frontmatter only works if it's the first thing in the file): syn off | syn on AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey' -Given mkd; +Given markdown; --- a: b ---