Questions tagged [filetype-markdown]
For questions about configuring and using Vi/Vim to edit markdown files.
97
questions
1
vote
1
answer
33
views
How can I make `.vim/after/ftplugin/markdown.vim` take effect immediately
I change this file, but it seems that I have to restart vim to make it take effect. Is there any way to make .vim/after/ftplugin/markdown.vim take effect immediately? I try :source and :runtime, ...
2
votes
2
answers
169
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 ...
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 ...
0
votes
1
answer
20
views
Automatic removal of indent in markdown (fenced) codeblock comments starting with #
When writing indented fenced codeblocks (the only ones I use) like
```sh
some shell code
```
in markdown the indentation of comments is automatically removed when I type the comment ...
0
votes
0
answers
53
views
Formatting markdown text: Respect code blocks and tables
I set
setlocal formatoptions+=tl textwidth=80
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
in my ftplugin/...
0
votes
0
answers
80
views
Auto-update Markdown Outline
For Markdown I use the https://github.com/plasticboy/vim-markdown plugin. This Plugin defines a command :Toc which opens a new window a propagates a clickable buffer out of the Headlines. Very helpful ...
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 ...
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 ...
0
votes
1
answer
71
views
Syntax highlighting for uppercase headings using === or --- syntax
In Vim, without using any markdown plugin, headings like
# Uppercase heading
# lowercase heading
lowercase heading
=================
lowercase heading
-----------------
get highlighted, while ...
0
votes
1
answer
375
views
Why my markdown syntax is not working?
I'd like to edit text with markdown syntax. Searching for ways of using mixed syntax in the same file I've discovered this question with an answer saying that if I add the line let g:...
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:
- [ ] **...
0
votes
0
answers
535
views
Markdown syntax color theme
I am giving advice to different research groups at our university. Open Research is promoted highly and many groups use R for statistical analysis. Many are also interested in using Markdown, Pandoc ...
1
vote
1
answer
172
views
Vim-Pandoc Overrides my Markdown Plugins
I've been trying to get the vim-pandoc plugin to play nice with markdown nvim, and have not been successful in finding help so far. The trouble seems to be that vim-pandoc sets markdown files to be ...
0
votes
0
answers
238
views
Vim spellcheck does not highlight/select misspelt text which is emphasized or strongly emphasized in Markdown
I have noticed that vim spellcheck does not highlight/select text which is emphasized (i.e., italicized) or strongly emphasized (i.e., bold) in markdown.
For example,
The wuick brown fox jumps over ...
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 ...
0
votes
0
answers
65
views
How to configure formatoptions for markdown?
I really like how vim paragraph auto format works for markdown. The one place where it falls flat on its face is when editing/formatting code and log output that I want to put into the markdown (maybe ...
2
votes
1
answer
110
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 ...
1
vote
1
answer
114
views
Is it possible to put "|" character in a vimwiki table cell?
vimwiki tables are auto-formattable.
This is very convenient but I'm in trouble when I'm trying to make this kind of table.
| | Composites |
| `xy` | `x` followed by `y` |
| `x|...
0
votes
2
answers
39
views
Markdown is not highlighted
I am unable to turn on syntax highlighting for Markdown. How do I do it?
Here's my version information:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 15 2020 15:48:23)
Included patches: 1-758
Here'...
1
vote
1
answer
34
views
How to replace [ with ( in vim
I have this markdown line,
![Home][screenshots/home.png]
I want to replace it with,

So, I tried this,
:%s/[s/(s/g
Vim(version 81) says pattern not found.
1
vote
0
answers
152
views
How do you highlight text surrounded by double equals
I'm using vimwiki plugin with markdown. I'd like to highlight text using double equals, which isn't standard, but is quite useful. Ideally, this should replace background (for instance, yellow) and ...
1
vote
0
answers
641
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 ...
1
vote
1
answer
430
views
UltiSnips regex macthing
I want the possibility of transforming an inline equation in latex to a display equation.
So I want $something$ to become
$$
something
$$
My attempt was this:
snippet "$(.+)$" "...
0
votes
0
answers
33
views
after compilation in Vim : cursor in gg
I'm french... sorry for my english
I try to compile files (.tex, .md ... using vim). I open terminal and make the compilation ; just before the compilation i save the file and put a marker in the ...
1
vote
1
answer
209
views
Comments for github flavored markdown with vim-commentary
vim-commentary is a great plugin for commenting and uncommenting lines. However if some filetype isn't supported, as per documentation, one can do the following: (see FAQ)
autocmd FileType apache ...
2
votes
1
answer
70
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 ...
-1
votes
1
answer
685
views
Markdown folding in vim 8.2
I'm using vim 8.2 on Win 10. I want to enable markdown folding with the built-in markdown.vim.
But it will not work. I have tried solutions from other questions (e.g., Enable Expr Folding in Markdown ...
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" - ...
1
vote
0
answers
20
views
Doxygen LaTeX syntax
I am using doxygen to document my code and I like to have additional markdown files which include formulas by using \f$ Formula \f$.
I know markdown syntax provided by the vim-markdown plugin supports ...
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 ...
0
votes
1
answer
602
views
How to set a command as a file type specific autocommand
I would like the :Toc command to call :Voom in R markdown files and :VimtexTocOpen in latex files.
First try:
au BufRead,BufNewFile *.Rmd command! Toc Voom
au BufRead,BufNewFile *.tex command! Toc ...
0
votes
3
answers
164
views
Table of content for R markdown files
My workflow is to perform data analysis in R markdown files. They are a mix of text and code chunks, pretty much like jupyter notebooks for python. These files can get long with time and I like to ...
0
votes
0
answers
28
views
How can I display text differently from how it is actually stored?
I am making a custom syntax partially based on Markdown. I want to display links differently from how they are stored in the file. For example, [About me](about.md) in the file should be displayed as ...
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 ...
2
votes
3
answers
300
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 ...
3
votes
0
answers
310
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 ...
1
vote
1
answer
532
views
How to use vim-markdown :Toc: for documents with extension other than .md
When editing long markdown documents it is really good to be able to navigate in them with the :Toc option from vim-markdown.
I also edit long .Rmd documents from vim (when the content is more about ...
1
vote
1
answer
487
views
How to use TexMathZones in Markdown Syntax, for Snippets?
I am a recent and very happy Vim User.
I write Mathematics and Computer Science Lecture Notes in Markdown Files, organized in a Vimwiki.
I use the UltiSnips Snippet Plugin.
This plugin provides me ...
2
votes
1
answer
660
views
Disable trailing whitespace lint warnings for Markdown file
I use vim 8 and ALE plugin. On a markdown page, I see the following from ALEInfo
Current Filetype: markdown
Available Linters: ['alex', 'languagetool', 'markdownlint', 'mdl', 'proselint', 'redpen', '...
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 ...
2
votes
0
answers
62
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><...
1
vote
1
answer
562
views
How to use code highlighting and checking in markdown?
In writing markdown files, I may use code blocks with ``` and `. Is there a way I can use code highlighting and checking on just the code blocks inside markdown files?
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 ...
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 ...
1
vote
1
answer
142
views
Vim syntax group not stopping
I recently upgraded to vim 8.2.0100 on Mac, and the markdown highlighting appears to have changed to be buggy.
Here is an example:
Normal syntax *Highlighting has started* Highlight continues
...
1
vote
2
answers
228
views
How to prevent markdown folding of # comments in fenced code?
I have python examples in a markdown file in a code fence (e.g. when I convert a jupyter notebook into a markdown document). These snippets sometimes have code comments in them starting with #. The ...
2
votes
1
answer
267
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 ...
1
vote
1
answer
343
views
Enable Expr Folding in Markdown
I want to fold in markdown using the built in markdown plugin that I believe should come with the version of vim I have (Vi IMproved 8.1 (2018 May 18, compiled Apr 23 2019 20:02:08)).
I am struggling ...
0
votes
2
answers
220
views
Finding Markdown image tags with regular expressions (E486)
I have a document that contains lines like

This is the format for images in Markdown.
I have constructed a regular expression which I believe should be able to find ...
0
votes
1
answer
23
views
markdown html-element syntax highlighting fails when line has leading spaces
For some reason, my html elements stop being highlighted when they are preceded by 4 or more spaces. I use spaces to do indentation for nested elements, so this is quite unfortunate. This only ...