Questions tagged [filetype-markdown]

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

Filter by
Sorted by
Tagged with
17
votes
5answers
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 ...
17
votes
1answer
311 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 ...
14
votes
3answers
4k 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 ...
10
votes
3answers
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 ...
9
votes
1answer
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 ...
9
votes
2answers
6k 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 ...
8
votes
4answers
3k 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,...
8
votes
1answer
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 ...
8
votes
2answers
7k 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 ...
5
votes
4answers
543 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" - ...
5
votes
2answers
615 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. ...
5
votes
1answer
683 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 ...
5
votes
3answers
455 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 ...
5
votes
2answers
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 ...
4
votes
2answers
511 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 ...
4
votes
2answers
301 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-...
4
votes
1answer
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 ...
4
votes
1answer
61 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 ...
4
votes
1answer
846 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 ...
4
votes
4answers
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. ...
4
votes
1answer
319 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 ...
4
votes
1answer
376 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 ...
4
votes
1answer
37 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: - [ ] **...
4
votes
1answer
864 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, ...
4
votes
0answers
188 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 ...
3
votes
2answers
253 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 ...
3
votes
1answer
120 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 :<...
3
votes
1answer
182 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 ...
3
votes
1answer
258 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 ...
3
votes
1answer
1k 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. ...
3
votes
1answer
264 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 ~/....
3
votes
0answers
44 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 ...
3
votes
0answers
86 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 ...
3
votes
0answers
141 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 ...
2
votes
2answers
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,...
2
votes
2answers
486 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 ...
2
votes
2answers
645 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 ...
2
votes
2answers
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=...
2
votes
1answer
64 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 ...
2
votes
1answer
348 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 ...
2
votes
1answer
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 ...
2
votes
1answer
72 views

How to move to Markdown ATX-style headers?

How can I move (navigate) between Markdown ATX-style headers? The Vim plugin https://github.com/gbgar/pandoc-sections.vim does so using the [ and ] keys, but only when there is no space between the ...
2
votes
1answer
49 views

Vim Markdown treat fenced codeblock as comment

I use a rather nifty automatic text formatting for Markdown: (Seen https://asciidoc.org/userguide.html#X61) augroup TXT | au! autocmd FileType asciidoc,markdown \ setlocal autoindent expandtab ...
2
votes
1answer
413 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 ...
2
votes
2answers
96 views

Adding Atex Markdown Headers in Vim

Is there a way to make it so that This is a header =<tab> converts into This is a header ================ in all files who filetype is markdown?
2
votes
1answer
109 views

automatic text wrapping messed up with parenthesis

I like to wrap my text to 80 characters all the time, even when I am editing Markdown. I have a problem when I open parentheses: it doesn't wrap right anymore. Since it is hard for me to explain it, ...
2
votes
3answers
156 views

wrap a long line with specific format

I have a problem with breaking long line in markdown file. Given the following line * "fo" : You can use the 'formatoptions' option to influence how Vim formats text. 'formatoptions' is a string ...
2
votes
1answer
1k 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 ...
2
votes
0answers
170 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 ...
2
votes
0answers
51 views

How to disown a process opened by plugin? (vim-rmarkdown)

as I said in the title I'm talking about vim-rmarkdown, I have this in my init.vim (I'm using neovim) to compile the .rmd file to a pdf. autocmd Filetype rmd nnoremap <F5> :w<Space><...