Willem-J-an/visidata.nvim

github github
debugging
stars 17
issues 0
subscribers 1
forks 0
CREATED

2024-03-19

UPDATED

last month


visidata.nvim

A plugin for neovim to render pandas dataframes in nvim-dap using the power of visidata.

Installation

  • Requires nvim-dap
  • Requires visidata to be available in the active python environment
  • Install like any other neovim plugin:
    # Using: lazy
    {
         "Willem-J-an/visidata.nvim",
        dependencies = {
            "mfussenegger/nvim-dap",
            "rcarriga/nvim-dap-ui"
        },
        config = function()
            local dap = require("dap")
            dap.defaults.fallback.external_terminal = {
                command = "<Path to your terminal of choice>",
                args = { "--hold", "--command" },
            }
            vim.keymap.set("v", "<leader>vp", require('visidata').visualize_pandas_df, { desc = "[v]isualize [p]andas df" })
        end,
    }

Usage

  1. Configure an external-terminal for nvim-dap
  2. Configure a keymap to execute the visualize_pandas_df function.
  3. Configure your dap session to use externalTerminal:
{
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "externalTerminal"
}
  1. Debug your code as usual, load a pandas dataframe, add a breakpoint after it.
  2. Select the pandas dataframe and execute the keymap.