Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Integrate foundry toolkit tool chisel(solidity REPL) with neovim

Notifications You must be signed in to change notification settings

TheSnakeWitcher/chisel.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chisel.nvim

These plugin is now deprecated, it was moved to foundry.nvim. Small plugin to more conveniently/easily interact with chisel from foundry toolkit inside neovim. Any contributions are welcome and appreciated.

Index

  1. Installation
  2. Configuration
  3. Documentation
  4. License

Installation

Install using your prefered package manager. Next code snippet corresponds to packer.

use {
    "TheSnakeWitcher/chisel.nvim",
    requires = {
        "nvim-lua/plenary.nvim",
        "akinsho/toggleterm.nvim",
        "nvim-telescope/telescope.nvim",
    },
}

Configuration

Chisel.nvim doesn't register by default commands or keybindings so you can personalize to whatever suits you. This section comes with some configurations recipes/recommendations/samples.

Options

Default configuration options next.

require('chisel').setup({

    -- others options are `vertical` or `horizontal` which corresponds to toggleterm
    open_direction = "float"   -- terminal direction when executing chisel.open
    load_direction = "float"   -- terminal direction when executing chisel.load
    view_direction = "float"   -- terminal direction when executing chisel.view

})

Commands

local chisel = require("chisel")

vim.api.nvim_create_user_command("Chisel", function(opts)
    local args = opts.fargs
    if #args== 0 then
        chisel.open()
    else
        chisel.load(args[1])
    end
end,{
    desc = "launch a new chisel REPL, if an optional argument {id} was passed loads the corresponding cached session",
    nargs = "?",
})

vim.api.nvim_create_user_command("ChiselView", function(opts) chisel.view(opts.fargs[1]) end, {
    desc = "displays chisel sessions source code with {id}",
    nargs = 1,
})

vim.api.nvim_create_user_command("ChiselClearCache", chisel.clear_cache , {desc = "deletes all cache sessions"})

Telescope integration

In some place of your telescope config put.

telescope.load_extension("chisel")

To use it you can run next command or map it to some keybinding.

:Telescope chisel

Documentation

See chisel

License

MIT

About

Integrate foundry toolkit tool chisel(solidity REPL) with neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages