Questions tagged [filetype-markdown]

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

Filter by
Sorted by
Tagged with
3 votes
4 answers
435 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
  • 349
1 vote
1 answer
44 views

Highlight link description in vimwiki

I'm trying to customize the colorscheme One for Markdown under Vimwiki. I'd like to change the color of the Description in [Description](URL). In my .vimrc I have the following relevant lines: call ...
Ludenticus's user avatar
0 votes
1 answer
28 views

How to jump between markdown code chunk fence?

Is there a way to jump between beginning and end of a markdown based code chunk? I know I can use / to search for the code chunk markers (e.g. /```) but I was hoping there was a way to do like we can ...
alejandro_hagan's user avatar
1 vote
0 answers
20 views

How to use different comment string for yaml blocks inside markdown files?

Many markdown implementations allow for a leading yaml configuration block like so: --- title: "My title" date: 2023-12-29 --- ## Heading Some markdown text With the vim commentary plugin,...
joelostblom's user avatar
0 votes
1 answer
119 views

Neovim Markdown toggling bold keybind

I am trying to make it so I can have a keymap for toggling things like bold in a markdown file. I used to use vscode with the markdown plugin and they offered the option to, with a simple keybind, ...
Educpf's user avatar
  • 33
1 vote
1 answer
259 views

Cannot make vim-markdown conceal the formatted text

I am quite new to Neovim, just installed some of the important plugins and now I wanted to make it really good for writing Markdown files. I installed vim-markdown for that, and followed the ...
Educpf's user avatar
  • 33
0 votes
1 answer
183 views

(nvim-treesitter) How to disable hyperlink highlighting in tree-sitter-markdown?

I installed tree-sitter-markdown in my nvim for editing the md files. However, it seems it highlights the links and hides the url part. This often annoys me when I edit url/paths. You can see it in ...
Garid's user avatar
  • 103
0 votes
0 answers
73 views

How to detect whether current cursor position is code-block in markdown file from lua function?

Target: Trying to write lua function that will return true if current cursor position in code-block in markdown, false if not. Current Status: I have following code, that (based on tree-sitter) ...
Garid's user avatar
  • 103
1 vote
2 answers
430 views

Vim in Alacritty and inside tmux cannot display italic text

I am trying to have a better visualization while editing Markdown file in vim, I try to visualize the italic and bold text. However, I found the bold italic text work, while the italic itself doesn't ...
Solarisending's user avatar
0 votes
0 answers
24 views

How to auto add char at the head of line when hit enter in markdown file?

I write markdown in vim. When I write something in list. The format will be * item1 * item2 * item3 What I want is, when I finish item1 then press enter. A * char can auto add to the head of next ...
lizhe's user avatar
  • 137
1 vote
0 answers
293 views

How to auto-update an ordered lists numbering with vim? (Markdown file)

I use a plugin called bullet.vim. I am able to press enter and the numbered list increases from 1 too 2. Normal stuff. But if I have a list where I want to insert a new bullet between bullets, the ...
Vinn's user avatar
  • 731
1 vote
1 answer
99 views

How to have word count exclude markdown markup symbols?

I'm trying to use Vim 9 for write documentation, but the word count function (g<C-g>) is inaccurate when use it with markdown. When I edit a markdown file it count the markup symbols like #. How ...
Moqtite's user avatar
  • 33
2 votes
1 answer
154 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
2 votes
3 answers
291 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
3 votes
0 answers
413 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
2 votes
0 answers
252 views

vim-fugitive support for diff --color-words

I use vim and git primarily for editing prose documents in LaTeX or Markdown, not for coding. For this reason, my go-to git diff command is git wdiff, where the relevant part of .gitconfig reads ...
Alex Roberts's user avatar
1 vote
1 answer
86 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 already tried :source and :...
Tokubara's user avatar
  • 167
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
2 votes
1 answer
391 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
0 votes
1 answer
392 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 ...
Stefan's user avatar
  • 179
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
2 votes
1 answer
288 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 ...
ban_javascript's user avatar
0 votes
1 answer
223 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 ...
nijoakim's user avatar
  • 163
0 votes
1 answer
971 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:...
raylight's user avatar
  • 525
4 votes
1 answer
69 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
0 votes
0 answers
1k 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 ...
Tomas Willebrand's user avatar
2 votes
1 answer
330 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 ...
Ben's user avatar
  • 21
1 vote
0 answers
761 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 ...
sghosh's user avatar
  • 11
6 votes
1 answer
648 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
0 votes
0 answers
273 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 ...
Steven Lu's user avatar
  • 2,249
2 votes
1 answer
181 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 ...
Serge Stroobandt's user avatar
1 vote
1 answer
248 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|...
hong's user avatar
  • 13
0 votes
2 answers
159 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'...
wdb's user avatar
  • 101
2 votes
1 answer
440 views

How to replace [ with ( in vim

I have this markdown line, ![Home][screenshots/home.png] I want to replace it with, ![Home](screenshots/home.png) So, I tried this, :%s/[s/(s/g Vim(version 81) says pattern not found.
atheros's user avatar
  • 125
2 votes
1 answer
337 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 ...
Ludenticus'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
1 vote
1 answer
809 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 "$(.+)$" "...
Ricardo Kullock's user avatar
0 votes
0 answers
38 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 ...
FrenchVimLaTeXMarkdown's user avatar
1 vote
1 answer
380 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 ...
mahbubweb's user avatar
  • 592
2 votes
1 answer
123 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 ...
JohnDoe's user avatar
  • 363
-1 votes
1 answer
1k 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 ...
Paperclip Bob's user avatar
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
1 vote
0 answers
33 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 ...
rsaavedra's user avatar
  • 121
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
0 votes
1 answer
1k 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 ...
Paul Rougieux's user avatar
1 vote
3 answers
261 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 ...
Paul Rougieux's user avatar
1 vote
0 answers
35 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 ...
Flux's user avatar
  • 1,021
4 votes
0 answers
367 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
2 votes
3 answers
472 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 ...
Kevin Powell's user avatar
3 votes
0 answers
515 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