A neovim plugin for debugging pandas and polars DataFrames.
visidataframe.nvim_demo.mov
{
"nelnn/bear.nvim",
dependencies = {
"mfussenegger/nvim-dap",
},
}Default Confguration
{
"nelnn/bear.nvim",
dependencies = {
"mfussenegger/nvim-dap",
},
opts = {
cache_dir = "~/.cache/nvim/bear",
file_name = "tmp_" .. os.date("%m%d_%H%M%S") .. ".csv",
remove_file = true, -- remove file upon quitting visidata
window = {
width = 0.9,
height = 0.8,
border = "rounded"
},
keymap = {
visualise = "<leader>df",
visualise_buf = "<leader>bdf",
exit_terminal_mode = "<C-o>",
}
},
config = function(_, opts)
local df_visidata = require("bear")
df_visidata.setup(opts)
end,
ft = { "python" },
}
<leader>df/<leader>dfbto view the dataframe under the cursor.<leader>df/<leader>dfbin the repl session and input the dataframe variable.<C-o>to exit from terminal to normal mode andito enter. This is useful when you want to change buffers.qto close floating window or buffer in normal and terminal mode.
You can see my debugging setup here.
| Command | Action |
|---|---|
| DFView | View dataframe in a floating window |
| DFViewBuf | View dataframe in a new buffer |
| DFClean | Clear cache directory |
Note
I am not knowledgeable in lua. PRs for code refactor and new features are more than welcome.