7

I am looking for for a Markdown editor that can display inline images, is largely compatible with pandoc syntax, supports most common vim-keybindings, and runs on Linux.

I am currently using gvim with vim-pandoc for syntax highlighting, but there is no support for displaying images inside gvim. Newer markdown editors like Abricotine, looks great and can display inline images, but I can't find one that supports vim-bindings or most of the pandoc spec.

The closest I have found is to preview the document in a separate window, but I would prefer to be able to display and edit the content (including images) in one window instead of in two different windows

Update 2021-03-03 I use markdown both for notetaking and writing longer articles, so it would be ideal with a program that is nimble yet capable (like vim), rather than a full blown IDE, but I'm open to suggestions for either.

7
  • Have you checked other pandoc questions tagged markdown, especially those with answers? Doesn't any of their solution fit your requirements?
    – Izzy
    Mar 14, 2016 at 12:37
  • Thanks @Izzy, most of those are about mac or web markdown editors, or markdown conversion tools. The closest I have found is to preview the document in a separate window, but I would prefer to be able to display and edit the content (including images) in one window instead of in two different windows. Mar 14, 2016 at 17:45
  • Thanks for checking! May I suggest you edit that into your question, so it becomes obvious to potential answerers? Not everybody scans comments ;) I've tried a bunch of those editors, but I didn't check for pandoc&vim so I cannot give a recommendation here myself. However, I didn't encounter any editor not having a separate window for the preview, so I'm afraid it already fails at this place. Though I've not explicitly checked for that (I'm fine with seeing the Markdown I write).
    – Izzy
    Mar 14, 2016 at 17:54
  • Have you tried haroopad?
    – sebelk
    Jan 10, 2017 at 3:27
  • @sebelk yes, last time I used it there was no support for inline images rendered in the editor. Has that changed? Jan 10, 2017 at 21:05

3 Answers 3

1

One possible workaround, if a little overkill, is to use a jupyter notebook in a browser window - you will get each cell rendered as you go from cell to cell and you could always have a function at the top that saves the other notebook cells and renders the document through pandoc.

The majority of the markdown used in jupyter/ipython is the same as the pandoc markdown and I am sure that a little tailoring could support the rest & you can definitely have images embedded.

1

You can also use Rstudio or Visual Studio Code

rstudio

rstudio Desktop is free and has evolved to a multi-language IDE in recent years.

rstudio assumes that you want to write Markdown in their own dialect RMarkdown, which is basically pandoc markdown with R code chunks embedded by you and denoted with {r}. However you can also edit .md files directly. rstudio compiles ("knits") .Rmd via intermediate .md to .html, .docx, and other file types.

There is a Vim mode and you can tell the IDE if you want to display images inline, with a placeholder, or in a preview pane.

rstudio looks for R on startup, so you need to install R first.

VS Code

With VSCode comes with good built-in markdown support, you can install VIm Keybindings as an Extension, and also some more Extensions for enhancing the Markdown Preview capabilities.

2
  • Thanks for the reply! I looked at vscode and it is really nice with the full neovim extension, but I think it only offers images in preview panes. I didn't realize RStudio could display markdown images inline, which is a nice feature. I think both are a bit heavy for my notetaking purposes, especially RStudio, but they are nice alternatives to be aware of (and I realize I didn't specify anything about notetaking initially so added it now). Mar 4, 2021 at 19:32
  • The built-in Markdown capablities of VSCode get expanded all the time, by the way. Take another look, next year.
    – knb
    Mar 5, 2021 at 8:37
1

Update After having several issues with emacs, I have switched back to vim for editing md files, which I think is an overall much nicer experience even though it doesn't render images inline (yet...).

To improve the image workflow I use the md-img-paste plugin and a custom command to open images when clicking them (you could also use gx for the default fileviewer):

" cd is needed for feh to reload the filelist correctly
nnoremap <leader>I :!cd <cfile>:p:h && feh --scale-down --reload 5 --no-jump-on-resort --start-at <cfile>:t &<CR><CR>

I have a few other flags also and use i3 to stack it above my vim window, but they are not technically needed.


Original emacs post:

I would never have guessed it at the time I posted this question, but the most suitable editor for my purposes seems to be... Emacs! I recently started using Emacs to try out the feature-filled org-mode for note taking. It turns out that it has all the features I was looking for!

  • Vim bindings are provided via evil-mode, which can be configured separately and is installed by default in the Spacemacs distribution of Emacs (this is what I use, it comes with many nice defaults).
  • Pandoc syntax highlighting - Markdown mode enables syntax highlighting for pandoc markup elements (there is also Pandoc mode, which I have not tried myself). It is possible to define custom export commands and view the output in the built-in Emacs browser. Markdown mode also enables folding of headings similar to vim-pandoc.
  • Inline-images - Images can be viewed inline in both Markdown mode and org-mode, as long as imagemagick is installed and supported by your version of Emacs. The functions used in org-mode can be found here (to be fair, I have had some troubles with inline images in markdown mode, but I haven't looked too much into it since I use org-mode for note taking now).

Other aspects I appreciate of Emacs include the possibility to search among existing functions and keybindings and org-mode's time-keeping and task management features. To be clear, I still use vim for editing files via terminal, but for taking notes I use Emacs with org-mode and it's great!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.