From 038b342eeccb555744bdb8b517cb6652d417399b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E9=91=AB?= Date: Thu, 13 Mar 2025 10:51:21 +0800 Subject: [PATCH] feat: csv auto command & adds telescope symbols --- lazy-lock.json | 10 +++--- lua/plugins/editing.lua | 68 ++++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index b61f30d..0bec18c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,6 @@ { "actions-preview.nvim": { "branch": "master", "commit": "4ab7842eb6a5b6d2b004f8234dcf33382a0fdde2" }, - "avante.nvim": { "branch": "main", "commit": "cdbfe79097fa2c72578b5560559b88e680f137c8" }, + "avante.nvim": { "branch": "main", "commit": "931a364dad7b4ff9cc583646c3fd5ae69d3dcc61" }, "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -12,7 +12,7 @@ "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, - "grug-far.nvim": { "branch": "main", "commit": "ae74e90423cc851fdc2212e5ca42e99444ca5156" }, + "grug-far.nvim": { "branch": "main", "commit": "0ec6c3a9ef63703975e800d7386b6114863e1f9d" }, "kanagawa.nvim": { "branch": "master", "commit": "cfd67b0e1eeaa04302b8c7eb072253d24bf22d84" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, @@ -21,12 +21,12 @@ "neo-tree.nvim": { "branch": "v3.x", "commit": "16854ed5559b940f69a6f7138906ebb22c15c553" }, "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nvim-cmp": { "branch": "main", "commit": "c27370703e798666486e3064b64d59eaf4bdc6d5" }, - "nvim-lspconfig": { "branch": "master", "commit": "fd26f8626c03b424f7140d454031d1dcb8d23513" }, + "nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" }, "nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" }, - "nvim-treesitter": { "branch": "master", "commit": "afe977dadd8bccbd3919b29a8b5beb5b8bfc6cdb" }, + "nvim-treesitter": { "branch": "master", "commit": "548ed98f8a0af738d095ef1be5961f41061ed743" }, "nvim-web-devicons": { "branch": "master", "commit": "ab4cfee554e501f497bce0856788d43cf2eb93d7" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown.nvim": { "branch": "main", "commit": "a03ed82dfdeb1a4980093609ffe94c171ace8059" }, + "render-markdown.nvim": { "branch": "main", "commit": "c065031d030955e1d071a7fcdd8c59e0fd2f0343" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, diff --git a/lua/plugins/editing.lua b/lua/plugins/editing.lua index 5349ebf..d8f670c 100644 --- a/lua/plugins/editing.lua +++ b/lua/plugins/editing.lua @@ -71,6 +71,7 @@ return { -- generic vim.keymap.set('n', 'tl', builtin.live_grep, { desc = 'Telescope live grep' }) vim.keymap.set('n', 'td', builtin.lsp_document_symbols, { desc = 'Telescope document symbols' }) + vim.keymap.set('n', 'tw', builtin.lsp_dynamic_workspace_symbols, { desc = 'Telescope dynamic workspace symbols' }) vim.keymap.set('n', 'th', builtin.help_tags, { desc = 'Telescope help tags' }) vim.keymap.set('n', 'to', builtin.oldfiles, { desc = 'Telescope oldfiles' }) vim.keymap.set('n', 'tt', function() @@ -154,6 +155,32 @@ return { }, vendors = { + + + -- 百炼 + qwenr1 = { + __inherited_from = "openai", + api_key_name = "QWEN_API_KEY", + endpoint = "https://dashscope.aliyuncs.com/compatible-mode/v1/", + model = "deepseek-r1", + disable_tools = true, + }, + qwenchat = { + __inherited_from = "openai", + api_key_name = "QWEN_API_KEY", + endpoint = "https://dashscope.aliyuncs.com/compatible-mode/v1/", + model = "deepseek-v3", + disable_tools = true, + }, + qwenqwq32 = { + __inherited_from = "openai", + api_key_name = "QWEN_API_KEY", + endpoint = "https://dashscope.aliyuncs.com/compatible-mode/v1/", + model = "qwq-32b", + disable_tools = true, + }, + + -- yostar yor1 = { __inherited_from = "openai", api_key_name = "YOSTAR_API_KEY", @@ -161,14 +188,13 @@ return { model = "DeepSeek-R1", disable_tools = true, }, - yochat = { __inherited_from = "openai", api_key_name = "YOSTAR_API_KEY", endpoint = "https://litellm.yostar.net", model = "DeepSeek-V3", + disable_tools = true, }, - yoqwq32 = { __inherited_from = "openai", api_key_name = "YOSTAR_API_KEY", @@ -187,20 +213,28 @@ return { } }, { 'hat0uma/csvview.nvim', - 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" } }, - }, - } + config = function() + vim.api.nvim_create_autocmd('FileType', { + pattern = 'csv', + command = 'CsvViewEnable' + }) + + require('csvview').setup{ + 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" } }, + }, + } + end } }