• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Evaluate Markdown code blocks within Vim

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:

<!-- target: squares -->
```python
print([x*x for x in range(5)])
```

<!-- name: squares -->
```
```

If you run :EvalBlock in the first code block, the second block will become

<!-- name: squares -->
```
[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 <buffer> Z! <Plug>(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 [email protected] or submit a pull request on GitHub.

More Repositories

1

editorconfig.nvim

EditorConfig plugin for Neovim
Fennel
308
star
2

ijq

Interactive jq (mirror)
Go
135
star
3

nvim-parinfer

parinfer for Neovim
Fennel
112
star
4

nvim-moonwalk

Use any language that compiles to Lua in your Neovim configuration
Lua
57
star
5

vim-oldfiles

Improve Vim's native recent file history
Vim Script
27
star
6

meta-scipy

OpenEmbedded layer for scipy (ARCHIVED)
BitBake
20
star
7

fennel-repl.nvim

A Fennel REPL that runs in Neovim
Fennel
19
star
8

colmap-docker

Dockerized COLMAP
Shell
15
star
9

fzy.zig

Rewrite of fzy in Zig (mirror)
Zig
15
star
10

esp32-zig-starter

Starter project for using Zig with ESP IDF
Zig
12
star
11

fzf-prezto

fzf module for prezto zsh framework
Shell
12
star
12

ztags

Generate tags files for Zig projects
Zig
12
star
13

dotfiles

Mirror
Fennel
12
star
14

vim-scdoc

Vim runtime files for scdoc
Vim Script
5
star
15

vitis_example

Example project for Xilinx Vitis
Tcl
5
star
16

zynqmp-boot-apps

Generate and install boot apps for the Zynq MPSoC device
Makefile
5
star
17

passage

Password store using age
Rust
4
star
18

nvim-scpaste

Fennel
4
star
19

gnss-signal-processing

GNSS Signal Processing (ASE 389P-7) [Spring 2017]
MATLAB
3
star
20

pushbroom

Sweep your filesystem free of clutter
Python
3
star
21

homebrew-tap

Custom Homebrew formulae
Ruby
2
star
22

adventofcode

Zig
2
star
23

fpga-design-template

Project template for Xilinx-based FPGA designs
Tcl
2
star
24

7guis

Swift
1
star
25

DragIt

Source for the DragIt! Chrome/Chromium extension
JavaScript
1
star
26

vim-man

Read man pages in Vim
Vim Script
1
star
27

slackbots-cli

JavaScript
1
star
28

acciobook

Python
1
star
29

meshtool

Data analysis tool for 3D surface meshes
C++
1
star