Skip to content

apayu/nvim-elixir-inspect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

nvim-elixir-inspect

A Neovim plugin that helps you debug Elixir code by quickly inserting IO.inspect/2 statements with the current function name as label.

Features

  • Quickly insert IO.inspect statements with customizable prefix symbol
  • Automatically detects and uses current function name as label
  • Maintains proper indentation

Installation

Using lazy.nvim:

{
  "apayu/nvim-elixir-inspect",
  config = function()
    require("elixir-inspect").setup()
  end,
}

Using packer.nvim:

use {
  "apayu/nvim-elixir-inspect",
  config = function()
    require("elixir-inspect").setup()
  end
}

Configuration

The plugin comes with these defaults:

require("elixir-inspect").setup({
  -- Symbol prefix for IO.inspect output
  symbol = "🔍 >>>>>>>",
  -- Default insert mode keymap
  keymap_insert = "<C-e>i"
})

Usage

Via Command

Use the :InsertIOInspect command to insert an IO.inspect statement at the current cursor position.

Via Keymap

In insert mode, press <C-e>i (or your configured keymap) to insert an IO.inspect statement.

Example Output

If you're in a function named process_data, the plugin will insert:

IO.inspect("🔍 >>>>>>>", label: "process_data")

The inserted statement will maintain the current line's indentation.

Customization

You can customize the plugin behavior by passing options to the setup function:

require("elixir-inspect").setup({
  -- Change the inspect prefix symbol
  symbol = "DEBUG >>>",
  -- Change or disable the insert mode keymap
  keymap_insert = "<C-x>i", -- or set to false to disable
})

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages