krady21/compiler-explorer.nvim

github github
media
star 59
stars
alert-circle 0
open issues
users 2
subscribers
git-branch 1
forks
CREATED

2021-09-13

UPDATED

1 hour ago


compiler-explorer.nvim

Neovim lua plugin used for interacting with compiler-explorer and supercharged by vim.ui, vim.notify and vim.diagnostic.

Demo

Preview

Dependencies

Optional dependencies

Installation

  • packer

    require('packer').startup(function()
    use {
      'krady21/compiler-explorer.nvim', requires = { 'nvim-lua/plenary.nvim' }
    }
    end
    
  • paq

    require("paq") {
    {'krady21/compiler-explorer.nvim'};
    {'nvim-lua/plenary.nvim'};
    }
    
  • vim-plug

    Plug 'krady21/compiler-explorer.nvim'
    Plug 'nvim-lua/plenary.nvim'
    

Configuration

compiler-explorer.nvim works out of the box without configuration. If you want to change some of its options (like using a local instance of compiler-explorer), you can do so through the setup() function. You can find all the options here.

require("compiler-explorer").setup({
  url = "http://localhost:10240",
  open_qflist = true,
  autocmd = {
    enable = true,
    hl = "Search",
  }
})

Commands

  • CECompile
  • CEFormat
  • CEAddLibrary
  • CELoadExample
  • CEShowTooltip (local to assembly buffer)
  • CEGotoLabel (local to assembly buffer)

API Coverage:

  • GET /api/languages
  • GET /api/compilers/<lang-id>
  • GET /api/libraries/<lang-id>
  • GET /api/shortlinkinfo/<link-id>
  • POST /api/compiler/<compiler-id>/compile
  • GET /api/formats
  • POST /api/format/<formatter>
  • GET /api/asm/<instruction-set>/<instruction>
  • GET /source/builtin/list
  • GET /source/builtin/load/<lang-id>/<example-id>

Inspiration

The async.lua and alert.lua modules are either inspired or taken directly from gitsigns.nvim .