Jelajahi Sumber

开启关闭全屏窗口

scorpio 1 tahun lalu
induk
melakukan
2123c88e22

+ 2 - 0
README.md

@@ -1 +1,3 @@
+# 补全文件路径
 
+~/.config/nvim/init.lua

+ 6 - 1
init.lua

@@ -8,6 +8,7 @@ require('plugins')
 require("colorscheme")
 -- 自动命令
 require("autocmd")
+require("ui")
 -- 插件配置
 require("plugin-config.lualine")
 require("plugin-config.nvim-tree")
@@ -18,5 +19,9 @@ require("plugin-config.prettier")
 require("plugin-config.null-ls")
 require("plugin-config.gitsigns")
 require("plugin-config.eslint")
+require("plugin-config.indent-blankline")
 -- 内置LSP (新增)
-require("lsp.config.coc")
+require("lsp.setup")
+require("lsp.config.mason")
+require("lsp.config.lspconfig")
+require("lsp.cmp")

+ 6 - 4
lua/basic.lua

@@ -2,11 +2,13 @@
 vim.g.encoding = "UTF-8"
 vim.o.fileencoding = "UTF-8"
 -- jkhl 移动光标周围保留8行
--- vim.o.scrolloff = 8
--- vim.o.sidescrolloff = 8
+vim.o.scrolloff = 8
+vim.o.sidescrolloff = 8
+-- 允许使用系统剪切板
+-- :vim.clipboard:append("unnamedplus")
 -- 使用相对行号
 vim.wo.number = true
--- vim.wo.relativenumber = true
+vim.wo.relativenumber = true
 -- 高亮所在行
 vim.wo.cursorline = true
 -- 显示左侧图标事例
@@ -79,4 +81,4 @@ vim.o.showtabline = 2
 -- 使用增强状态栏插件后不再需要 vim 的模式提示
 vim.o.showmode = true
 -- 配置剪贴板
-vim.opt.clipboard = "unnamedplus"
+vim.opt.clipboard:append("unnamedplus")

+ 8 - 1
lua/keybindings.lua

@@ -15,9 +15,10 @@ local opt = {
     noremap = true,
     silent = true
 }
+local keymap = vim.keymap
+keymap.set("i", "jj", "<ESC>")
 -- 本地变量
 local map = vim.api.nvim_set_keymap
-
 -- 取消 s 默认功能
 map("n", "s", "", opt)
 map("n", "sv", ":vsp<CR>", opt)
@@ -41,6 +42,8 @@ map("n", "<leader>t", ":FloatermToggle<CR>", opt)
 map("n", "<leader>i", ":IndentGuidesToggle<CR>", opt)
 -- 开启/关闭 全屏窗口
 map("n", "<leader>s", ":MaximizerToggle<CR>", opt)
+-- 开始错误列表
+map("n", "<A-e>", ":TroubleToggle<CR>", opt)
 -- 代码缩进
 map("v", "<", "<gv", opt)
 map("v", ">", ">gv", opt)
@@ -58,6 +61,10 @@ map("n", "<A-k>", "5k", opt)
 map("v", "<A-j>", "5j", opt)
 map("v", "<A-k>", "5k", opt)
 
+-- hop 相关
+map("n", "<leader>hw", ":HopWord<CR>",opt)
+map("n", "<leader>hww", ":HopWordMW<CR>",opt)
+
 -- Telescope 查找文件
 -- 文件名查找
 map("n", "<leader>f", ":Telescope find_files<CR>", opt)

+ 47 - 30
lua/lsp/cmp.lua

@@ -1,40 +1,57 @@
-local cmp = require("cmp")
+-- import nvim-cmp plugin safely
+local cmp_status, cmp = pcall(require, "cmp")
+if not cmp_status then
+  return
+end
 
-cmp.setup({
-  -- 指定 snippet 引擎
-  snippet = {
-    expand = function(args)
-      -- For `vsnip` users.
-      vim.fn["vsnip#anonymous"](args.body)
+-- import luasnip plugin safely
+local luasnip_status, luasnip = pcall(require, "luasnip")
+if not luasnip_status then
+  vim.notify("没有找到luasnip")
+  return
+end
+
+-- import lspkind plugin safely
+local lspkind_status, lspkind = pcall(require, "lspkind")
+if not lspkind_status then
+  vim.notify("没有找到lspkind")
+  return
+end
 
-      -- For `luasnip` users.
-      -- require('luasnip').lsp_expand(args.body)
+-- load vs-code like snippets from plugins (e.g. friendly-snippets)
+-- require("luasnip/loaders/from_vscode").lazy_load()
 
-      -- For `ultisnips` users.
-      -- vim.fn["UltiSnips#Anon"](args.body)
+vim.opt.completeopt = "menu,menuone,noselect"
 
-      -- For `snippy` users.
-      -- require'snippy'.expand_snippet(args.body)
+cmp.setup({
+  snippet = {
+    expand = function(args)
+      luasnip.lsp_expand(args.body)
     end,
   },
-  -- 补全源
+  mapping = cmp.mapping.preset.insert({
+    ["<S-Tab>"] = cmp.mapping.select_prev_item(), -- previous suggestion
+    ["<Tab>"] = cmp.mapping.select_next_item(), -- next suggestion
+    ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+    ["<C-f>"] = cmp.mapping.scroll_docs(4),
+    ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
+    ["<C-e>"] = cmp.mapping.abort(), -- close completion window
+    ["<CR>"] = cmp.mapping.confirm({ select = false }),
+  }),
+  -- sources for autocompletion
   sources = cmp.config.sources({
-    { name = "nvim_lsp" },
-    -- For vsnip users.
-    { name = "vsnip" },
-
-    -- For luasnip users.
-    -- { name = 'luasnip' },
-
-    --For ultisnips users.
-    -- { name = 'ultisnips' },
-
-    -- -- For snippy users.
-    -- { name = 'snippy' },
-  }, { { name = "buffer" }, { name = "path" } }),
-
-  -- 快捷键设置
-  mapping = require("keybindings").cmp(cmp),
+    { name = "nvim_lsp" }, -- lsp
+    { name = "luasnip" }, -- snippets
+    { name = "buffer" }, -- text within current buffer
+    { name = "path" }, -- file system paths
+  }),
+  -- configure lspkind for vs-code like icons
+  formatting = {
+    format = lspkind.cmp_format({
+      maxwidth = 50,
+      ellipsis_char = "...",
+    }),
+  },
 })
 
 -- / 查找模式使用 buffer 源

+ 29 - 0
lua/lsp/common-config.lua

@@ -0,0 +1,29 @@
+local M = {}
+
+M.keyAttach = function(bufnr)
+  local function buf_set_keymap(mode, lhs, rhs)
+    vim.keymap.set(mode, lhs, rhs, { noremap = true, silent = true, buffer = bufnr })
+  end
+  -- 绑定快捷键
+  require("keybindings").mapLSP(buf_set_keymap)
+end
+
+-- 禁用格式化功能,交给专门插件插件处理
+M.disableFormat = function(client)
+  if vim.fn.has("nvim-0.8") == 1 then
+    client.server_capabilities.documentFormattingProvider = false
+    client.server_capabilities.documentRangeFormattingProvider = false
+  else
+    client.resolved_capabilities.document_formatting = false
+    client.resolved_capabilities.document_range_formatting = false
+  end
+end
+
+-- M.capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
+M.capabilities = require("cmp_nvim_lsp").default_capabilities()
+
+M.flags = {
+  debounce_text_changes = 150,
+}
+
+return M

+ 14 - 0
lua/lsp/config/bash.lua

@@ -0,0 +1,14 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 15 - 0
lua/lsp/config/clangd.lua

@@ -0,0 +1,15 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 15 - 0
lua/lsp/config/cmake.lua

@@ -0,0 +1,15 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 36 - 0
lua/lsp/config/css.lua

@@ -0,0 +1,36 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+  settings = {
+    css = {
+      validate = true,
+      -- tailwindcss
+      lint = {
+        unknownAtRules = "ignore",
+      },
+    },
+    less = {
+      validate = true,
+      lint = {
+        unknownAtRules = "ignore",
+      },
+    },
+    scss = {
+      validate = true,
+      lint = {
+        unknownAtRules = "ignore",
+      },
+    },
+  },
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 13 - 0
lua/lsp/config/docker.lua

@@ -0,0 +1,13 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(_, bufnr)
+    common.keyAttach(bufnr)
+  end,
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 8 - 0
lua/lsp/config/emmet.lua

@@ -0,0 +1,8 @@
+local opts = {
+  filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less" },
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 23 - 0
lua/lsp/config/gopls.lua

@@ -0,0 +1,23 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(_, bufnr)
+    common.keyAttach(bufnr)
+    -- common.disableFormat(client)
+  end,
+  -- https://github.com/golang/tools/blob/master/gopls/doc/vim.md#neovim
+  settings = {
+    gopls = {
+      analyses = {
+        unusedparams = true,
+      },
+      staticcheck = true,
+    },
+  },
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 14 - 0
lua/lsp/config/html.lua

@@ -0,0 +1,14 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 22 - 0
lua/lsp/config/json.lua

@@ -0,0 +1,22 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    -- use fixjson to format
+    -- https://github.com/rhysd/fixjson
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+  settings = {
+    json = {
+      schemas = require("schemastore").json.schemas(),
+    },
+  },
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 147 - 0
lua/lsp/config/lspconfig.lua

@@ -0,0 +1,147 @@
+-- import lspconfig plugin safely
+local lspconfig_status, lspconfig = pcall(require, "lspconfig")
+if not lspconfig_status then
+  return
+end
+
+-- import cmp-nvim-lsp plugin safely
+local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
+if not cmp_nvim_lsp_status then
+  return
+end
+
+-- import typescript plugin safely
+local typescript_setup, typescript = pcall(require, "typescript")
+if not typescript_setup then
+  return
+end
+
+-- import rust-tools plugin safely
+local rust_setup, rt = pcall(require, "rust-tools")
+if not rust_setup then
+  return
+end
+
+local keymap = vim.keymap -- for conciseness
+
+-- enable keybinds only for when lsp server available
+local on_attach = function(client, bufnr)
+  -- keybind options
+  local opts = { noremap = true, silent = true, buffer = bufnr }
+
+  -- set keybinds
+  keymap.set("n", "gr", "<cmd>Lspsaga lsp_finder<CR>", opts) -- show definition, references
+  keymap.set("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts) -- got to declaration
+  keymap.set("n", "gd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
+  keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation
+  keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions
+  keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
+  keymap.set("n", "<leader>D", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show  diagnostics for line
+  keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor
+  keymap.set("n", "[d", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opts) -- jump to previous diagnostic in buffer
+  keymap.set("n", "]d", "<cmd>Lspsaga diagnostic_jump_next<CR>", opts) -- jump to next diagnostic in buffer
+  keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
+  keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side
+  keymap.set("n", "<leader>tt", "<cmd>Lspsaga term_toggle<CR>", opts) -- see outline on right hand side
+
+  -- typescript specific keymaps (e.g. rename file and update imports)
+  if client.name == "tsserver" then
+    keymap.set("n", "<leader>rf", ":TypescriptRenameFile<CR>") -- rename file and update imports
+    keymap.set("n", "<leader>oi", ":TypescriptOrganizeImports<CR>") -- organize imports (not in youtube nvim video)
+    keymap.set("n", "<leader>ru", ":TypescriptRemoveUnused<CR>") -- remove unused variables (not in youtube nvim video)
+  end
+end
+
+-- used to enable autocompletion (assign to every lsp server config)
+local capabilities = cmp_nvim_lsp.default_capabilities()
+
+-- Change the Diagnostic symbols in the sign column (gutter)
+-- (not in youtube nvim video)
+local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " }
+for type, icon in pairs(signs) do
+  local hl = "DiagnosticSign" .. type
+  vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
+end
+
+-- configure typescript server with plugin
+typescript.setup({
+  server = {
+    capabilities = capabilities,
+    on_attach = on_attach,
+  },
+})
+
+-- configure rust server with plugin
+rt.setup({
+  server = {
+    capabilities = capabilities,
+    on_attach = on_attach,
+  },
+})
+
+-- configure cpp clangd
+lspconfig["clangd"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+})
+
+-- configure css server
+lspconfig["cssls"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+})
+
+-- configure html server
+lspconfig["html"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+})
+
+lspconfig["cssls"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+})
+-- configure emmet language server
+lspconfig["emmet_ls"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+  filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
+})
+
+-- configure pyright server
+lspconfig["pyright"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+  settings = {
+    pyright = {
+      autoImportCompletion = true,
+      python = {
+        analysis = {
+          autoSearchPaths = true,
+          useLibraryCodeForTypes = true,
+        },
+      },
+    },
+  },
+})
+
+-- configure lua server (with special settings)
+lspconfig["sumneko_lua"].setup({
+  capabilities = capabilities,
+  on_attach = on_attach,
+  settings = { -- custom settings for lua
+    Lua = {
+      -- make the language server recognize "vim" global
+      diagnostics = {
+        globals = { "vim" },
+      },
+      workspace = {
+        -- make language server aware of runtime files
+        library = {
+          [vim.fn.expand("$VIMRUNTIME/lua")] = true,
+          [vim.fn.stdpath("config") .. "/lua"] = true,
+        },
+      },
+    },
+  },
+})

+ 47 - 36
lua/lsp/config/lua.lua

@@ -3,42 +3,53 @@ local runtime_path = vim.split(package.path, ";")
 table.insert(runtime_path, "lua/?.lua")
 table.insert(runtime_path, "lua/?/init.lua")
 
+local common = require("lsp.common-config")
+
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+  settings = {
+    Lua = {
+      runtime = {
+        -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
+        version = "LuaJIT",
+        -- Setup your lua path
+        path = runtime_path,
+      },
+      diagnostics = {
+        -- Get the language server to recognize the `vim` global
+        globals = { "vim" },
+      },
+      workspace = {
+        -- Make the server aware of Neovim runtime files
+        library = vim.api.nvim_get_runtime_file("", true),
+        checkThirdParty = false,
+      },
+      -- Do not send telemetry data containing a randomized but unique identifier
+      telemetry = {
+        enable = false,
+      },
+    },
+  },
+
+  -- custom handler
+  -- handlers = {
+  --   ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
+  --     virtual_text = false,
+  --     signs = true,
+  --     underline = true,
+  --     update_in_insert = false,
+  --   }),
+  -- },
+}
 
 return {
-    on_setup = function(server)
-        server.setup({
-            single_file_support = true,
-            settings = {
-                Lua = {
-                    runtime = {
-                        version = "LuaJIT",
-                        path = runtime_path,
-                    },
-                    diagnostics = {
-                        -- Get the language server to recognize the `vim` global
-                        globals = {
-                            "vim",
-                        },
-                    },
-                    workspace = {
-                        -- Make the server aware of Neovim runtime files
-                        library = vim.api.nvim_get_runtime_file("", true),
-                        checkThirdParty = false,
-                    },
-                    -- Do not send telemetry data containing a randomized but unique identifier
-                    telemetry = {
-                        enable = false,
-                    },
-                },
-            },
-            on_attach = function(client, bufnr)
-                -- 禁用格式化功能,交给专门插件插件处理
-                client.server_capabilities.document_formatting = false
-                client.server_capabilities.document_range_formatting = false
-                require("keybindings").lspList(bufnr)
-                -- 保存时自动格式化
-                -- vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
-            end,
-        })
-    end,
+  on_setup = function(server)
+    require("neodev").setup()
+    server.setup(opts)
+  end,
 }

+ 14 - 0
lua/lsp/config/markdown.lua

@@ -0,0 +1,14 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(_, bufnr)
+    common.keyAttach(bufnr)
+  end,
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 51 - 0
lua/lsp/config/mason.lua

@@ -0,0 +1,51 @@
+local status, mason = pcall(require,"mason")
+if not status then
+  return
+end
+
+local mason_lspconfig_status, mason_lspconfig = pcall(require,"mason-lspconfig")
+if not mason_lspconfig_status then
+  return
+end
+
+-- import mason-null-ls plugin safely
+local mason_null_ls_status, mason_null_ls = pcall(require, "mason-null-ls")
+if not mason_null_ls_status then
+  return
+end
+
+
+mason.setup({
+  ui = {
+        icons = {
+            package_installed = "✓",
+            package_pending = "➜",
+            package_uninstalled = "✗"
+        }
+    }
+})
+
+mason_lspconfig.setup({
+  ensure_installed = {
+    "tsserver",
+    "volar",
+    "html",
+    "cssls",
+    "tailwindcss",
+    "lua_ls",
+    "bashls",
+    "jsonls"
+  },
+  automatic_installation = true
+})
+
+mason_null_ls.setup({
+  -- list of formatters & linters for mason to install
+  ensure_installed = {
+    "prettier", -- ts/js formatter
+    "stylua", -- lua formatter
+    "eslint_d", -- ts/js linter
+  },
+  -- auto configured formatters & linters (with null-ls)
+  automatic_installation = true,
+})

+ 14 - 0
lua/lsp/config/pyright.lua

@@ -0,0 +1,14 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 35 - 0
lua/lsp/config/rust.lua

@@ -0,0 +1,35 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+  end,
+  settings = {
+    -- to enable rust-analyzer settings visit:
+    -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
+    ["rust-analyzer"] = {
+      -- enable clippy on save
+      checkOnSave = {
+        command = "clippy",
+      },
+    },
+  },
+}
+
+return {
+  on_setup = function(server)
+    local ok_rt, rust_tools = pcall(require, "rust-tools")
+    if not ok_rt then
+      print("Failed to load rust tools, will set up `rust_analyzer` without `rust-tools`.")
+      server.setup(opts)
+    else
+      -- We don't want to call lspconfig.rust_analyzer.setup() when using rust-tools
+      rust_tools.setup({
+        server = opts,
+        dap = require("dap.nvim-dap.config.rust"),
+      })
+    end
+  end,
+}

+ 23 - 0
lua/lsp/config/tailwindcss.lua

@@ -0,0 +1,23 @@
+-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#tailwindcss
+local opts = {
+  settings = {
+    tailwindCSS = {
+      classAttributes = { "class", "className", "classList", "ngClass" },
+      lint = {
+        cssConflict = "warning",
+        invalidApply = "error",
+        invalidConfigPath = "error",
+        invalidScreen = "error",
+        invalidTailwindDirective = "error",
+        invalidVariant = "error",
+        recommendedVariantOrder = "warning",
+      },
+      validate = true,
+    },
+  },
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 10 - 0
lua/lsp/config/taplo.lua

@@ -0,0 +1,10 @@
+local opts = {
+  on_attach = function(_, bufnr)
+    require("lsp.common-config").keyAttach(bufnr)
+  end,
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 87 - 0
lua/lsp/config/ts.lua

@@ -0,0 +1,87 @@
+local common = require("lsp.common-config")
+local keybindings = require("keybindings")
+local ts_utils = require("nvim-lsp-ts-utils")
+local opts = {
+  flags = common.flags,
+  capabilities = common.capabilities,
+
+  -- https://github.com/jose-elias-alvarez/nvim-lsp-ts-utils/blob/main/lua/nvim-lsp-ts-utils/utils.lua
+  -- 传入 tsserver 初始化参数
+  -- make inlay hints work
+  init_options = {
+    hostInfo = "neovim",
+    preferences = {
+      includeInlayParameterNameHints = "all",
+      includeInlayParameterNameHintsWhenArgumentMatchesName = true,
+      includeInlayFunctionParameterTypeHints = true,
+      includeInlayVariableTypeHints = true,
+      includeInlayPropertyDeclarationTypeHints = true,
+      includeInlayFunctionLikeReturnTypeHints = true,
+      includeInlayEnumMemberValueHints = true,
+    },
+  },
+
+  on_attach = function(client, bufnr)
+    common.disableFormat(client)
+    common.keyAttach(bufnr)
+    -- defaults
+    ts_utils.setup({
+      debug = false,
+      disable_commands = false,
+      enable_import_on_completion = false,
+      -- import all
+      import_all_timeout = 5000, -- ms
+      -- lower numbers = higher priority
+      import_all_priorities = {
+        same_file = 1, -- add to existing import statement
+        local_files = 2, -- git files or files with relative path markers
+        buffer_content = 3, -- loaded buffer content
+        buffers = 4, -- loaded buffer names
+      },
+      import_all_scan_buffers = 100,
+      import_all_select_source = false,
+      -- if false will avoid organizing imports
+      always_organize_imports = true,
+
+      -- filter diagnostics
+      filter_out_diagnostics_by_severity = {},
+      -- https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json
+      filter_out_diagnostics_by_code = {
+        80001,
+      },
+
+      -- inlay hints
+      auto_inlay_hints = true,
+      inlay_hints_highlight = "Comment",
+      inlay_hints_priority = 200, -- priority of the hint extmarks
+      inlay_hints_throttle = 150, -- throttle the inlay hint request
+      inlay_hints_format = { -- format options for individual hint kind
+        Type = {},
+        Parameter = {},
+        Enum = {},
+        -- Example format customization for `Type` kind:
+        -- Type = {
+        --     highlight = "Comment",
+        --     text = function(text)
+        --         return "->" .. text:sub(2)
+        --     end,
+        -- },
+      },
+
+      -- update imports on file move
+      update_imports_on_move = false,
+      require_confirmation_on_move = false,
+      watch_dir = nil,
+    })
+    -- required to fix code action ranges and filter diagnostics
+    ts_utils.setup_client(client)
+    -- no default maps, so you may want to define some here
+    keybindings.mapTsLSP(bufnr)
+  end,
+}
+
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 45 - 0
lua/lsp/config/typescript.lua

@@ -0,0 +1,45 @@
+local status, typescript = pcall(require, "typescript")
+if not status then
+  vim.notify("没有找到 typescript")
+  return
+end
+
+local uConfig = require("uConfig")
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(client, bufnr)
+    -- common.disableFormat(client)
+    common.keyAttach(bufnr)
+
+    --[[ 
+        :TypescriptOrganizeImports
+        :TypescriptRenameFile
+        :TypescriptAddMissingImports
+        :TypescriptRemoveUnused
+        :TypescriptFixAll
+        :TypescriptGoToSourceDefinition 
+    ]]
+
+    local bufopts = { noremap = true, silent = true, buffer = bufnr }
+    keymap("n", uConfig.lsp.ts_organize, ":TypescriptOrganizeImports<CR>", bufopts)
+    keymap("n", uConfig.lsp.ts_rename_file, ":TypescriptRenameFile<CR>", bufopts)
+    keymap("n", uConfig.lsp.ts_add_missing_import, ":TypescriptAddMissingImports<CR>", bufopts)
+    keymap("n", uConfig.lsp.ts_remove_unused, ":TypescriptRemoveUnused<CR>", bufopts)
+    keymap("n", uConfig.lsp.ts_fix_all, ":TypescriptFixAll<CR>", bufopts)
+    keymap("n", uConfig.lsp.ts_goto_source, ":TypescriptGoToSourceDefinition<CR>", bufopts)
+  end,
+}
+return {
+  on_setup = function(_)
+    typescript.setup({
+      disable_commands = false, -- prevent the plugin from creating Vim commands
+      debug = false, -- enable debug logging for commands
+      go_to_source_definition = {
+        fallback = true, -- fall back to standard LSP definition on failure
+      },
+      server = opts,
+    })
+  end,
+}

+ 24 - 0
lua/lsp/config/yamlls.lua

@@ -0,0 +1,24 @@
+local common = require("lsp.common-config")
+local opts = {
+  capabilities = common.capabilities,
+  flags = common.flags,
+  on_attach = function(_, bufnr)
+    common.keyAttach(bufnr)
+  end,
+  settings = {
+    yaml = {
+      format = {
+        enable = true,
+      },
+      schemas = {
+        ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*",
+        ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
+      },
+    },
+  },
+}
+return {
+  on_setup = function(server)
+    server.setup(opts)
+  end,
+}

+ 55 - 0
lua/lsp/formatter.lua

@@ -0,0 +1,55 @@
+local status, formatter = pcall(require, "formatter")
+if not status then
+  vim.notify("没有找到 formatter")
+  return
+end
+
+formatter.setup({
+  filetype = {
+    lua = {
+      function()
+        return {
+          exe = "stylua",
+          args = {
+            -- "--config-path "
+            --   .. os.getenv("XDG_CONFIG_HOME")
+            --   .. "/stylua/stylua.toml",
+            "-",
+          },
+          stdin = true,
+        }
+      end,
+    },
+    rust = {
+      -- Rustfmt
+      function()
+        return {
+          exe = "rustfmt",
+          args = { "--emit=stdout" },
+          stdin = true,
+        } 
+      end,
+    },
+    javascript = {
+      -- prettier
+      function()
+        return {
+          exe = "prettier",
+          args = { "--stdin-filepath", vim.fn.fnameescape(vim.api.nvim_buf_get_name(0)), "--single-quote" },
+          stdin = true,
+        }
+      end,
+    },
+  },
+})
+
+-- format on save
+vim.api.nvim_exec(
+  [[
+augroup FormatAutogroup
+  autocmd!
+  autocmd BufWritePost *.js,*.rs,*.lua FormatWrite
+augroup END
+]],
+  true
+)

+ 82 - 16
lua/lsp/setup.lua

@@ -1,20 +1,86 @@
-local lsp = require('lsp-zero').preset({})
+local status, mason = pcall(require, "mason")
+if not status then
+  vim.notify("没有找到 mason")
+  return
+end
 
-lsp.on_attach(function(client, bufnr)
-    lsp.default_keymaps({ buffer = bufnr })
-end)
+local status, mason_config = pcall(require, "mason-lspconfig")
+if not status then
+  vim.notify("没有找到 mason-lspconfig")
+  return
+end
 
-lsp.ensure_installed({
-    -- Replace these with whatever servers you want to install
-    'tsserver',
-    'eslint',
-    'rust_analyzer',
-    'cssls',
-    'cssmodules_ls',
-    'eslint',
-    'html',
-    'jsonls',
-    'volar'
+local status, lspconfig = pcall(require, "lspconfig")
+if not status then
+  vim.notify("没有找到 lspconfig")
+  return
+end
+
+-- :h mason-default-settings
+-- ~/.local/share/nvim/mason
+mason.setup({
+  ui = {
+    icons = {
+      package_installed = "✓",
+      package_pending = "➜",
+      package_uninstalled = "✗",
+    },
+  },
+})
+
+-- mason-lspconfig uses the `lspconfig` server names in the APIs it exposes - not `mason.nvim` package names
+-- https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md
+mason_config.setup({
+  ensure_installed = {
+    "lua_ls",
+    "tsserver",
+    "tailwindcss",
+    "bashls",
+    "cssls",
+    "dockerls",
+    "emmet_ls",
+    "html",
+    "jsonls",
+    "pyright",
+    "rust_analyzer",
+    "taplo",
+    "yamlls",
+    "gopls",
+    "clangd",
+    "cmake",
+  },
 })
 
-lsp.setup()
+-- 安装列表
+-- { key: 服务器名, value: 配置文件 }
+-- key 必须为下列网址列出的 server name,不可以随便写
+-- https://github.com/williamboman/nvim-lsp-installer#available-lsps
+local servers = {
+  lua_ls = require("lsp.config.lua"), -- lua/lsp/config/lua.lua
+  bashls = require("lsp.config.bash"),
+  pyright = require("lsp.config.pyright"),
+  html = require("lsp.config.html"),
+  cssls = require("lsp.config.css"),
+  emmet_ls = require("lsp.config.emmet"),
+  jsonls = require("lsp.config.json"),
+  tsserver = require("lsp.config.typescript"),
+  yamlls = require("lsp.config.yamlls"),
+  dockerls = require("lsp.config.docker"),
+  tailwindcss = require("lsp.config.tailwindcss"),
+  -- rust_analyzer = require("lsp.config.rust"),
+  taplo = require("lsp.config.taplo"), -- toml
+  gopls = require("lsp.config.gopls"),
+  remark_ls = require("lsp.config.markdown"),
+  clangd = require("lsp.config.clangd"),
+  cmake = require("lsp.config.cmake"),
+}
+
+for name, config in pairs(servers) do
+  if config ~= nil and type(config) == "table" then
+    -- 自定义初始化配置文件必须实现on_setup 方法
+    config.on_setup(lspconfig[name])
+  else
+    -- 使用默认参数
+    lspconfig[name].setup({})
+  end
+end

+ 1 - 2
lua/plugin-config/dashboard.lua

@@ -45,9 +45,8 @@ db.setup({
         footer = db.custom_footer -- your footer
     }
 })
-
 db.custom_footer = function()
-    local footer = {'', ' Have fun with neovim'}
+    local footer = {'sdaduanbilei', ' Have fun with neovim'}
     if packer_plugins ~= nil then
         local count = #vim.tbl_keys(packer_plugins)
         footer[2] = '🎉 Neovim loaded ' .. count .. ' plugins'

+ 46 - 0
lua/plugin-config/indent-blankline.lua

@@ -0,0 +1,46 @@
+
+local status, ident_blankline = pcall(require, "indent_blankline")
+if not status then
+  vim.notify("没有找到 indent_blankline")
+  return
+end
+
+ident_blankline.setup({
+  -- 空行占位
+  space_char_blankline = " ",
+  -- 用 treesitter 判断上下文
+  show_current_context = true,
+  show_current_context_start = true,
+  context_patterns = {
+    "class",
+    "function",
+    "method",
+    "element",
+    "^if",
+    "^while",
+    "^for",
+    "^object",
+    "^table",
+    "block",
+    "arguments",
+  },
+  -- :echo &filetype
+  filetype_exclude = {
+    "dashboard",
+    "packer",
+    "terminal",
+    "help",
+    "log",
+    "markdown",
+    "TelescopePrompt",
+    "lsp-installer",
+    "lspinfo",
+    "toggleterm",
+  },
+  -- 竖线样式
+  -- char = '¦'
+  -- char = '┆'
+  -- char = '│'
+  -- char = "⎸",
+  char = "▏",
+})

+ 66 - 35
lua/plugins.lua

@@ -29,7 +29,7 @@ packer.startup({
     function(use)
         -- Packer 可以管理自己本身
         use 'wbthomason/packer.nvim'
-        -- 你的插件列表...
+        -- 底部状态栏
         use {
             'nvim-lualine/lualine.nvim',
             requires = {
@@ -55,55 +55,66 @@ packer.startup({
             'glepnir/dashboard-nvim',
             requires = { 'nvim-tree/nvim-web-devicons' }
         }
+        -- 悬浮终端
         use 'voldikss/vim-floaterm'
         -- project
         use("ahmedkhalf/project.nvim")
-        -- treesitter (新增)
+        -- treesitter 代码高亮
         use {
             'nvim-treesitter/nvim-treesitter',
             run = ':TSUpdate'
         }
         use('nvim-treesitter/nvim-tree-docs')
         --------------------- LSP --------------------
+        -- use {
+        --     'neoclide/coc.nvim',
+        --     branch = 'release'
+        -- }
+        -- mason
         use {
-            'neoclide/coc.nvim',
-            branch = 'release'
+            "williamboman/mason.nvim",
+            run = ":MasonUpdate" -- :MasonUpdate updates registry contents
         }
-        -- 自动关闭标签
-        use {'windwp/nvim-ts-autotag'}
-        -- Lspconfig
+        use("williamboman/mason-lspconfig.nvim")
         use({ "neovim/nvim-lspconfig" })
-        use({"L3MON4D3/LuaSnip",run = "make install_jsregexp"})
+        use("hrsh7th/nvim-cmp")                -- completion plugin
+        use("hrsh7th/cmp-nvim-lsp")
+        use("jose-elias-alvarez/null-ls.nvim") -- configure formatters & linters
+        use("jayp0521/mason-null-ls.nvim")     -- bridges gap b/w mason & null-ls
+        use("onsails/lspkind.nvim")
+        -- 自动关闭标签
+        use { 'windwp/nvim-ts-autotag' }
+        -- snippet 引擎
+        use({ "L3MON4D3/LuaSnip", run = "make install_jsregexp" })
+        use("hrsh7th/vim-vsnip")
+        -- 补全源
+        use("hrsh7th/cmp-vsnip")
+        --use("hrsh7th/cmp-nvim-lsp") -- { name = nvim_lsp }
+        use("hrsh7th/cmp-buffer")  -- { name = 'buffer' },
+        use("hrsh7th/cmp-path")    -- { name = 'path' }
+        use("hrsh7th/cmp-cmdline") -- { name = 'cmdline' }
+        -- 常见编程语言代码段
+        use("rafamadriz/friendly-snippets")
         -- git
-        use {'lewis6991/gitsigns.nvim'}
+        use { 'lewis6991/gitsigns.nvim' }
         -- lazygit
-       use({
-         "kdheepak/lazygit.nvim",
-      -- optional for floating window border decoration
-         requires = {
-          "nvim-lua/plenary.nvim",
-         },
+        use({
+            "kdheepak/lazygit.nvim",
+            -- optional for floating window border decoration
+            requires = {
+                "nvim-lua/plenary.nvim",
+            },
         })
         -- eslint
-        use ('MunifTanjim/eslint.nvim')
+        use('MunifTanjim/eslint.nvim')
         -- indent
-        use("nathanaelkane/vim-indent-guides")
+        use("lukas-reineke/indent-blankline.nvim")
         --  闭合高亮
-        use ('leafOfTree/vim-matchtag')
+        use('leafOfTree/vim-matchtag')
         -- 切换窗口大小
-       use ("szw/vim-maximizer")
-
-    --use("hrsh7th/nvim-cmp")
-        -- snippet 引擎
-        -- 补全源
-        --use("hrsh7th/cmp-vsnip")
-        --use("hrsh7th/cmp-nvim-lsp") -- { name = nvim_lsp }
-        --use("hrsh7th/cmp-buffer")   -- { name = 'buffer' },
-        --use("hrsh7th/cmp-path")     -- { name = 'path' }
-        --use("hrsh7th/cmp-cmdline")  -- { name = 'cmdline' }
-
-        -- 常见编程语言代码段
-        use("rafamadriz/friendly-snippets")
+        use("szw/vim-maximizer")
+        -- 错误提示
+        use({ "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons" })
         -- 括号自动补全
         use {
             "windwp/nvim-autopairs",
@@ -112,14 +123,34 @@ packer.startup({
             end
         }
         -- 代码格式化
-        use('jose-elias-alvarez/null-ls.nvim')
         use('MunifTanjim/prettier.nvim')
+        -- 代码注释 gcc
         use {
-           'numToStr/Comment.nvim',
-           config = function()
-           require('Comment').setup()
+            'numToStr/Comment.nvim',
+            config = function()
+                require('Comment').setup()
+            end
+        }
+        -- hop 快速跳转
+        use {
+          'phaazon/hop.nvim',
+          branch = 'v2', -- optional but strongly recommended
+          config = function()
+            -- you can configure Hop the way you like here; see :h hop-config
+            require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
           end
         }
+        -- lspsage
+        use("tami5/lspsaga.nvim")
+        -- formatter
+        use("mhartington/formatter.nvim")
+        -- lua 增强
+        use("folke/neodev.nvim")
+        --json 增强
+        use("b0o/schemastore.nvim")
+        -- Rust 增强
+        use("simrat39/rust-tools.nvim")
+
     end,
     config = {
         -- 并发数限制

+ 132 - 0
lua/ui.lua

@@ -0,0 +1,132 @@
+-- 自定义图标
+vim.diagnostic.config({
+  virtual_text = true,
+  signs = true,
+  update_in_insert = false,
+})
+local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
+for type, icon in pairs(signs) do
+  local hl = "DiagnosticSign" .. type
+  vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
+end
+
+-- lspkind
+local lspkind = require("lspkind")
+lspkind.init({
+  -- default: true
+  -- with_text = true,
+  -- defines how annotations are shown
+  -- default: symbol
+  -- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
+  mode = "symbol_text",
+  -- default symbol map
+  -- can be either 'default' (requires nerd-fonts font) or
+  -- 'codicons' for codicon preset (requires vscode-codicons font)
+  --
+  -- default: 'default'
+  preset = "codicons",
+  -- override preset symbols
+  --
+  -- default: {}
+  symbol_map = {
+    Text = "",
+    Method = "",
+    Function = "",
+    Constructor = "",
+    Field = "ﰠ",
+    Variable = "",
+    Class = "ﴯ",
+    Interface = "",
+    Module = "",
+    Property = "ﰠ",
+    Unit = "塞",
+    Value = "",
+    Enum = "",
+    Keyword = "",
+    Snippet = "",
+    Color = "",
+    File = "",
+    Reference = "",
+    Folder = "",
+    EnumMember = "",
+    Constant = "",
+    Struct = "פּ",
+    Event = "",
+    Operator = "",
+    TypeParameter = "",
+  },
+})
+
+local lspsaga = require("lspsaga")
+lspsaga.setup({ -- defaults ...
+  debug = false,
+  use_saga_diagnostic_sign = true,
+  -- diagnostic sign
+  error_sign = "",
+  warn_sign = "",
+  hint_sign = "",
+  infor_sign = "",
+  diagnostic_header_icon = "   ",
+  -- code action title icon
+  code_action_icon = " ",
+  code_action_prompt = {
+    enable = true,
+    sign = true,
+    sign_priority = 40,
+    virtual_text = true,
+  },
+  finder_definition_icon = "  ",
+  finder_reference_icon = "  ",
+  max_preview_lines = 10,
+  finder_action_keys = {
+    -- open = "o",
+    open = "<CR>",
+    vsplit = "s",
+    split = "i",
+    -- quit = "q",
+    quit = "<ESC>",
+    scroll_down = "<C-f>",
+    scroll_up = "<C-b>",
+  },
+  code_action_keys = {
+    -- quit = "q",
+    quit = "<ESC>",
+    exec = "<CR>",
+  },
+  rename_action_keys = {
+    -- quit = "<C-c>",
+    quit = "<ESC>",
+    exec = "<CR>",
+  },
+  definition_preview_icon = "  ",
+  border_style = "single",
+  rename_prompt_prefix = "➤",
+  rename_output_qflist = {
+    enable = false,
+    auto_open_qflist = false,
+  },
+  server_filetype_map = {},
+  diagnostic_prefix_format = "%d. ",
+  diagnostic_message_format = "%m %c",
+  highlight_prefix = false,
+})
+
+local M = {}
+-- 为 cmp.lua 提供参数格式
+M.formatting = {
+  format = lspkind.cmp_format({
+    mode = "symbol_text",
+    --mode = 'symbol', -- show only symbol annotations
+
+    maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
+    -- The function below will be called before any actual modifications from lspkind
+    -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
+    before = function(entry, vim_item)
+      -- Source 显示提示来源
+      vim_item.menu = "[" .. string.upper(entry.source.name) .. "]"
+      return vim_item
+    end,
+  }),
+}
+
+return M

+ 102 - 12
plugin/packer_compiled.lua

@@ -85,10 +85,30 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/LuaSnip",
     url = "https://github.com/L3MON4D3/LuaSnip"
   },
-  ["coc.nvim"] = {
+  ["cmp-buffer"] = {
     loaded = true,
-    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/coc.nvim",
-    url = "https://github.com/neoclide/coc.nvim"
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-buffer",
+    url = "https://github.com/hrsh7th/cmp-buffer"
+  },
+  ["cmp-cmdline"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
+    url = "https://github.com/hrsh7th/cmp-cmdline"
+  },
+  ["cmp-nvim-lsp"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
+    url = "https://github.com/hrsh7th/cmp-nvim-lsp"
+  },
+  ["cmp-path"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-path",
+    url = "https://github.com/hrsh7th/cmp-path"
+  },
+  ["cmp-vsnip"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
+    url = "https://github.com/hrsh7th/cmp-vsnip"
   },
   ["dashboard-nvim"] = {
     loaded = true,
@@ -100,6 +120,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/eslint.nvim",
     url = "https://github.com/MunifTanjim/eslint.nvim"
   },
+  ["formatter.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/formatter.nvim",
+    url = "https://github.com/mhartington/formatter.nvim"
+  },
   ["friendly-snippets"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/friendly-snippets",
@@ -110,16 +135,57 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
     url = "https://github.com/lewis6991/gitsigns.nvim"
   },
+  ["hop.nvim"] = {
+    config = { "\27LJ\2\nU\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\tkeys\28etovxqpdygfblzhckisuran\nsetup\bhop\frequire\0" },
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/hop.nvim",
+    url = "https://github.com/phaazon/hop.nvim"
+  },
+  ["indent-blankline.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
+    url = "https://github.com/lukas-reineke/indent-blankline.nvim"
+  },
   ["lazygit.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lazygit.nvim",
     url = "https://github.com/kdheepak/lazygit.nvim"
   },
+  ["lspkind.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
+    url = "https://github.com/onsails/lspkind.nvim"
+  },
+  ["lspsaga.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
+    url = "https://github.com/tami5/lspsaga.nvim"
+  },
   ["lualine.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/lualine.nvim",
     url = "https://github.com/nvim-lualine/lualine.nvim"
   },
+  ["mason-lspconfig.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
+    url = "https://github.com/williamboman/mason-lspconfig.nvim"
+  },
+  ["mason-null-ls.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/mason-null-ls.nvim",
+    url = "https://github.com/jayp0521/mason-null-ls.nvim"
+  },
+  ["mason.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/mason.nvim",
+    url = "https://github.com/williamboman/mason.nvim"
+  },
+  ["neodev.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/neodev.nvim",
+    url = "https://github.com/folke/neodev.nvim"
+  },
   ["null-ls.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
@@ -131,6 +197,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
     url = "https://github.com/windwp/nvim-autopairs"
   },
+  ["nvim-cmp"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-cmp",
+    url = "https://github.com/hrsh7th/nvim-cmp"
+  },
   ["nvim-lspconfig"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
@@ -181,6 +252,16 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/project.nvim",
     url = "https://github.com/ahmedkhalf/project.nvim"
   },
+  ["rust-tools.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/rust-tools.nvim",
+    url = "https://github.com/simrat39/rust-tools.nvim"
+  },
+  ["schemastore.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/schemastore.nvim",
+    url = "https://github.com/b0o/schemastore.nvim"
+  },
   ["telescope.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/telescope.nvim",
@@ -191,16 +272,16 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/tokyonight.nvim",
     url = "https://github.com/folke/tokyonight.nvim"
   },
+  ["trouble.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/trouble.nvim",
+    url = "https://github.com/folke/trouble.nvim"
+  },
   ["vim-floaterm"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-floaterm",
     url = "https://github.com/voldikss/vim-floaterm"
   },
-  ["vim-indent-guides"] = {
-    loaded = true,
-    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-indent-guides",
-    url = "https://github.com/nathanaelkane/vim-indent-guides"
-  },
   ["vim-matchtag"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-matchtag",
@@ -210,18 +291,27 @@ _G.packer_plugins = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-maximizer",
     url = "https://github.com/szw/vim-maximizer"
+  },
+  ["vim-vsnip"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-vsnip",
+    url = "https://github.com/hrsh7th/vim-vsnip"
   }
 }
 
 time([[Defining packer_plugins]], false)
--- Config for: Comment.nvim
-time([[Config for Comment.nvim]], true)
-try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim")
-time([[Config for Comment.nvim]], false)
 -- Config for: nvim-autopairs
 time([[Config for nvim-autopairs]], true)
 try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs")
 time([[Config for nvim-autopairs]], false)
+-- Config for: hop.nvim
+time([[Config for hop.nvim]], true)
+try_loadstring("\27LJ\2\nU\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\tkeys\28etovxqpdygfblzhckisuran\nsetup\bhop\frequire\0", "config", "hop.nvim")
+time([[Config for hop.nvim]], false)
+-- Config for: Comment.nvim
+time([[Config for Comment.nvim]], true)
+try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim")
+time([[Config for Comment.nvim]], false)
 
 _G._packer.inside_compile = false
 if _G._packer.needs_bufread == true then