Coder Social home page Coder Social logo

vim-markdown's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-markdown's Issues

Support Kramdown footnote definitions and links.

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:

  1. only the first word of the text is highlighted (e.g. This in This is a test.);
  2. the links are not highlighted as links.

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.

Add skip= pattern to italic syntax definition

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.)

erroneous link detection

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.

Highlighting multiline heading

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: =========

Add support for @tags

It would be nice if @someone tags would be highlighted.

Even nicer would be autocompletion for existing @tags...

Installation using vundle

Edit: please close issue.

Turns out this was NOT related to vim-markdown at all.

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!

I don't see the line break

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

Support for GFM code blocks

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?

disable folding not working

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.

Highlight headers

Would be nice if # ... headers in markdown files were syntax highlighted like function names in source code files.

Problem with :Toc

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.

parenthesis get highlighted as a link

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).

Works if I manually type "set filetype=mkd" after opening .md files, but not otherwise.

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
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
chris@chris-linux-desktop:
/.vim$ uname -a
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)

autoindent problem inside GFM fenced code block

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.

Astricks is italicizing even when it shouldn't

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.

code block is slow

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
    

code block for jekyll markdown

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="\]"

consider changing file layout to support Pathogen

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

Cannot escape "\[...\]"

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)

Use "markdown" filetype instead of "mkd" (or both)?!

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?!

Multiple paragraphs in list items

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:

  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.

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.

Escaping Link '[' marker

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.

LaTeX math blocks syntax highlight extension.

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.

All folds open initially

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!

Lots of warnings with vim 7.4.273

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.

[patch] 0001-Support-Markdown-in-openssl.vim.patch

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.

With this change, you can have mdwn.bfa etc be detected as Markdown while still using openssl.vim's encryption.

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

Why filetype.vim instead of ftdetect/mkd.vim?

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.

No spell checking in paragraph text.

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.

Code inside headers.

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`

Highlighting breaks with $<$

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:

bad

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.

What is the proper way for disabling distribution's markdown files

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.)

Go to next header seems to skip H1 defined with "==="

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.

Markdown syntax bug

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.

WINNOWER

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.

SP-STAR

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.

automatically set filetype

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.

Missing code block syntax

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.

Highlighting of nested links.

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.

Error with Vim version 7.4.273

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.