diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c10e9e --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Vim Configuration + +This is my vim(neovim) configuration, mainly using Lazy.vim as Configuration +manager and adding some basic support so that it can be used in multi-purpose +tasks. diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index ef4c1e0..ae0e82e 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,17 +1,17 @@ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) @@ -23,13 +23,13 @@ vim.g.maplocalleader = "\\" -- Setup lazy.nvim require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "catppuccin-mocha" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/plugins/complete-func.lua b/lua/plugins/complete-func.lua index f27ef66..11bb0b4 100644 --- a/lua/plugins/complete-func.lua +++ b/lua/plugins/complete-func.lua @@ -38,7 +38,7 @@ return { mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- 触发补全 + [""] = cmp.mapping.complete(), -- 触发补全 [""] = cmp.mapping.abort(), -- 关闭补全 [''] = cmp.mapping(function(fallback) if cmp.visible() then @@ -79,14 +79,6 @@ return { { name = "path" }, -- 文件路径 { name = "buffer" }, -- 缓冲区内容 }), - -- 美化补全菜单(图标 + 类型提示) - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - ellipsis_char = "...", - }), - }, }) -- 命令行补全 diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua index fae9c20..d6c8229 100644 --- a/lua/plugins/git.lua +++ b/lua/plugins/git.lua @@ -3,6 +3,10 @@ return { { "tpope/vim-fugitive", - event = "User GitPrompt", -- 按需加载 + cmd = { + "G", + "Git", + "Gedit", "Gdiffsplit", "Gread", "Gwrite", "GMove", "Ggrep", "GDelete", "GBrowse" + } }, } diff --git a/lua/plugins/navigation.lua b/lua/plugins/navigation.lua index 9949fde..4fadd38 100644 --- a/lua/plugins/navigation.lua +++ b/lua/plugins/navigation.lua @@ -7,7 +7,7 @@ return { { "n", ":NERDTreeFocus", mode = "n", desc = "Nerd Tree Focus" }, { "", ":NERDTree", mode = "n", desc = "Nerd Tree" }, { "", ":NERDTreeToggle", mode = "n", desc = "Nerd Tree Toggle" }, - { "", ":NERDTreeFind", mode = "n", desc = "Nerd Tree Find" }, + { "", ":NERDTreeFind", mode = "n", desc = "Nerd Tree Find" }, }, }, { @@ -43,8 +43,8 @@ return { { "s", "(easymotion-overwin-f2)", mode = "n", desc = "EasyMotion 跳转双字符" }, -- L 跳转行(上下) - { "L", "(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" }, - { "L", "(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" }, + { "l", "(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" }, + { "l", "(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" }, -- w 跳转单词 { "w", "(easymotion-overwin-w)", mode = "n", desc = "EasyMotion 跳转单词" },