https://github.com/gpanders/vim-medieval Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gpanders / vim-medieval Public * Notifications You must be signed in to change notification settings * Fork 7 * Star 117 Evaluate Markdown code blocks within Vim License MIT license 117 stars 7 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights gpanders/vim-medieval master BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 55 Commits autoload autoload doc doc ftplugin ftplugin LICENSE LICENSE README.md README.md View all files Repository files navigation * README * MIT license vim-medieval Evaluate Markdown code blocks within Vim. asciicast Description Medieval allows you to evaluate code blocks in Markdown buffers of the following form: ```bash echo "Hello world!" ``` By placing your cursor anywhere in the code block above and running :EvalBlock, Medieval will print the result of evaluating the block (in this case, it will echo "Hello world!") You can send the output of evaluation into another code block, allowing you to do a primitive style of literate programming. You can accomplish this by adding a "target" parameter to your code block and creating a second code block with a "name" parameter. The output of the evaluation of your code block will be redirected to the targeted block. For example: ```python print([x*x for x in range(5)]) ``` ``` ``` If you run :EvalBlock in the first code block, the second block will become ``` [0, 1, 4, 9, 16] ``` Medieval can do a lot more. Read :h medieval for the full documentation. Create a mapping Medieval does not create any mappings by default, but you can easily create one yourself by adding the following to the file ~/.vim/after/ ftplugin/markdown.vim (create it if it does not yet exist): nmap Z! (medieval-eval) Limitations For now, Medieval only works in Markdown buffers. If you'd like to see support added for other file types, please see the Contributing section. Contributing Please feel free to contribute changes or bug fixes. You can send patches to git@gpanders.com or submit a pull request on GitHub. About Evaluate Markdown code blocks within Vim Topics vim markdown literate-programming Resources Readme License MIT license Activity Stars 117 stars Watchers 5 watching Forks 7 forks Report repository Contributors 4 * * * * Languages * Vim Script 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.