TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Evaluate Markdown code blocks within Vim

68 pointsby pentestercrab7 months ago

10 comments

kolja0057 months ago
Related: I found out about a vim&#x2F;neovim plugin called Molten[1] that tries to be a replacement for Jupyter Notebooks in the terminal. It was a little rough around the edges ~5 months ago when I tried it, but looking at the repo it seems its still being actively developed, so maybe that&#x27;s changed. IIRC it uses an ipynb server to keep track of each cell&#x27;s outputs. I quite enjoyed using it as someone who doesn&#x27;t need notebooks very often and loathes leaving my terminal setup.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;benlubas&#x2F;molten-nvim">https:&#x2F;&#x2F;github.com&#x2F;benlubas&#x2F;molten-nvim</a>
评论 #41983289 未加载
metadat7 months ago
How can you execute the current buffer line as a vim command? I have this shortcut on one of my machines, but it&#x27;s really tough to search the Internet for.<p>It&#x27;s so useful for one-off report generation, I use it daily on my (last remaining) Windoze machine.<p>Vomscript isn&#x27;t that bad! Not any worse than Bash, haha. It turns out that you can get plenty done with only arrays and without a native Map data structure. If you get desperate, use SQLite. <i>*Grin*</i>
评论 #41983127 未加载
评论 #41979481 未加载
dvdkon7 months ago
I like the feature that allows you to put a block&#x27;s output into another block. I&#x27;ve been toying with the idea of self-modifying&#x2F;self-introspecting documents for some time, and I think they&#x27;re a good concept for ad-hoc files in the space between prose, scripts, and databases.
aeonik7 months ago
What I really want is a Notebook experience for the terminal, but output is for each command is automatically stored in separate buffers.<p>Then I can tweak commands, or chain the input from the buffers. (automatically using mkfifo or something)<p>I want my command to history stored in another buffer, and another buffer that I can quickly move the commands and&#x2F;or output to a script or a markdown document for documentation.<p>That way I can quickly debug or build scripts, or perform analysis, and it will automatically have an executable to reproduce all my steps.
评论 #42011598 未加载
abdullahkhalids7 months ago
I created something similar in emacs for markdown [1,2]. The real feature needed is to connect to ipython, so images etc can be embedded into the markdown file as a image link. Don&#x27;t know how to do this.<p>[1] <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;abdullahkhalids&#x2F;83055b1abbd2cdf2416a480d046136e1" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;abdullahkhalids&#x2F;83055b1abbd2cdf2416a...</a><p>[2] Yes, I know about org-mode and I do use it.
评论 #41979970 未加载
VTimofeenko7 months ago
Mdsh also works great in CI-like context[1], but I don&#x27;t think it can eval per block. Definitely trying out medieval for those odd &quot;I want to run this one thing from a README but I don&#x27;t wanna leave vim&quot; cases.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;zimbatm&#x2F;mdsh">https:&#x2F;&#x2F;github.com&#x2F;zimbatm&#x2F;mdsh</a>
sevensor7 months ago
I’m going to link to my own comment here: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41945124">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41945124</a><p>This is super easy in kakoune, requires few keystrokes and no customization, and can be done in any kind of buffer.
aphantastic7 months ago
The “Handy Dandy Notebook” is similar for VS Code, with support for Knuthian literate programming.
评论 #41982034 未加载
jasonventresca7 months ago
This is definitely helpful! Thank you for building it : )
trees1017 months ago
looks like a nice tool for evaluating code blocks directly in Vim&#x27;s Markdown buffers, and the ability to redirect outputs into named blocks is a cool way to keep everything contained in the editor. If you&#x27;re looking for something similar but more versatile across different environments, check out *Cog*. It embeds executable code in any text file and inserts the output back into the document, which is great for automating documentation outside of Vim, especially in CI pipelines.