diff --git a/lua/lazy/index.lua b/lua/lazy/index.lua index a8960f0..881a571 100644 --- a/lua/lazy/index.lua +++ b/lua/lazy/index.lua @@ -73,6 +73,8 @@ require("lazy").setup({ require("lazy.plugins.filemanager"), -- crtl+g快捷键在neovim中启动lazygit require("lazy.plugins.lazygit"), + -- fzf/skim模糊查找 + require("lazy.plugins.fzf"), -- telescope模糊查找 require("lazy.plugins.telescope"), -- 代码雨插件 diff --git a/lua/lazy/plugins/avante.lua b/lua/lazy/plugins/avante.lua index bf3dded..5098305 100644 --- a/lua/lazy/plugins/avante.lua +++ b/lua/lazy/plugins/avante.lua @@ -4,28 +4,28 @@ return { commit = "7dc5560", -- version = false, -- Never set this value to "*"! Never! opts = { - -- behaviour = { - -- enable_cursor_planning_mode = true, -- enable cursor planning mode! - -- }, - -- provider = "openrouter", - -- vendors = { - -- openrouter = { - -- __inherited_from = "openai", - -- disable_tools = true, - -- endpoint = "https://openrouter.ai/api/v1", - -- api_key_name = "OPENROUTER_API_KEY", - -- model = "deepseek/deepseek-chat-v3-0324:free", - -- }, - -- }, - provider = "deepseek", + behaviour = { + enable_cursor_planning_mode = true, -- enable cursor planning mode! + }, + provider = "openrouter", vendors = { - deepseek = { + openrouter = { __inherited_from = "openai", - api_key_name = "DEEPSEEK_API_KEY", - endpoint = "https://api.deepseek.com", - model = "deepseek-chat", + disable_tools = true, + endpoint = "https://openrouter.ai/api/v1", + api_key_name = "OPENROUTER_API_KEY", + model = "deepseek/deepseek-chat-v3-0324:free", }, }, + -- provider = "deepseek", + -- vendors = { + -- deepseek = { + -- __inherited_from = "openai", + -- api_key_name = "DEEPSEEK_API_KEY", + -- endpoint = "https://api.deepseek.com", + -- model = "deepseek-chat", + -- }, + -- }, -- The system_prompt type supports both a string and a function that returns a string. Using a function here allows dynamically updating the prompt with mcphub -- system_prompt = function() -- local hub = require("mcphub").get_hub_instance() @@ -50,7 +50,6 @@ return { --- The below dependencies are optional, "echasnovski/mini.pick", -- for file_selector provider mini.pick "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "ibhagwan/fzf-lua", -- for file_selector provider fzf "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons "zbirenbaum/copilot.lua", -- for providers='copilot' { diff --git a/lua/lazy/plugins/coderunner.lua b/lua/lazy/plugins/coderunner.lua index 1831c0b..7aaedef 100644 --- a/lua/lazy/plugins/coderunner.lua +++ b/lua/lazy/plugins/coderunner.lua @@ -46,7 +46,7 @@ return { filetype = { python = "uv run $fileName", rust = { - "cargo run", + "cargo run --release", -- "cd $dir &&", -- "rustc $fileName &&", -- "$dir/$fileNameWithoutExt", diff --git a/lua/lazy/plugins/fzf.lua b/lua/lazy/plugins/fzf.lua new file mode 100644 index 0000000..f2975ed --- /dev/null +++ b/lua/lazy/plugins/fzf.lua @@ -0,0 +1,25 @@ +return { + "ibhagwan/fzf-lua", + -- optional for icon support + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + -- ctrl+t打开文件查找 + vim.keymap.set('n', '', 'FzfLua files', {}) + -- ctrl+f打开字符串查找 + vim.keymap.set('n', '', 'FzfLua grep', {}) + require("fzf-lua").setup({ + fzf_bin = "sk", + keymap = { + fzf = { + -- fzf '--bind=' options + -- true, -- uncomment to inherit all the below in your custom config + ["ctrl-e"] = "down", + ["ctrl-u"] = "up", + -- Only valid with fzf previewers (bat/cat/git/etc) + -- ["shift-down"] = "preview-page-down", + -- ["shift-up"] = "preview-page-up", + }, + }, + }) + end, +} diff --git a/lua/lazy/plugins/lspconfig.lua b/lua/lazy/plugins/lspconfig.lua index d8aef27..e3c8452 100644 --- a/lua/lazy/plugins/lspconfig.lua +++ b/lua/lazy/plugins/lspconfig.lua @@ -1,36 +1,38 @@ return { "neovim/nvim-lspconfig", dependencies = { - { "williamboman/mason.nvim" }, - { "mason-org/mason-lspconfig.nvim" }, + -- 通过mason来自动安装语言服务器并启用 + { "mason-org/mason.nvim", opts = {} }, + { + "mason-org/mason-lspconfig.nvim", + opts = { + ensure_installed = { + "lua_ls", + "rust_analyzer", + -- "gopls", + }, + automatic_enable = { + exclude = { + "marksman", + "pylsp", + }, + }, + }, + }, { "MysticalDevil/inlay-hints.nvim", event = "LspAttach" }, }, config = function() - -- 通过mason来自动安装语言服务器并启用 - require("mason").setup({}) - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "marksman", - "rust_analyzer", - "pylsp", - -- "gopls", - }, - automatic_enable = { - exclude = {}, - }, - }) - -- 快捷键的映射 - vim.keymap.set("n", "h", vim.lsp.buf.hover, opts) -- h显示提示文档 - vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) -- gd跳转到定义的位置 - vim.keymap.set("n", "go", vim.lsp.buf.type_definition, opts) -- go跳转到变量类型定义的位置 - vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) -- gr跳转到引用了对应变量或函数的位置 - vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- rn变量重命名 - vim.keymap.set("n", "aw", vim.lsp.buf.code_action, opts) -- aw可以在出现警告或错误的地方打开建议的修复方法 - vim.keymap.set("n", "d", vim.diagnostic.open_float, opts) -- d浮动窗口显示所在行警告或错误信息 - vim.keymap.set("n", "-", vim.diagnostic.goto_prev, opts) -- -跳转到上一处警告或错误的地方 - vim.keymap.set("n", "=", vim.diagnostic.goto_next, opts) -- +跳转到下一处警告或错误的地方 +vim.keymap.set("n", "h", vim.lsp.buf.hover, opts) -- h显示提示文档 +vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) -- gd跳转到定义 +vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- gD跳转到声明(例如c语言中的头文件中的原型、一个变量的extern声明) +vim.keymap.set("n", "go", vim.lsp.buf.type_definition, opts) -- go跳转到变量类型定义的位置(例如一些自定义类型) +vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) -- gr跳转到引用了对应变量或函数的位置 +vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- rn变量重命名 +vim.keymap.set("n", "aw", vim.lsp.buf.code_action, opts) -- aw可以在出现警告或错误的地方打开建议的修复方法 +vim.keymap.set("n", "d", vim.diagnostic.open_float, opts) -- d浮动窗口显示所在行警告或错误信息 +vim.keymap.set("n", "-", vim.diagnostic.goto_prev, opts) -- -跳转到上一处警告或错误的地方 +vim.keymap.set("n", "=", vim.diagnostic.goto_next, opts) -- +跳转到下一处警告或错误的地方 -- vim.keymap.set({ 'n', 'x' }, 'f', function() vim.lsp.buf.format({ async = true }) end, opts) -- f进行代码格式化 -- 诊断信息的图标 diff --git a/lua/lazy/plugins/telescope.lua b/lua/lazy/plugins/telescope.lua index adb27ad..592c12d 100644 --- a/lua/lazy/plugins/telescope.lua +++ b/lua/lazy/plugins/telescope.lua @@ -7,9 +7,9 @@ return { config = function() local builtin = require('telescope.builtin') -- ctrl+t打开文件查找 - vim.keymap.set('n', '', builtin.find_files, {}) + -- vim.keymap.set('n', '', builtin.find_files, {}) -- ctrl+f打开字符串查找 - vim.keymap.set('n', '', 'lua require("telescope.builtin").grep_string({ search = vim.fn.input("Grep For > "), only_sort_text = true, })', { noremap = true }) + -- vim.keymap.set('n', '', 'lua require("telescope.builtin").grep_string({ search = vim.fn.input("Grep For > "), only_sort_text = true, })', { noremap = true }) -- 下面的配置从cw的配置粘贴过来的,删除一部分看不懂的 local ts = require('telescope') ts.setup({ diff --git a/lua/lazy/plugins/themes.lua b/lua/lazy/plugins/themes.lua index 134d301..0c6dbc3 100644 --- a/lua/lazy/plugins/themes.lua +++ b/lua/lazy/plugins/themes.lua @@ -7,7 +7,7 @@ return { name = "catppuccin", priority = 1000, opts = { - transparent_background = true, + transparent_background = false, custom_highlights = function(colors) return { LineNr = { fg = colors.surface2 }, diff --git a/snippets/rust.json b/snippets/rust.json index 89f0fed..71b94b7 100644 --- a/snippets/rust.json +++ b/snippets/rust.json @@ -25,7 +25,7 @@ "description": "custom let" }, "letmut":{ - "prefix": "let mut", + "prefix": "letm", "body": [ "let mut ${1} = ${2};" ],