csvview
This commit is contained in:
1 parent
c57f525bd9
commit
e33c310517
3 files changed
+40
-1
No files matched your search
@@ -9,5 +9,6 @@ return {
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_format = "fallback",
|
||||
--},
|
||||
},
|
||||
--},
|
||||
}
|
||||
}
|
||||
@@ -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 <Tab> and <S-Tab> to move horizontally between fields.
|
||||
-- Use <Enter> and <S-Enter> 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 <S-Tab> and <S-Enter>.
|
||||
--jump_next_field_end = { "<Tab>", mode = { "n", "v" } },
|
||||
--jump_prev_field_end = { "<S-Tab>", mode = { "n", "v" } },
|
||||
--jump_next_row = { "<Enter>", mode = { "n", "v" } },
|
||||
--jump_prev_row = { "<S-Enter>", 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,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user