Questions tagged [filetype-markdown]

For questions about configuring and using Vi/Vim to edit markdown files.

Filter by
Sorted by
Tagged with
18 votes
3 answers
7k views

automatically rewrap lines when writing markdown in VIM

Very often, I write markdown in VIM, and there will be paragraphs in those markdown. To help my editing, I setup my Vim to wrap a line on 80 chars. It works nice if I just keep typing, but the problem ...
Jason Hu's user avatar
  • 1,385
18 votes
1 answer
479 views

Prevent Vim from breaking up links mid-tag in markdown

Let's say I have this Markdown file: [Lorem ipsum dolor sit ](http://vi.stackexchange.com/many-links-are-often-very) Lookin' good. But the link isn't finished it, so I type -long, and now Vim breaks ...
Martin Tournoij's user avatar
17 votes
5 answers
2k views

Replace a series of asterisk bullet points with a numbered list

Imagine I have the following text: some random stuff * asdf * foo * bar some other random stuff I want to replace the asterisk bullets with numbers, like so: some random stuff 1. asdf 2. foo 3. bar ...
Brennan Vincent's user avatar
16 votes
3 answers
2k views

Paste link to image in clipboard when editing Markdown

I have an image on the clipboard and I want to paste it into my document as the text [](img/image1.png). Instead of first copying it to that directory, I want to do it with a single p key press in ...
Maxim Kochurov's user avatar
15 votes
5 answers
7k views

Markdown in Neovim: which plugin sets conceallevel=2?

I'm experiecing the most annoying thing ever: when I edit a markdown file, asterisk characters are hidden by default. If I set on an open buffer :set conceallevel=0, asterisks shows up as they should,...
caneta's user avatar
  • 427
11 votes
2 answers
9k views

How to fold markdown using the built-in markdown mode?

Looking at the ftplugin file for markdown in Vim, it certainly appears that folding is supported, but I cannot get folding to work. If I have some content like this: # A heading Some content. More ...
ana's user avatar
  • 111
10 votes
1 answer
2k views

NeoVim hides the * chars when editing markdown

I am using tpope's vim-markdown plugin to edit markdown files. Somehow, neovim hides the _ and * chars and changes the text in between to italic or bold depending on quantity of chars. I want to see ...
user1135541's user avatar
  • 1,103
10 votes
2 answers
8k views

Markdown: how to syntax-highlight Bold and Italic in different color than normal text?

Text marked as__bold__ or _italic_ appears in the same color as normal text. Headings and code do show up in different colors, so vim correctly recognizes the file as markdown. This is no matter ...
LB7979's user avatar
  • 301
8 votes
2 answers
3k views

Mardown files always have vimwiki filetype (vimwiki plugin)

Here is the relevant content of my .vimrc let g:vimwiki_global_ext=0 let g:vimwiki_list = [{'path': 'C:\Users\<USER>\vimwiki', \ 'syntax': 'markdown', 'ext': '.md'}] The ...
Tuyen Pham's user avatar
  • 1,306
8 votes
1 answer
4k views

How to preview the result of markdown file edited in vim?

I use vim to edit latex, but latex is bit too heavy for taking notes casually on daily basis, so I decided to use markdown instead. So, I want to configure vim so that I could view markdown ...
Tom's user avatar
  • 379
7 votes
4 answers
1k views

Join all non-blank lines

When editing markdown and other text files, I like to use textwidth/wrapmargin to insert line breaks at fixed intervals. (The advantage of this is that each visual line is a Vim "line" - ...
Josh Friedlander's user avatar
7 votes
2 answers
1k views

How do I make Vim respect Markdown headers when formating text?

I want to use the combination gggqG to go to the top of the file and format the whole file from there, so that it fits into my 80 col textwidth border. But when I do, vim ignores my markdown headers. ...
uuu's user avatar
  • 557
7 votes
1 answer
922 views

Highlight double space in markdown

When writing markdown, a double space at the end of a line indicates a line break. Currently, neither single trailing whitespaces nor double-whitespaces are being highlighted. Is it possible to have ...
alexytsu's user avatar
  • 846
7 votes
1 answer
2k views

Line formatting (gq) does not correctly indent long list items

I want to wrap my text to 79 characters, I do that using the gq command. For most filetypes this works just fine and indents following lines. With Markdown, however, it does the following: The ...
Martin Ueding's user avatar
7 votes
1 answer
719 views

How to disable spell check inside code blocks in markdown? [closed]

Code blocks (fenced with ` or ```) are bound to have words not correctly spelled and spell check warnings often get in the way of syntax highlighting. I still want spell check enabled for the rest of ...
ChocolateOverflow's user avatar
5 votes
2 answers
2k views

What is the vim command to jump to linked line inside markdown document?

I have created a table of contents at the beginning of my markdown document and linked the headers of the document: # TOC [first header](#first-header) # first header Now, having opened the document ...
AKG's user avatar
  • 191
5 votes
3 answers
808 views

How to decrease markdown header level in visual mode without a plugin?

I have a file like this: # Heading A ### Heading B1 lorem ipsum ### Heading B2 lorem ipsum and I want to reduce the header levels of B1 and B2 to look like this: # Heading A ## Heading B1 ...
Allan Tsai's user avatar
5 votes
2 answers
2k views

Indent a markdown list item?

I am frequently editing markdown files, and when dealing with multi-line items in hierarchical lists, it would be great to have a rapid way to indent or un-indent a list item. For example, how can I ...
Wildcard's user avatar
  • 4,409
5 votes
4 answers
3k views

Why is autoindent not applied to my markdown files?

When editing markdown (*.md) formatted files, and making bullet points, upon pressing return I want the new bullet point to be automatically created in the same level under the previous one. ...
AppAraat's user avatar
  • 151
5 votes
1 answer
3k views

Make Vim stop highlighting certain underscores in my Markdown as errors

I'm using Kramdown-flavored Markdown in several of my Jekyll websites. Vim highlights all the underscores in those documents as errors, coloring them (in my color scheme) with bright red backgrounds. ...
Scott Severance's user avatar
5 votes
0 answers
349 views

How to stop vim from reformatting lines inside a codeblock in a markdown file?

I keep the a formatoption in vim when I'm modifying markdown files, so my lines are automatically kept to textwidth characters long, with automatic reformatting when I modify text. How can I make ...
Christopher Shroba's user avatar
5 votes
0 answers
183 views

Prevent Vim from breaking up inline code blocks in (r)markdown

I edit R-markdown files a lot, and this entails writing inline code blocks, such as `r sum(mylongvectorname)` I usually have my text hard-wrapped at 80 chars, and this causes problems for the ...
jharme's user avatar
  • 185
4 votes
2 answers
878 views

Open markdown filename under cursor like gf, and jump to the section?

I have the file /path/a.md which has many sections as follows: # abc this this the content of section abc # def this this the content of section abc ## defg this this the content of subsection defg ...
Lerner Zhang's user avatar
4 votes
2 answers
337 views

Why does Vim load unrelated ftplugins?

When I open a file with .md extension, the filetype is set to markdown, as expected. But the ftplugin for HTML is also loaded as I can see since I have some insert mode mappings in there to auto-...
oarfish's user avatar
  • 1,277
4 votes
1 answer
83 views

Move lines with tildes to a certain section of a file

I use vim to write my to-do list in markdown format. To mark a certain task "done" I just make it strikethrough with two tildes(~). Is there a way to automatically move all strikethrough text to a ...
Arthur's user avatar
  • 43
4 votes
1 answer
632 views

How to conceal Markdown syntax per-word, rather than per-paragraph?

I want to use Vim to write markdown in a sort-of-WYSIWYG manner (for use with an audience). For example, typing **Bold** should display Bold in bold font, with the asterisks automatically hidden as ...
Nick Weinberg's user avatar
4 votes
1 answer
448 views

Vim Pandoc & Headers

When using vim-pandoc, I'm having some funny behavior with headers: For instance, if I position the cursor on a word and press v-a-w and then <localleader> - i, I get italics. if I position ...
testname123's user avatar
4 votes
1 answer
70 views

How to change markdown item format into task (`[ ]`) on the next line?

When I'm in a markdown file creating a task list, I want it to insert a task list not a list item. Output: - [ ] **A task** - A task list <Enter> - Inserted just a dash Would like this: - [ ] **...
ritchie's user avatar
  • 253
4 votes
1 answer
2k views

Turn off markdown highlighting for underscores in inline code?

Markdown highlighting is great (when it works), but I've seen a problem on two different boxes with underscores in inline code and I'm wondering if there's an easy solution. When I put, for instance, ...
Wildcard's user avatar
  • 4,409
4 votes
0 answers
376 views

How to preview Markdown in a Vim buffer?

I'm aware of some of the Markdown plugins for Vim, but I want the functionality VS Code and Atom provide, namely being able to split the editor screen and render a live Markdown preview in an adjacent ...
Mr Blue's user avatar
  • 205
3 votes
4 answers
463 views

Convenient way to surround block with markdown codeblock backticks

Is there a convenient way to surround a code block or a range of lines with markdown backticks? That amounts to doing a surround op to insert multiple chars. Ie. turn: line 1 line 2 Into: ``` line 1 ...
markling's user avatar
  • 359
3 votes
2 answers
360 views

write a key command for a markdown comment

I've been messing about with file type specific commands this evening (which is going to be very useful) and I'm trying to write a markdown comment command at the moment. I'm not sure how to go about ...
baxx's user avatar
  • 1,025
3 votes
1 answer
202 views

Vim RegEx question: how to detect headings of markdown(.md) i.e. lines composed of '-' or '='

I'm learning Vimscript in Learn Vimscript the Hard way and trying an exercise. Here is this: The lines "underlined" with = characters are treated as headings by Markdown. :onoremap ih :<...
Szkieletor's user avatar
3 votes
2 answers
1k views

Highlight Markdown indented code

When writing Markdown, fenced code written between triple backticks is highlighted, but not code in indented blocks (I don't care about language specific highlighting). How can I get vim to recognize ...
qwr's user avatar
  • 183
3 votes
1 answer
335 views

prevent neovim from breaking one markdown bullet point into multiple ones

I have this markdown text: * Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown ...
uuu's user avatar
  • 557
3 votes
1 answer
1k views

How to autocomplete citations in markdown files

I take notes in markdown files which I sometimes convert to other documents with pandoc. With the --bibliography=bibliography.bib argument, pandoc recognizes the @key citation format in markdown and ...
Paul Rougieux's user avatar
3 votes
1 answer
505 views

vim specific indentation for markdown

I want the indentation in markdown file as follows - [ ] Here is some text. When I press enter - [ ] <--- This entire thing should get populated. It means - [ ] should be copied onto the next ...
Palash Ahuja's user avatar
3 votes
1 answer
1k views

Vimwiki/Markdown blockquote syntax highlight

AFAIK vimwiki's markdown syntax doesn't emphasize in any way blockquotes. I mean: > This is a quote is presented instead as simple text. For reading notes it can be confusing. So, how do you ...
Ludenticus's user avatar
3 votes
1 answer
2k views

Syntax highlight Markdown formulas using LaTeX highlighting

I often write non-trivial mathematical formulas inside Markdown documents, and having them syntax-highlighted would really help. In Markdown, LaTeX math formulae are denoted: $x^2$ and $$x^2$$, and ...
Tom Hale's user avatar
  • 2,681
3 votes
1 answer
307 views

Vim-Markdown-Folding plugin error BufEnter E117

Inspired by Drew NEIL's course and the 'nested-folding' feature for Markdown files, I've installed the Vim-Markdown-Folding plugin, on my Vim (:version). The GitHub directory was copied into the ~/....
alex's user avatar
  • 133
3 votes
1 answer
178 views

Vimwiki overriding normal md highlighting

I love the concept of Vimwiki, but have a problem with it overriding the default md syntax highlighting. The default works well, and I use it regularly to edit md documents to be used with pandoc. ...
Megymagy's user avatar
3 votes
0 answers
435 views

How to disable spell check for a single line (with a custom tag)

Sometimes I do not want to add words to a spellfile, but still ignore them this once. This is particularly prevalent when I write markdown. It would be nice if I could tag a line with <!-- nospell -...
Patrick's user avatar
  • 191
3 votes
0 answers
524 views

README.md (markdown) - jump to infile link

While reading a markdown file, specifically using GitHub markdown, vim interprets hyperlinks correctly. It seems like it would be able to jump to the corresponding section in the file. Is there a key ...
kabanus's user avatar
  • 163
2 votes
2 answers
3k views

How to show math equations or formula in markdown file

I like to write notes in markdown file. Most of the times my notes are about coding, but sometimes I need to write some math equations or symbols. I would like to see the equations directly in the vim,...
CoinCheung's user avatar
2 votes
3 answers
306 views

How to cut a markdown link on the same line e.g. from `[` to `)`?

If I'm anywhere on a line that contains e.g.: [text1](link to text1) How do I cut from [ to ) ?
Spencer Maroukis's user avatar
2 votes
2 answers
1k views

Generating automated bullets and numbered lists with markdown

I'm looking for a good way to generate lists that are automatically bulleted. I tried the markdown plugin. It generates bullets automatically but not numbered lists. I also tried the vim-pandoc plugin ...
StevieD's user avatar
  • 1,492
2 votes
2 answers
646 views

Pandoc and formatting

I'm using the vim-pandoc and vim-pandoc-syntax bundles in neovim. I'm converting the markdown to a docx file and I'm seeing that I need to do a double space in order to get a carriage return in the ...
testname123's user avatar
2 votes
1 answer
406 views

Fold just one line

I have a custom foldexpr to fold comments in markdown. Is there a way to make this fold operation work on just one line? Even if it is just 1 line, I like the color change that folding applies so I ...
yh dev's user avatar
  • 25
2 votes
1 answer
3k views

No italics in vim

I am using vimwiki on nvim 0.1.7 on Konsole 16.12.3 on Plasma 5.9.5 on Kubuntu 17.04. Wiki text appears bold when it is between two stars. But when between two underscores, it does not appear in ...
deshmukh's user avatar
  • 265
2 votes
2 answers
171 views

How do I make regexes mutually contain each other?

I've written regexes for markdown for emphasis and bold as follows: syntax match PandocEmphasisMarker "\v(^|\s+)\zs_[^\n\t_ ]+([^_\n]|(\S_\S)|(\s_\S)|(\s+_\s+))+[^\n\t_ ]+_\ze($|\s+)" contains=...
Zelphir Kaltstahl's user avatar