diff --git a/lazy-lock.json b/lazy-lock.json index 1303ad7..e9f986d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -8,6 +8,7 @@ "codecompanion.nvim": { "branch": "main", "commit": "d4c00c29ffa49a9eda117099916168e32aa12e09" }, "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, "contextfiles.nvim": { "branch": "main", "commit": "d5d0525c32777366e5c415fdb682444ce9f753f8" }, + "csvview.nvim": { "branch": "main", "commit": "f190de76d2eca0380ddcb2425cd582d740699b55" }, "dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "everforest-nvim": { "branch": "main", "commit": "a0e9edc57379e8feafc6ba207c26dbb12fc1b6d8" }, diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 4cf8d3d..df7ed3e 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -9,5 +9,6 @@ return { -- timeout_ms = 500, -- lsp_format = "fallback", --}, - }, + --}, } +} diff --git a/lua/plugins/csvview.lua b/lua/plugins/csvview.lua new file mode 100644 index 0000000..8610dcb --- /dev/null +++ b/lua/plugins/csvview.lua @@ -0,0 +1,37 @@ +return { + "hat0uma/csvview.nvim", + config = function() + local csvview = require("csvview") + + -- Optional setup configurations + csvview.setup({ + view = { + display_mode = "border", -- Options: "border", "key", "simple" + }, + 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" } }, + }, + }) + + -- Auto-enable for csv and tsv filetypes + vim.api.nvim_create_autocmd("FileType", { + pattern = { "csv", "tsv" }, + desc = "Enable CSV View on relevant filetypes", + callback = function() + csvview.enable() + end, + }) + end, +} +