Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [filetype-markdown]

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

Filter by
Sorted by
Tagged with
18 votes
1 answer
341 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 ...
user avatar
17 votes
5 answers
1k 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 ...
user avatar
15 votes
3 answers
5k 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 ...
user avatar
  • 1,165
12 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 ...
user avatar
10 votes
5 answers
4k 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,...
user avatar
  • 357
10 votes
1 answer
1k 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 ...
user avatar
  • 1,053
10 votes
2 answers
7k 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 ...
user avatar
  • 301
8 votes
1 answer
3k 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 ...
user avatar
  • 379
8 votes
2 answers
8k 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 ...
user avatar
  • 81
6 votes
2 answers
745 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. ...
user avatar
  • 547
6 votes
1 answer
737 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 ...
user avatar
  • 766
6 votes
1 answer
1k 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 ...
user avatar
5 votes
4 answers
702 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" - ...
user avatar
5 votes
1 answer
2k 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 ...
user avatar
  • 1,046
5 votes
3 answers
567 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 ...
user avatar
5 votes
2 answers
1k 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 ...
user avatar
  • 4,005
5 votes
4 answers
2k 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. ...
user avatar
  • 151
4 votes
2 answers
638 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 ...
user avatar
4 votes
2 answers
309 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-...
user avatar
  • 1,117
4 votes
1 answer
71 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 ...
user avatar
  • 43
4 votes
1 answer
2k 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. ...
user avatar
4 votes
1 answer
424 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 ...
user avatar
4 votes
1 answer
398 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 ...
user avatar
4 votes
1 answer
44 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: - [ ] **...
user avatar
  • 223
4 votes
1 answer
1k 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, ...
user avatar
  • 4,005
4 votes
0 answers
230 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 ...
user avatar
3 votes
2 answers
302 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 ...
user avatar
  • 735
3 votes
1 answer
157 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 :<...
user avatar
3 votes
1 answer
215 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 ...
user avatar
  • 547
3 votes
1 answer
724 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 ...
user avatar
3 votes
1 answer
310 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 ...
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 ...
user avatar
  • 2,221
3 votes
1 answer
294 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 ~/....
user avatar
  • 133
3 votes
0 answers
118 views

How to disable spell check inside code blocks in markdown?

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 ...
user avatar
3 votes
0 answers
132 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 ...
user avatar
  • 175
3 votes
0 answers
311 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 ...
user avatar
  • 163
3 votes
0 answers
149 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 ...
user avatar
  • 165
2 votes
2 answers
2k 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,...
user avatar
2 votes
2 answers
111 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 ...
user avatar
  • 151
2 votes
2 answers
951 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 ...
user avatar
  • 1,237
2 votes
2 answers
520 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 ...
user avatar
2 votes
1 answer
59 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 ...
user avatar
  • 25
2 votes
2 answers
166 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=...
user avatar
2 votes
2 answers
170 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 ...
user avatar
  • 151
2 votes
1 answer
53 views

Markdown lists items three levels or deeper are not syntax highlighted

In a Vim markdown file (:set filetype=markdown), special items such as links and itacized text are normally syntax highlighted, but when they appear in a list more than three levels deep, they appear ...
user avatar
2 votes
1 answer
73 views

What option controls how much space is added after a new line?

When I set tw vim will auto wrap lines at tw. When breaking that line vim usually places some spaces to keep the indentation of the previous line. Example foo bar<suppose that a wrap happens ...
user avatar
  • 123
2 votes
1 answer
543 views

navigating markdown documents using ctags with vim and neovim

I work on my dotfiles periodically throughout my day work or non work related (that bonsai tree that's never done). I've written a couple of markdown documents that have become rather large to ...
user avatar
  • 1,489
2 votes
1 answer
268 views

How to disable intelligent indent for text/markdown files?

Since ever in my configuration of vim text and markdown-files are indented on following lines to align with open parenthesis. Text Text Text (e.g. Hello World) More Text This happens ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
  • 235
2 votes
1 answer
211 views

markdown spell checking with triple nested bullet point

I am confused about what is going on in this example and why spell checking is not working any help is appreciated. While editing a markdown file with spell checking enabled the following happens: * ...
user avatar
  • 21