Skip to content

h8rtv/diagon.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diagon.nvim

Wrapper for Diagon directly inside neovim. Rewrite of the vim-diagon plugin using lua and plenary to communicate with the diagon CLI.

Prerequisites

Diagon CLI is necessary. It can be installed from the Snap Store.

sudo snap install diagon

Installation

Using lazy.nvim:

{
  'h8rtv/diagon.nvim',
  cmd = 'Diagon', -- Load only when the Diagon command gets called
  lazy = true,
  opts = {},
  dependencies = {
    { 'nvim-lua/plenary.nvim' },
  },
},

Usage

Write your Diagon input and visually select it. Then run the command :Diagon <translator>. It will write the output in the current buffer. You can select inside a comment block and the output will be commented too.

Screencast.from.20-12-2023.18.54.44.webm

Configuration

These are the default configuration options. You can pass it to the require('diagon.nvim').setup(...) function. In lazy, you can use the opts property.

local defaults = {
    pos = 'substitute', -- 'above' | 'below' | 'substitute' -- You can select the result will substitute de input, be written above or bellow.
    translators = { -- You can select the allowed translators.
        'Math',
        'Sequence',
        'Tree',
        'Table',
        'Grammar',
        'Frame',
        'GraphDAG',
        'GraphPlanar',
        'Flowchart',
    },
}

Credits

Diagon

vim-diagon

About

Diagon wrapper for neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published