From 1f7dbe05a2643244f146b4739783ca0bfe0d01d9 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Fri, 25 Jul 2025 14:21:05 -0400 Subject: [PATCH] Add csvview plugin --- nvim/.config/nvim/lua/plugins/csvview.lua | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 nvim/.config/nvim/lua/plugins/csvview.lua diff --git a/nvim/.config/nvim/lua/plugins/csvview.lua b/nvim/.config/nvim/lua/plugins/csvview.lua new file mode 100644 index 0000000..aea72a6 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/csvview.lua @@ -0,0 +1,26 @@ +return { + "hat0uma/csvview.nvim", + ---@module "csvview" + ---@type CsvView.Options + opts = { + parser = { comments = { "#", "//" } }, + keymaps = { + -- Text objects for selecting fields + textobject_field_inner = { "if", mode = { "o", "x" } }, + textobject_field_outer = { "af", mode = { "o", "x" } }, + -- Excel-like navigation: + -- Use and to move horizontally between fields. + -- Use and to move vertically between rows and place the cursor at the end of the field. + -- Note: In terminals, you may need to enable CSI-u mode to use and . + jump_next_field_end = { "", mode = { "n", "v" } }, + jump_prev_field_end = { "", mode = { "n", "v" } }, + jump_next_row = { "", mode = { "n", "v" } }, + jump_prev_row = { "", mode = { "n", "v" } }, + }, + }, + cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" }, + init = function() + vim.keymap.set("n", "ce", ":CsvViewEnable display_mode=border header_lnum=1") + vim.keymap.set("n", "cd", ":CsvViewDisable") + end +}