preservim / vim-markdown Goto Github PK
View Code? Open in Web Editor NEWMarkdown Vim Mode
Markdown Vim Mode
Probably the best style guide out there?
http://google-styleguide.googlecode.com/svn/trunk/vimscriptguide.xml
The only difference I could find between that and current code is that they use 2 space indents, which seems to be a more popular choice today.
Hi, I don't know if you intend to support Git Flavoured Markdown or not. If so I've noticed a problem inside fenced code blocks.
For example, enter the following:
``` - item 1 - item 2
Then press o to add a line below the last line and it will try to autoindent.
saves you from having to set it manually. I've created a patch in bleything@0426e3464b850ba6639a003fe50eb2f0c05ae917, which sorta depends on the patch I submitted in #7.
I've got a ton of markdown docs with txt
as the extension. Any way to enable folding?
The default Vim distribution uses markdown
for markdown files (setup via filetype.vim).
Is there a specific reason why this plugin uses mkd
instead?
One workaround might be to use a symlink and provide both variants of specific files (syntax, ...) - still the filetype setup would have to use a specific value, or maybe markdown.mkd
to match both?!
The markdown specs say that a line begining with four or more spaces
(and/or a tab) will create a <pre><code> block. Useful for copy/pasted
code. This adds the syntax highlighting for this case.
I have a patch but GutHub buggers it all to hell when you paste it into this window. (how does GitHub not handle git based patches?!!!!!)
I'll email it to you.
I find some bugs when vim highlight markdown files. Please see the
screen capture video (focus on the top left terminal, in which I
highlighted "t", notice the bottom incorrectly highlighted paragraph).
Would you please take a look and see if you can fix this bug? Thanks!
https://rapidshare.com/files/1086391016/mkd_bug.mov
See the content of mkd file below.
constructs a graph whose vertices correspond
to all l-mers present in the t input sequences, with an edge connecting two vertices if and only if the
corresponding l-mers differ in at most 2d positions and do not both come from the same sequence.
WINNOWER then looks for a clique of size t in this graph.
A local search method that starts in turn from each individual l-mer x in the input, chooses the
closest match to x from every other input sequence, and uses a sum-of-pairs score and iterative refinement
to converge on a good motif.
Given:
this is a (link-like) test
The (link-like)
text gets highlighted as a link part of a markdown link even though it does not have the form [name](url)
.
something like this
"'<"
All the following text will be regarded as string until another double quote.
Just installed, great plugin, thanks.
I am navigating my file, which has H1s defined by underlining using the = character. When I attempt to navigate around the file with [[ or ]] the H1s are skipped. This is curious because they are correctly recognized and highlighted.
My particular file has H1s and H3 (defined with ###).
Thanks.
I haven't had a chance to dig into the code, but wanted to make an issue now. I might try to fix this later.
When you add an astricks within a paragraph it wants to start italicizing. I personally user underscore for italicizing so it might be nice to make that an option. But the bug I noticed is when it is in an inline code block like this: data-*
. In this case it would italics the rest of the document until another astricks.
Given:
testing[^test] (a test)
the footnote link [^test]
gets highlighted as if it were a markdown link, along with (a test)
.
I put two white spaces to end of line, but I don't see this with TODO hi.
And if I make
:syn list mkdLineBreak
I see a correct colorized hi
mkdLineBreak xxx match / \+$/
links to Todo
Regards
Doesn't even need to render differently: the only thing I need is to add @NoSpell
, otherwise all my titles made of programming terms become spell errors:
# ActiveRecord
I want:
# `ActiveRecord`
It would be nice if @someone
tags would be highlighted.
Even nicer would be autocompletion for existing @tags
...
Markdown mode highlights everything following square brackets as a link, even if there are no parentheses with a URI.
For example, this is an issue with GitHub wiki links ([[my page]]
) or manual footnotes, like so:
lorem ipsum[1]
...
dolor sit[2] amet
...
[1] cf. http://example.org
[2] consectetur adipisicing elit
In this example, everything from the first square bracket is erroneously regarded as a (single) link.
Hi there,
Would you support Python-Markdown
's meta extension highlight?
The document to the meta extension: http://packages.python.org/Markdown/extensions/meta_data.html
A related issue on Python-Markdown
's issue tracker: Python-Markdown/markdown#173
I'm trying to write regular expressions in git wiki, but I found that "[...]" will always convert to math fomula.
I've tried "\[", "\[" and a lot but none worked.
(And I found that "\[" works here but not in git wiki)
vim-markdown highlights only single-line headings now. In my humble opinion it is better to highlight all the lines of a header up to an empty line.
Now:
plain: First line of a very long
highlighted: two-line heading
highlighted: =========
Should be:
highlighted: First line of a very long
highlighted: two-line heading
highlighted: =========
For instance, I have a file with:
cat .ssh/id_rsa.pub
## passwordless access with git
The sole underscore in the filename is triggering the syntax region.
*'s of a list are highlighted when indented with spaces, but not with tabs. Would be nice for us tabbers to see our * lists nicely colored.
References to other files are highlighted, but I did not find an easy way to open them. Is there a keymap for that already?
Github flavored markdown has codeblocks denoted by backticks. Unfortunately this isn't supported which means that the syntax highlighting can get pretty screwy (for example if there is an underscore in a code block. Any chance this functionality could be added?
Error detected while processing /Users/languitar/.vim/bundle/vim-markdown/ftplugin/mkd.vim:
line 72:
E128: Function name must start with a capital or "s:": b:Markdown_GetHeaderLineNum(...)
line 73:
E121: Undefined variable: a:0
E15: Invalid expression: a:0 == 0
line 78:
E121: Undefined variable: l:l
E15: Invalid expression: (l:l > 0)
line 80:
E133: :return not inside a function
line 84:
E133: :return not inside a function
line 85:
E193: :endfunction not inside a function
line 94:
E128: Function name must start with a capital or "s:": b:Markdown_MoveToCurHeader()
line 95:
E117: Unknown function: b:Markdown_GetHeaderLineNum
E15: Invalid expression: b:Markdown_GetHeaderLineNum()
line 96:
E121: Undefined variable: l:lineNum
E15: Invalid expression: l:lineNum != 0
line 102:
E133: :return not inside a function
line 103:
E193: :endfunction not inside a function
line 109:
E128: Function name must start with a capital or "s:": b:Markdown_MoveToNextHeader()
line 114:
E193: :endfunction not inside a function
line 120:
E128: Function name must start with a capital or "s:": b:Markdown_MoveToPreviousHeader()
line 121:
E117: Unknown function: b:Markdown_GetHeaderLineNum
E15: Invalid expression: b:Markdown_GetHeaderLineNum()
line 122:
E461: Illegal variable name: l:noPreviousHeader
line 123:
E121: Undefined variable: l:curHeaderLineNumber
E15: Invalid expression: l:curHeaderLineNumber <= 1
line 133:
E121: Undefined variable: l:noPreviousHeader
E15: Invalid expression: l:noPreviousHeader
line 136:
E193: :endfunction not inside a function
and many more.
As far as I understand vim, the typical way to add file detection is by putting a .vim file to be sourced in ~/.vim/ftdetect/ instead of making ~/.vim/filetype.vim. Does filetype.vim have any advantages over ftdetect? If not, then I propose updating the instruction page accordingly.
diff --git a/.vim/syntax/mkd.vim b/.vim/syntax/mkd.vim
index c4ceec4..8bfaa5a 100644
--- a/.vim/syntax/mkd.vim
+++ b/.vim/syntax/mkd.vim
@@ -66,7 +66,7 @@ syn match mkdLineBreak / \+$/
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell
syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
-syn region mkdCode start=/^```\s*[0-9A-Za-z_-]*\s*$/ end=/^```\s*$/
+syn region mkdCode start=/^\s*```\s*[0-9A-Za-z_-]*\s*$/ end=/^\s*```\s*$/
syn region mkdCode start="<pre[^>]*>" end="</pre>"
syn region mkdCode start="<code[^>]*>" end="</code>"
syn region mkdFootnote start="\[^" end="\]"
I'm new to using a plug-in/package manager for vim and vundle was recommended to me.
I just tried using vundle to install vim-markdown and have been met with a python stack trace of errors (gist).
I'm not asking for help diagnosing my particular install issues, but I thought it would be worth reporting so easier vundle installation could be supported in the future.
Perhaps this is actually a vundle issue and if so, please close and I'll put this remark over there.
Thank you!
List items in Markdown may have multiple paragraphs, and each subsequent paragraph in a list item is intended by either 4 spaces or one tab. However, vim-markdown treats all subsequent paragraphs
as code blocks. Code blocks actually must be intended by 8 spaces or two tabs in a list item.
See an example in http://daringfireball.net/projects/markdown/index.text:
1. Copy the "Markdown.pl" file to appropriate filters folder in your
"BBEdit Support" folder. On Mac OS X, this should be:
BBEdit Support/Unix Support/Unix Filters/
See the BBEdit documentation for more details on the location of
these folders.
The output is:
- Copy the "Markdown.pl" file to appropriate filters folder in your
"BBEdit Support" folder. On Mac OS X, this should be:BBEdit Support/Unix Support/Unix Filters/
See the BBEdit documentation for more details on the location of these folders.
And here is the screenshot of how vim-markdown highlights the code: http://imgur.com/2i5Xy.png
The second paragraph is a code block, while the third paragraph is a normal paragraph, which should not be highlighted.
There is a problem with version 7.4.273 which should be related to the recent 7.4.260 patch.
Error detected while processing /Users/user/.vim/bundle/vim-markdown/ftplugin/mkd.vim:
line 72:
E128: Function name must start with a capital or "s:": b:Markdown_GetHeaderLineNum(...)
[...]
Patch 7.4.260
updated for version 7.4.260
Problem: It is possible to define a function with a colon in the name. It
is possible to define a function with a lower case character if a
"#" appears after the name.
Solution: Disallow using a colon other than with "s:". Ignore "#" after the
name.
I like the folding feature, but when I open a file I don't want to every time have to open the folds initially. I want them all open for me.
Love the plugin!
Although inline LaTeX is not part of the official Markdown specification, the following causes the syntax highlighting to break:
# =)
- Hello.
- $<$.
- Hello.
# =(
Here's an image of the problem:
As far as I know, inline LaTeX is not supported by the plugin. But since it is commonly used in Markdown, I thought you might want to be alerted to the problem.
With :syntax
on setting, paragraphs/running text are not spell checked by vim spell. On the other hand spell checking for e.g. lists (starting with *, - , etc.) works fine.
Markdown supports backslash escapes, but the vim-markdown syntax highlighting doesn't recognise this. For example, if I type <, then every word following will be highlighted as a HMTL tag.
The following are incorrectly syntax highlighted:
[^test]: This is a test.
[^ME]: [Middle English](https://en.wikipedia.org/wiki/Middle_English). Wikipedia.
The footnote is correctly highlighted, but:
This
in This is a test.
);I think the:
[name]: url
style markup should not be applied if the name starts with a ^
. This would then keep the definition in normal text colour and allow links and other markup to be correctly highlighted.
4033.559 3845.806 043.229: sourcing /.vim/syntax/markdown.vim
Took 3845.806ms, every time start
the code block :
syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
is too slow ;
I use this instead:
+syn region mkdCode start='^$\n^\s{4,}' end='^$'
"\ contains=@NoSpell
I've installed vim-markdown with Vundle and its files are sourced when opening md file but syntax definitions and everything gets messed up because of conflicts with distribution's syntax/ftplugin stuff. What is the proper way of disabling the latter so only vim-markdown is used for markdown files?
(Sorry if it's a lame question, I'm newbie in the vimscript world.)
Buffer:
- a
- b
Action: :Toc
.
Outcome: quickfix contains:
- a
Expected outcome: empty quickfix.
Reason: - b
gets confused with the start of a level 2 Setex header.
Possibly introduced by #80 at 2c06d3d#diff-8b2d9db56111bbd715efcb9f5fc35c9dR335
So it doesn't regard \*
as closing tag and doesn't mess everything up when you need to place a star into italic text. Probably the same stuff for \_
and other variants won't hurt too.
I'm newbie in vimscript world, but this does the thing for me:
syn region htmlItalic start="\\\@<!\*\S\@=" skip="\\\*" end="\S\@<=\\\@<!\*" keepend oneline
(Probably it's good to propose this patch to the vim team for fixing official distribution, but I dunno what the process is.)
Buffer: either of:
<http://example|cursor|.com>
[example](http://example|cursor|.com)
[ex|cursor|ample](http://example.com)
Action: gx
.
Outcome: browser opens URL.
There has been some discussion at:
I have let g:vim_markdown_folding_disabled=1
in my .vimrc, but when I open a markdown file for the first time, everything is folded.
Pathogen allows one to put plugins in ~/.vim/bundle and they get added to the load path... the upshot is that they can stay isolated from each other, rather than having to copy files into your ~/.vim/syntax directories (for instance).
In order to use vim-markdown with Pathogen, the syntax file needs to move into a syntax/ directory. I've done that in bleything/vim-markdown@e49b51edc64ac78e85aa5475ba88fc8a33c74a4d
the problem
![description [with a nested](link) doesn't highlight correctly](image.png)
the patch:
syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!\[" end="\]\ze\s*[[(]" contains=@Spell containedin=mkdLink nextgroup=mkdURL,mkdID skipwhite oneline
it just adds "containedin=mkdLink" to the original mkdLink region.
not sure if that's correct, i don't have any experience with vim syntax files, but it works for me so far.
Possible syntaxes:
$ x^2 $
. Not supported in many Md engines because of conflict with dollar sign, even if $$
is supported.$$ x^2 $$
\(\)
\[\]
We would have to decide which to support.
The URL in description "Markdown Vim Mode
http://plasticboy.com/markdown-vim-mode/" is not exist?
Need to update the description?
Would be nice if # ...
headers in markdown files were syntax highlighted like function names in source code files.
I extracted the zip file into ~/.vim
My .vim now looks like:
chris@chris-linux-desktop:~/.vim$ tree .
.
|-- doc
| |-- NERD_tree.txt
| -- tags |-- ftdetect |
-- mkd.vim
|-- nerdtree_plugin
| |-- exec_menuitem.vim
| -- fs_menu.vim |-- plugin |
-- NERD_tree.vim
-- syntax
-- mkd.vim
5 directories, 7 files
Is there something else I need to do?
Thanks,
Chris.
P.S.
chris@chris-linux-desktop:/.vim$ cat /etc/lsb-release/.vim$ uname -a
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
chris@chris-linux-desktop:
Linux chris-linux-desktop 2.6.35-31-generic #63-Ubuntu SMP Mon Nov 28 19:29:10 UTC 2011 x86_64 GNU/Linux
chris@chris-linux-desktop:~/.vim$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 28 2010 11:02:36)
When trying to escape a link marker, vim-markdown still seems to highlight it as if it was a link. For example:
\[test]
I think should just produce [test], not underlined like a link. To accomplish this, you can change:
syn region mkdLink matchgroup=mkdDelimiter start="\!\?\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite
to:
syn region mkdLink matchgroup=mkdDelimiter start="\!\?\(\\\)\@<!\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite
In the syntax file.
Cloning your repo for this seems to be overkill.
From ca4fe2efff68e71098c8ecf4c59e7326bf452b85 Mon Sep 17 00:00:00 2001
From: Richard Hartmann [email protected]
Date: Sat, 7 May 2011 21:13:02 +0200
Subject: [PATCH] Support Markdown in openssl.vim
openssl.vim allows you to transparently encrypt files using openssl.
ftdetect/mkd.vim | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ftdetect/mkd.vim b/ftdetect/mkd.vim
index ab36f5c..44f6f0e 100644
--- a/ftdetect/mkd.vim
+++ b/ftdetect/mkd.vim
@@ -1,3 +1,4 @@
" markdown filetype file
-au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=mkd
+au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=mkd
+au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=mkd
1.7.4.4
When try to get a :Toc I have this error
Error detected while processing function 37_Markdown_Toc:
line 25:
E486: Pattern not found: \v^([^|]*|){2,2} #
Anyway after it displays correctly the headers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.