Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes

Convenient way to surround block with markdown codeblock backticks

Presuming your lines are already formatted as a paragraph as in your example, you can type: cip```Enter```EscP. You can substitute in any motion/text object for ip if you want to surround other things....
Rich's user avatar
  • 32.1k
4 votes
Accepted

Can I somehow define the file type in some meta-data?

some metadata, embedded into file comments, could be given in the file content itself This is exactly what a modeline does. You can set (some) options for the current buffer from this line. See :help ...
Friedrich's user avatar
  • 2,125
2 votes

Convenient way to surround block with markdown codeblock backticks

If you have to do that often I would introduce the following mapping: vnoremap Sq <esc>o```<esc>gvo<esc>O```<esc>gv Then you can select your lines and hit Sq to surround them ...
Vivian De Smedt's user avatar
2 votes

Can I somehow define the file type in some meta-data?

What in Vim set the filetype: The filetype detection is made of several layers: $VIMRUTIME/filetype.vim set a number of autocmd to detect the filetype of the buffer vimfiles/ftdtect/*.vim set another ...
Vivian De Smedt's user avatar
2 votes

Convenient way to surround block with markdown codeblock backticks

Turning common but overly expensive sequences of commands into convenient mappings is an integral part of the Vim experience. If you can clearly express that sequence of commands it is generally ...
romainl's user avatar
  • 41.1k
1 vote
Accepted

Any Neovim plugins for formatting Markdown text?

The VimWiki plugin support the markdown syntax on top of its own syntax. It comes with a number of mappings that help editing markdown files in particular: headings list table They are documented. ...
Vivian De Smedt's user avatar
1 vote

Convenient way to surround block with markdown codeblock backticks

I use my template engine for this task, but it can be done with simple mappings. Notes: I consider this should be enabled only for markdown buffers. -> ftplugin + <buffer> (for Doxygen ...
Luc Hermitte's user avatar
  • 17.4k
1 vote

How to see all the sections when folding Markdown?

The vim-markdown-folding plugin does exactly what I needed out of the box.
Florent2's user avatar
  • 133
1 vote
Accepted

Add new filetype syntax to markdown code fence

The following answer that explain how to have C section within an Haskell program. Remark: You could also be interested by the @IngoKarkat SyntaxRange plugin.
Vivian De Smedt's user avatar
1 vote

Convenient way to surround block with markdown codeblock backticks

If you use the surround.vim plugin: let b:surround_{char2nr('c')} = "```\n\r\n```" Now you can use for instance yssc or vipSc. If you want a solution without a plugin and prefer a function ...
qadzek's user avatar
  • 11
1 vote
Accepted

Highlight link description in vimwiki

With these additions to the Vimwiki syntax: ~/.vim/after/syntax/vimwiki.vim syn match VimwikiLinkDelimiter /\[\([^\\\]]*\]\)\@=/ conceal syn match VimwikiLinkDelimiter /\(\[[^\\\]]*\)\@<=\]/ ...
Vivian De Smedt's user avatar
1 vote
Accepted

How to jump between markdown code chunk fence?

I would use the matchit plugin that comes in modern version of Vim. You can install it with: packadd! matchit Or from GitHub and vim-plug with: Plug 'chrisbra/matchit' To match the ``` fence you ...
Vivian De Smedt's user avatar
1 vote

Neovim Markdown toggling bold keybind

I usually use surround.vim for this. You could do nmap <buffer> <your keys> ysiw* nmap <buffer> <more keys> ds* In ~/.vim/after/ftplugin/markdown.vim or equivalent. Make sure ...
D. Ben Knoble's user avatar
  • 26.4k
1 vote
Accepted

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

Try with the following Vim Command: set cole=0
Kröhnkite's user avatar
1 vote

Highlight double space in markdown

Special Character for Trailing Spaces Conceal highlighting A great addition to highlighting is to take advantage of concealing to show a special character on your syntax match. I prefer doing this ...
Rob Mosher's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible