Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oknozor/illumination

A mardown renderer for nvim written with gtkrs and neovim-lib
https://github.com/oknozor/illumination

gtk gtk-rs markdown neovim neovim-guis neovim-plugin rust webkit2gtk

Last synced: about 2 months ago
JSON representation

A mardown renderer for nvim written with gtkrs and neovim-lib

Awesome Lists containing this project

README

        

# Nvim Illumination : A lightweight GTK live preview for your notes

---
> An illuminated manuscript is a manuscript in which the text is supplemented with such decoration as initials, borders (marginalia) and miniature illustrations. In the strictest definition, the term refers only to manuscripts decorated with either gold or silver; but in both common usage and modern scholarship, the term refers to any decorated or illustrated manuscript from Western traditions.

From Wikipedia, the free encyclopedia

---
Nvim Illumination is a simple Neovim plugin to render buffers in a WebKit2Gtk window. Since it uses the Neovim rpc-api to send buffer updates, ⚠️ **it will not work with vim** ⚠️.

Note that unlike many note rendering plugins Illumination does not render files, it renders your buffer directly via [nvim rpc api](https://neovim.io/doc/user/api.html), it means you don't need to save the current buffer to render your notes, it is really live!

Issues and PRs are welcome!

![example screenshot](screenshots/demo.png)

## Intallation

### Manual installation
---

```sh
git clone https://github.com/oknozor/illumination/
cd illumination
./install
```

### Using vim-plug

#### Requirement

- [vim-plug](https://github.com/junegunn/vim-plug) obviously
- [Rust](https://www.rust-lang.org/) with cargo as a package manager
- You need to have `$HOME/.cargo/bin/` in your `$PATH` :
you can add the following line in your bashrs, zshrc or /etc/profile : `export PATH="$HOME/.cargo/bin:$PATH"`

```vim
Plug 'oknozor/illumination', { 'dir': '~/.illumination', 'do': '.install.sh' }
```

## Usage

| Command | Description |
| ---------------- |:---------------------------------------------:|
| :Illuminate | Start rendering the current buffer |
| :IlluminateClose | Close Illumination |
| :IlluminateLock | Toggle lock (won't change active buffer) |
| :IlluminateOpen | Render a local file or an URL and toogle lock |

## Debug

To debug Illumination start nvim in RPC mode on port `6666` :

```
nvim test.md --listen 127.0.0.1:6666
```

Then run Illumination without cargo `--release` option.

```
cd illumination
cargo run
```