فهرست منبع

add snippet

成功添加模版
scorpio 1 سال پیش
والد
کامیت
0cc96189b7

+ 7 - 3
init.lua

@@ -1,9 +1,9 @@
 -- 基础配置
-require('basic')
+require("basic")
 -- 键盘设置
-require('keybindings')
+require("keybindings")
 --  插件
-require('plugins')
+require("plugins")
 -- 主题设置
 require("colorscheme")
 -- 自动命令
@@ -27,3 +27,7 @@ require("lsp.setup")
 require("lsp.config.mason")
 require("lsp.config.lspconfig")
 require("lsp.cmp")
+-- formatter
+require("formatter.setup")
+-- snip
+require("cmp.setup")

+ 1 - 0
lua/.luarc.json

@@ -48,6 +48,7 @@
         "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/trouble.nvim/lua",
         "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/typescript.nvim/lua",
         "/Users/sdaduanbilei/.config/nvim/lua",
+        "${3rd}/luv/library",
         "${3rd}/luv/library"
     ]
 }

+ 4 - 4
lua/basic.lua

@@ -34,7 +34,7 @@ vim.o.smartindent = true
 vim.o.ingorecash = true
 vim.o.smartcase = true
 -- 搜索不要高亮
-vim.o.hlsearch = true
+vim.o.hlsearch = false
 -- 边输入边搜索
 vim.o.insearch = true
 -- 命令行高未2 提供足够的显示空间
@@ -45,11 +45,11 @@ vim.bo.autoread = true
 -- 禁止折行
 vim.wo.wrap = false
 -- 光标在行首尾<Left><Right> 可以跳转到下一行
-vim.o.whichwrap = '<,>,[,]'
+vim.o.whichwrap = "<,>,[,]"
 -- 允许隐藏被修改的buffer
 vim.o.hidden = true
 -- 鼠标支持
-vim.o.mouse = 'a'
+vim.o.mouse = "a"
 -- 禁止创建备份文件
 vim.o.backup = false
 vim.o.writebackup = false
@@ -73,7 +73,7 @@ vim.o.listcharts = "space:·"
 -- 补全增强
 vim.o.wildmenu = true
 -- Dont' pass messages to |ins-completin menu|
-vim.o.shortmess = vim.o.shortmess .. 'c'
+vim.o.shortmess = vim.o.shortmess .. "c"
 -- 补全最多显示10行
 vim.o.pumheight = 10
 -- 永远显示 tabline

+ 69 - 0
lua/cmp/lspkind.lua

@@ -0,0 +1,69 @@
+local status, lspkind = pcall(require, "lspkind")
+if not status then
+  return
+end
+
+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 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

+ 63 - 0
lua/cmp/luasnip.lua

@@ -0,0 +1,63 @@
+local status, ls = pcall(require, "luasnip")
+if not status then
+  return
+end
+
+local status, config = pcall(require, "uConfig")
+if not status then
+  return
+end
+
+local status, types = pcall(require, "luasnip.util.types")
+if not status then
+  vim.notify("not found luasnip util types")
+  return
+end
+-- custom snippets
+require("luasnip.loaders.from_lua").load({
+  paths = "./lua/cmp/snippets/lua",
+})
+require("luasnip.loaders.from_vscode").lazy_load({
+  paths = "./lua/cmp/snippets/vscode",
+})
+
+-- https://github.com/rafamadriz/friendly-snippets/
+require("luasnip.loaders.from_vscode").lazy_load()
+
+ls.config.set_config({
+  history = true,
+  update_events = "TextChanged,TextChangedI",
+  enable_autosnippets = true,
+  ext_opts = {
+    [types.choiceNode] = {
+      active = {
+        -- virt_text = { { "choiceNode", "Comment" } },
+        virt_text = { { "<--", "Error" } },
+      },
+    },
+  },
+})
+
+vim.keymap.set({ "i", "s" }, config.keys.snip_jump_next, function()
+  if ls.expand_or_jumpable() then
+    ls.expand_or_jump()
+  end
+end)
+
+vim.keymap.set({ "i", "s" }, config.keys.snip_jump_prev, function()
+  if ls.jumpable(-1) then
+    ls.jump(-1)
+  end
+end)
+
+vim.keymap.set({ "i", "s" }, config.keys.snip_next_choice, function()
+  if ls.choice_active() then
+    ls.change_choice(1)
+  end
+end)
+
+vim.keymap.set({ "i", "s" }, config.keys.snip_prev_choice, function()
+  if ls.choice_active() then
+    ls.change_choice(-1)
+  end
+end)

+ 121 - 0
lua/cmp/setup.lua

@@ -0,0 +1,121 @@
+-- https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion
+-- https://github.com/hrsh7th/nvim-cmp
+-- https://github.com/onsails/lspkind-nvim
+local status, cmp = pcall(require, "cmp")
+if not status then
+  return
+end
+
+local status, luasnip = pcall(require, "luasnip")
+if not status then
+  vim.notify("not fount luasnip")
+  return
+end
+
+local status, config = pcall(require, "uConfig")
+if not status then
+  return
+end
+
+local has_words_before = function()
+  local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+  return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
+end
+
+local mapping = {
+  -- 出现补全
+  [config.keys.cmp_complete] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
+  -- 取消
+  [config.keys.cmp_abort] = cmp.mapping({
+    i = cmp.mapping.abort(),
+    c = cmp.mapping.close(),
+  }),
+
+  -- 确认
+  -- Accept currently selected item. If none selected, `select` first item.
+  -- Set `select` to `false` to only confirm explicitly selected items.
+  [config.keys.cmp_confirm] = cmp.mapping.confirm({
+    select = true,
+    behavior = cmp.ConfirmBehavior.Replace,
+  }),
+  -- 如果窗口内容太多,可以滚动
+  [config.keys.cmp_scroll_doc_up] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
+  [config.keys.cmp_scroll_doc_down] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
+
+  -- 上一个
+  [config.keys.cmp_select_prev_item] = cmp.mapping.select_prev_item(),
+  -- 下一个
+  [config.keys.cmp_select_next_item] = cmp.mapping.select_next_item(),
+}
+
+cmp.setup({
+  -- 指定 snippet 引擎 luasnip
+  snippet = {
+    expand = function(args)
+      luasnip.lsp_expand(args.body)
+    end,
+  },
+  window = {
+    completion = cmp.config.window.bordered(),
+    -- documentation = cmp.config.window.bordered(),
+  },
+  -- 快捷键
+  -- mapping = mapping,
+  mapping = mapping,
+  -- 来源
+  sources = cmp.config.sources({
+    {
+      name = "luasnip",
+      group_index = 1,
+    },
+    {
+      name = "nvim_lsp",
+      group_index = 1,
+    },
+    {
+      name = "nvim_lsp_signature_help",
+      group_index = 1,
+    },
+    {
+      name = "buffer",
+      group_index = 2,
+    },
+    {
+      name = "path",
+      group_index = 2,
+    },
+  }),
+
+  -- 使用lspkind-nvim显示类型图标
+  formatting = require("cmp.lspkind").formatting,
+})
+
+-- Use buffer source for `/`.
+cmp.setup.cmdline("/", {
+  mapping = cmp.mapping.preset.cmdline(),
+  sources = { {
+    name = "buffer",
+  } },
+})
+
+-- Use cmdline & path source for ':'.
+cmp.setup.cmdline(":", {
+  mapping = cmp.mapping.preset.cmdline(),
+  sources = cmp.config.sources({ {
+    name = "path",
+  } }, { {
+    name = "cmdline",
+  } }),
+})
+
+cmp.setup.filetype({ "markdown", "help" }, {
+  sources = { {
+    name = "luasnip",
+  }, {
+    name = "buffer",
+  }, {
+    name = "path",
+  } },
+})
+
+require("cmp.luasnip")

+ 40 - 0
lua/cmp/snippets/lua/lua.lua

@@ -0,0 +1,40 @@
+ls = require("luasnip") --{{{
+local s = ls.s          --> snippet
+local i = ls.i          --> insert node
+local t = ls.t          --> text node
+
+local d = ls.dynamic_node
+local c = ls.choice_node
+local f = ls.function_node
+local sn = ls.snippet_node
+
+local fmt = require("luasnip.extras.fmt").fmt
+local rep = require("luasnip.extras").rep
+
+local snippets, autosnippets = {}, {}
+
+local myFirstSnippet = s("myFirstSnippet", {
+  t("Hi! That is my first snippet in Luasnip"),
+  i(1, "placeholder"),
+  t("Hi! That is my first snippet in Luasnip"),
+})
+table.insert(snippets, myFirstSnippet)
+
+local mySecondSnippet = s(
+  "mySecondSnippet",
+  fmt(
+    [[
+  local {} = function({})
+    {}
+  end
+  ]],
+    {
+      i(1, ""),
+      c(2, { t("aaa"), t("myArg"), t("3333") }),
+      i(3, ""),
+    }
+  )
+)
+table.insert(snippets, mySecondSnippet)
+
+return snippets, autosnippets

+ 8 - 0
lua/cmp/snippets/vscode/lua.json

@@ -0,0 +1,8 @@
+{
+  "snip1": {
+    "prefix": "lua",
+    "body": [
+      "lualualua"
+    ]
+  }
+}

+ 13 - 0
lua/cmp/snippets/vscode/package.json

@@ -0,0 +1,13 @@
+{
+    "name": "vscode-snippets",
+    "contributes": {
+        "snippets": [
+            {
+                "language": [
+                    "lua"
+                ],
+                "path": "./lua.json"
+            }
+    ]
+  }
+}

+ 0 - 0
lua/lsp/formatter.lua → lua/formatter/formatter.lua


+ 92 - 0
lua/formatter/null-ls.lua

@@ -0,0 +1,92 @@
+local status, null_ls = pcall(require, "null-ls")
+if not status then
+  vim.notify("没有找到 null-ls")
+  return
+end
+
+local formatting = null_ls.builtins.formatting
+local diagnostics = null_ls.builtins.diagnostics
+local code_actions = null_ls.builtins.code_actions
+
+null_ls.setup({
+  debug = false,
+  sources = {
+    -- Formatting ---------------------
+    --  brew install shfmt
+    formatting.shfmt,
+    -- StyLua
+    formatting.stylua,
+    -- frontend
+    formatting.prettier.with({
+      -- 比默认少了 markdown
+      filetypes = {
+        "javascript",
+        "javascriptreact",
+        "typescript",
+        "typescriptreact",
+        "vue",
+        "css",
+        "scss",
+        "less",
+        "html",
+        "json",
+        "yaml",
+        "graphql",
+        "markdown",
+      },
+      timeout = 10000,
+      prefer_local = "node_modules/.bin",
+    }),
+    -- rustfmt
+    -- rustup component add rustfmt
+    formatting.rustfmt,
+    -- Python
+    -- pip install black
+    -- asdf reshim python
+    formatting.black.with({ extra_args = { "--fast" } }),
+    -----------------------------------------------------
+    -- Ruby
+    -- gem install rubocop
+    formatting.rubocop,
+    -- json
+    -- npm install -g fixjson
+    formatting.fixjson,
+    -- toml
+    -- cargo install taplo-cli
+    formatting.taplo,
+    -----------------------------------------------------
+    -- Diagnostics  ---------------------
+    -- diagnostics.eslint.with({
+    --   prefer_local = "node_modules/.bin",
+    -- }),
+    -- npm install -g eslint_d
+    diagnostics.eslint_d.with({
+      prefer_local = "node_modules/.bin",
+    }),
+    -- diagnostics.markdownlint,
+    -- markdownlint-cli2
+    -- diagnostics.markdownlint.with({
+    --   prefer_local = "node_modules/.bin",
+    --   command = "markdownlint-cli2",
+    --   args = { "$FILENAME", "#node_modules" },
+    -- }),
+    --
+    -- code actions ---------------------
+    code_actions.gitsigns,
+    -- code_actions.eslint.with({
+    --   prefer_local = "node_modules/.bin",
+    -- }),
+    -- npm install -g eslint_d
+    code_actions.eslint_d,
+  },
+  -- #{m}: message
+  -- #{s}: source name (defaults to null-ls if not specified)
+  -- #{c}: code (if available)
+  diagnostics_format = "[#{s}] #{m}",
+  on_attach = function(_)
+    vim.cmd([[ command! Format execute 'lua vim.lsp.buf.formatting()']])
+    -- if client.resolved_capabilities.document_formatting then
+    --   vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
+    -- end
+  end,
+})

+ 2 - 0
lua/formatter/setup.lua

@@ -0,0 +1,2 @@
+require("formatter.null-ls")
+require("formatter.formatter")

+ 125 - 122
lua/keybindings.lua

@@ -6,14 +6,16 @@
 --   term_mode = "t",
 --   command_mode = "c",
 -- leader key 为空
+local uConfig = require("uConfig")
+local keys = uConfig.keys
 vim.g.mapleader = " "
 vim.g.maplocalleader = " "
 -- MAC 设置alt 键
 alt_send_esc = true
 
 local opt = {
-    noremap = true,
-    silent = true
+  noremap = true,
+  silent = true,
 }
 local keymap = vim.keymap
 keymap.set("i", "jj", "<ESC>")
@@ -32,7 +34,7 @@ map("n", "<A-Up>", "<C-w>k", opt)
 map("n", "<A-Left>", "<C-w>h", opt)
 -- 返回dashboard 主页
 map("n", "<leader>h", ":Dashboard<CR>", opt)
--- gitsigns 
+-- gitsigns
 map("n", "git", ":Gitsigns toggle_current_line_blame<CR>", opt)
 -- lazygit
 map("n", "<leader>lg", ":LazyGit<CR>", opt)
@@ -60,8 +62,8 @@ 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)
+map("n", "<leader>hw", ":HopWord<CR>", opt)
+map("n", "<leader>hww", ":HopWordMW<CR>", opt)
 
 -- Telescope 查找文件
 -- 文件名查找
@@ -80,133 +82,134 @@ map("n", "<leader>cf", ":Prettier<CR>", opt)
 
 -- 插件快捷键
 local pluginKeys = {}
+local lsp = uConfig.lsp
+pluginKeys.mapLSP = function(mapbuf)
+  -- rename
+  --[[
+  Lspsaga 替换 rn
+  mapbuf("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opt)
+  --]]
+  mapbuf("n", lsp.rename, "<cmd>lua vim.lsp.buf.rename()<CR>")
+  -- code action
+  --[[
+  Lspsaga 替换 ca
+  mapbuf("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opt)
+  --]]
+  mapbuf("n", lsp.code_action, "<cmd>lua vim.lsp.buf.code_action()<CR>")
+  -- go xx
+  --[[
+    mapbuf('n', 'gd', '<cmd>Lspsaga preview_definition<CR>', opt)
+  mapbuf("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opt)
+  --]]
+
+  mapbuf("n", lsp.definition, function()
+    require("telescope.builtin").lsp_definitions({
+      initial_mode = "normal",
+      -- ignore_filename = false,
+    })
+  end)
+  --[[
+  mapbuf("n", "gh", "<cmd>Lspsaga hover_doc<cr>", opt)
+  Lspsaga 替换 gh
+  --]]
+  mapbuf("n", lsp.hover, "<cmd>lua vim.lsp.buf.hover()<CR>")
+  --[[
+  Lspsaga 替换 gr
+  mapbuf("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opt)
+  mapbuf("n", "gr", "<cmd>Lspsaga lsp_finder<CR>", opt)
+  --]]
+  mapbuf(
+    "n",
+    lsp.references,
+    "<cmd>lua require'telescope.builtin'.lsp_references(require('telescope.themes').get_ivy())<CR>"
+  )
+
+  if vim.fn.has("nvim-0.8") == 1 then
+    mapbuf("n", lsp.format, "<cmd>lua vim.lsp.buf.format({ async = true })<CR>")
+  else
+    mapbuf("n", lsp.format, "<cmd>lua vim.lsp.buf.formatting()<CR>")
+  end
+
+  --[[
+  Lspsaga 替换 gp, gj, gk
+  mapbuf("n", "gp", "<cmd>lua vim.diagnostic.open_float()<CR>", opt)
+  mapbuf("n", "gj", "<cmd>lua vim.diagnostic.goto_next()<CR>", opt)
+  mapbuf("n", "gk", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opt)
+  --]]
+  -- diagnostic
+  -- mapbuf("n", "gp", "<cmd>Lspsaga show_line_diagnostics<CR>", opt)
+  -- mapbuf("n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", opt)
+  -- mapbuf("n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", opt)
+
+  mapbuf("n", lsp.open_flow, "<cmd>lua vim.diagnostic.open_float()<CR>")
+  mapbuf("n", lsp.goto_next, "<cmd>lua vim.diagnostic.goto_next()<CR>")
+  mapbuf("n", lsp.goto_prev, "<cmd>lua vim.diagnostic.goto_prev()<CR>")
+  -- 未用
+  -- mapbuf("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opt)
+  -- mapbuf("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opt)
+  -- mapbuf('n', '<leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opt)
+  -- mapbuf("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opt)
+  -- mapbuf('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opt)
+  -- mapbuf('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opt)
+  -- mapbuf('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opt)
+  -- mapbuf('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opt)
+end
 
 -- nvim-tree
 map("n", "<leader>e", ":NvimTreeToggle<CR>", opt)
 -- 列表快捷键
-pluginKeys.nvimTreeList = { -- 打开文件或文件夹
-    {
-        key = { "o", "<2-LeftMouse>" },
-        action = "edit"
-    }, {
-    key = "<CR>",
-    action = "system_open"
-}, -- v分屏打开文件
-    {
-        key = "v",
-        action = "vsplit"
-    }, -- h分屏打开文件
-    {
-        key = "h",
-        action = "split"
-    }, -- Ignore (node_modules)
-    {
-        key = "i",
-        action = "toggle_ignored"
-    }, -- Hide (dotfiles)
-    {
-        key = ".",
-        action = "toggle_dotfiles"
-    }, {
-    key = "R",
-    action = "refresh"
-}, -- 文件操作
-    {
-        key = "a",
-        action = "create"
-    }, {
-    key = "d",
-    action = "remove"
-}, {
-    key = "r",
-    action = "rename"
-}, {
-    key = "x",
-    action = "cut"
-}, {
-    key = "c",
-    action = "copy"
-}, {
-    key = "p",
-    action = "paste"
-}, {
-    key = "y",
-    action = "copy_name"
-}, {
-    key = "Y",
-    action = "copy_path"
-}, {
-    key = "gy",
-    action = "copy_absolute_path"
-}, {
-    key = "I",
-    action = "toggle_file_info"
-}, {
-    key = "n",
-    action = "tabnew"
-}, -- 进入下一级
-    {
-        key = { "]" },
-        action = "cd"
-    }, -- 进入上一级
-    {
-        key = { "[" },
-        action = "dir_up"
-    } }
-
 -- lsp 快捷键
 pluginKeys.lspList = function(bufnr)
-    -- bufmap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opt)
-    bufmap(bufnr, "n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opt)
-    -- bufmap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.cade_action()<CR>", opt)
-    bufmap(bufnr, "n", "<leader>ca", "<cmd>Lspsaga cade_action<CR>", opt)
-    -- go to
-    -- bufmap(bufnr, "n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opt)
-    bufmap(bufnr, "n", "gd", "<cmd>Lspsaga goto_definition<CR>", opt)
-    -- bufmap(bufnr, "n", "gd", "<cmd>Lspsaga peek_definition<CR>", opt)
-    bufmap(bufnr, "n", "gt", "<cmd>Lspsaga goto_type_definition<CR>", opt)
-    bufmap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opt)
-    -- bufmap(bufnr, "n", "gh", "<cmd>lua vim.lsp.buf.hover()<CR>", opt)
-    bufmap(bufnr, "n", "gh", "<cmd>Lspsaga hover_doc<CR>", opt)
-    bufmap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opt)
-    -- bufmap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opt)
-    bufmap(bufnr, "n", "gr", "<cmd>Lspsaga lsp_finder<CR>", opt)
-    -- diagnostic
-    -- bufmap(bufnr, "n", "go", "<cmd>lua vim.diagnostic.open_float()<CR>", opt)
-    bufmap(bufnr, "n", "go", "<cmd>Lspsaga show_line_diagnostics<CR>", opt)
-    -- bufmap(bufnr, "n", "gn", "<cmd>lua vim.diagnostic.goto_next()<CR>", opt)
-    bufmap(bufnr, "n", "gn", "<cmd>Lspsaga diagnostic_jump_next<CR>", opt)
-    -- bufmap(bufnr, "n", "gp", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opt)
-    bufmap(bufnr, "n", "gp", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opt)
-    bufmap(bufnr, "n", "<leader>f", "<cmd>lua vim.lsp.buf.format({ async = true })<CR>", opt)
-    bufmap(bufnr, "n", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
-    bufmap(bufnr, "t", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
+  -- bufmap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opt)
+  bufmap(bufnr, "n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opt)
+  -- bufmap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.cade_action()<CR>", opt)
+  bufmap(bufnr, "n", "<leader>ca", "<cmd>Lspsaga cade_action<CR>", opt)
+  -- go to
+  -- bufmap(bufnr, "n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opt)
+  bufmap(bufnr, "n", "gd", "<cmd>Lspsaga goto_definition<CR>", opt)
+  -- bufmap(bufnr, "n", "gd", "<cmd>Lspsaga peek_definition<CR>", opt)
+  bufmap(bufnr, "n", "gt", "<cmd>Lspsaga goto_type_definition<CR>", opt)
+  bufmap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opt)
+  -- bufmap(bufnr, "n", "gh", "<cmd>lua vim.lsp.buf.hover()<CR>", opt)
+  bufmap(bufnr, "n", "gh", "<cmd>Lspsaga hover_doc<CR>", opt)
+  bufmap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opt)
+  -- bufmap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opt)
+  bufmap(bufnr, "n", "gr", "<cmd>Lspsaga lsp_finder<CR>", opt)
+  -- diagnostic
+  -- bufmap(bufnr, "n", "go", "<cmd>lua vim.diagnostic.open_float()<CR>", opt)
+  bufmap(bufnr, "n", "go", "<cmd>Lspsaga show_line_diagnostics<CR>", opt)
+  -- bufmap(bufnr, "n", "gn", "<cmd>lua vim.diagnostic.goto_next()<CR>", opt)
+  bufmap(bufnr, "n", "gn", "<cmd>Lspsaga diagnostic_jump_next<CR>", opt)
+  -- bufmap(bufnr, "n", "gp", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opt)
+  bufmap(bufnr, "n", "gp", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opt)
+  bufmap(bufnr, "n", "<leader>f", "<cmd>lua vim.lsp.buf.format({ async = true })<CR>", opt)
+  bufmap(bufnr, "n", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
+  bufmap(bufnr, "t", [[<M-\>]], "<cmd>Lspsaga term_toggle<CR>", opt)
 end
 
 -- nvim-cmp 自动补全
 pluginKeys.cmp = function(cmp)
-    return {
-        -- 出现补全
-        ["<A-.>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
-        -- 取消
-        ["<A-,>"] = cmp.mapping({
-            i = cmp.mapping.abort(),
-            c = cmp.mapping.close()
-        }),
-        -- 上一个
-        ["<C-k>"] = cmp.mapping.select_prev_item(),
-        -- 下一个
-        ["<C-j>"] = cmp.mapping.select_next_item(),
-        -- 确认
-        ["<CR>"] = cmp.mapping.confirm({
-            select = true,
-            behavior = cmp.ConfirmBehavior.Replace
-        }),
-        -- 如果窗口内容太多,可以滚动
-        ["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
-        ["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
-    }
+  return {
+    -- 出现补全
+    ["<A-.>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
+    -- 取消
+    ["<A-,>"] = cmp.mapping({
+      i = cmp.mapping.abort(),
+      c = cmp.mapping.close(),
+    }),
+    -- 上一个
+    ["<C-k>"] = cmp.mapping.select_prev_item(),
+    -- 下一个
+    ["<C-j>"] = cmp.mapping.select_next_item(),
+    -- 确认
+    ["<CR>"] = cmp.mapping.confirm({
+      select = true,
+      behavior = cmp.ConfirmBehavior.Replace,
+    }),
+    -- 如果窗口内容太多,可以滚动
+    ["<C-u>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
+    ["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
+  }
 end
 
-
 return pluginKeys

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

@@ -19,7 +19,6 @@ M.disableFormat = function(client)
   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 = {

+ 11 - 12
lua/lsp/config/mason.lua

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

+ 1 - 1
lua/lsp/setup.lua

@@ -5,7 +5,7 @@ if not status then
 end
 
 local status_mason_lspconfig, mason_config = pcall(require, "mason-lspconfig")
-if not status_mason_lspconfig  then
+if not status_mason_lspconfig then
   vim.notify("没有找到 mason-lspconfig")
   return
 end

+ 194 - 185
lua/plugins.lua

@@ -5,206 +5,215 @@ local fn = vim.fn
 local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
 local paccker_bootstrap
 if fn.empty(fn.glob(install_path)) > 0 then
-    vim.notify("正在安装Pakcer.nvim,请稍后...")
-    paccker_bootstrap = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim",
-        -- "https://gitcode.net/mirrors/wbthomason/packer.nvim",
-        install_path })
+  vim.notify("正在安装Pakcer.nvim,请稍后...")
+  paccker_bootstrap = fn.system({
+    "git",
+    "clone",
+    "--depth",
+    "1",
+    "https://github.com/wbthomason/packer.nvim",
+    -- "https://gitcode.net/mirrors/wbthomason/packer.nvim",
+    install_path,
+  })
 
-    -- https://github.com/wbthomason/packer.nvim/issues/750
-    local rtp_addition = vim.fn.stdpath("data") .. "/site/pack/*/start/*"
-    if not string.find(vim.o.runtimepath, rtp_addition) then
-        vim.o.runtimepath = rtp_addition .. "," .. vim.o.runtimepath
-    end
-    vim.notify("Pakcer.nvim 安装完毕")
+  -- https://github.com/wbthomason/packer.nvim/issues/750
+  local rtp_addition = vim.fn.stdpath("data") .. "/site/pack/*/start/*"
+  if not string.find(vim.o.runtimepath, rtp_addition) then
+    vim.o.runtimepath = rtp_addition .. "," .. vim.o.runtimepath
+  end
+  vim.notify("Pakcer.nvim 安装完毕")
 end
 
 -- Use a protected call so we don't error out on first use
 local status_ok, packer = pcall(require, "packer")
 if not status_ok then
-    vim.notify("没有安装 packer.nvim")
-    return
+  vim.notify("没有安装 packer.nvim")
+  return
 end
 
 packer.startup({
-    function(use)
-        -- Packer 可以管理自己本身
-        use 'wbthomason/packer.nvim'
-        -- 底部状态栏
-        use {
-            'nvim-lualine/lualine.nvim',
-            requires = {
-                'nvim-tree/nvim-web-devicons',
-                opt = true
-            }
-        }
-        use('nvim-tree/nvim-web-devicons')
-        -- tokyonight 主题
-        use("folke/tokyonight.nvim")
-        -- nvim-tree  文件侧边栏
-        use({
-            "kyazdani42/nvim-tree.lua",
-            requires = "kyazdani42/nvim-web-devicons"
-        })
-        -- 文件搜索
-        use {
-            'nvim-telescope/telescope.nvim',
-            requires = { "nvim-lua/plenary.nvim" }
-        }
-        -- dashboard-nvim  vim 主页
-        use {
-            'glepnir/dashboard-nvim',
-            requires = { 'nvim-tree/nvim-web-devicons' }
-        }
-        -- 悬浮终端
-        use 'voldikss/vim-floaterm'
-        -- project
-        use("ahmedkhalf/project.nvim")
-        -- treesitter 代码高亮
-        use {
-            'nvim-treesitter/nvim-treesitter',
-            run = ':TSUpdate',
-            requires = {
-              { "p00f/nvim-ts-rainbow" },
-              { "JoosepAlviste/nvim-ts-context-commentstring" },
-              { "windwp/nvim-ts-autotag" },
-              { "nvim-treesitter/nvim-treesitter-refactor" },
-              { "nvim-treesitter/nvim-treesitter-textobjects" },
-            },
-            config = function()
-              require("plugin-config.nvim-treesitter")
-            end,
-        }
-        use('nvim-treesitter/nvim-tree-docs')
-        --------------------- LSP --------------------
-        -- use {
-        --     'neoclide/coc.nvim',
-        --     branch = 'release'
-        -- }
-        -- mason
-        use {
-            "williamboman/mason.nvim",
-            run = ":MasonUpdate" -- :MasonUpdate updates registry contents
-        }
-        use("williamboman/mason-lspconfig.nvim")
-        use({ "neovim/nvim-lspconfig" })
-        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' }
-        -- lazygit
-        use({
-            "kdheepak/lazygit.nvim",
-            -- optional for floating window border decoration
-            requires = {
-                "nvim-lua/plenary.nvim",
-            },
-        })
-        -- eslint
-        use('MunifTanjim/eslint.nvim')
-        -- indent
-        use("lukas-reineke/indent-blankline.nvim")
-        --  闭合高亮
-        use('leafOfTree/vim-matchtag')
-        -- 切换窗口大小
-        use("szw/vim-maximizer")
-        -- 错误提示
-        use({ "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons" })
-        -- 括号自动补全
-        use {
-            "windwp/nvim-autopairs",
-            config = function()
-                require("nvim-autopairs").setup {}
-            end
-        }
-        -- 代码格式化
-        use('MunifTanjim/prettier.nvim')
-        -- 代码注释 gcc
-        use {
-            '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")
-         -- TypeScript 增强
-        use({ "jose-elias-alvarez/nvim-lsp-ts-utils", requires = "nvim-lua/plenary.nvim" })
-        use("jose-elias-alvarez/typescript.nvim")
-        -- formatter
-        use("mhartington/formatter.nvim")
-        -- lua 增强
-        use("folke/neodev.nvim")
-        --json 增强
-        use("b0o/schemastore.nvim")
-        -- Rust 增强
-        use("simrat39/rust-tools.nvim")
-        -- 彩虹括号
-        use("p00f/nvim-ts-rainbow")
-        -- nvim-notify
-        use({
-          "rcarriga/nvim-notify",
-          config = function()
-            require("plugin-config.nvim-notify")
-          end,
-        })
+  function(use)
+    -- Packer 可以管理自己本身
+    use("wbthomason/packer.nvim")
+    -- 底部状态栏
+    use({
+      "nvim-lualine/lualine.nvim",
+      requires = {
+        "nvim-tree/nvim-web-devicons",
+        opt = true,
+      },
+    })
+    use("nvim-tree/nvim-web-devicons")
+    -- tokyonight 主题
+    use("folke/tokyonight.nvim")
+    -- nvim-tree  文件侧边栏
+    use({
+      "kyazdani42/nvim-tree.lua",
+      requires = "kyazdani42/nvim-web-devicons",
+    })
+    -- 文件搜索
+    use({
+      "nvim-telescope/telescope.nvim",
+      requires = { "nvim-lua/plenary.nvim" },
+    })
+    -- dashboard-nvim  vim 主页
+    use({
+      "glepnir/dashboard-nvim",
+      requires = { "nvim-tree/nvim-web-devicons" },
+    })
+    -- 悬浮终端
+    use("voldikss/vim-floaterm")
+    -- project
+    use("ahmedkhalf/project.nvim")
+    -- treesitter 代码高亮
+    use({
+      "nvim-treesitter/nvim-treesitter",
+      run = ":TSUpdate",
+      requires = {
+        { "p00f/nvim-ts-rainbow" },
+        { "JoosepAlviste/nvim-ts-context-commentstring" },
+        { "windwp/nvim-ts-autotag" },
+        { "nvim-treesitter/nvim-treesitter-refactor" },
+        { "nvim-treesitter/nvim-treesitter-textobjects" },
+      },
+      config = function()
+        require("plugin-config.nvim-treesitter")
+      end,
+    })
+    use("nvim-treesitter/nvim-tree-docs")
+    --------------------- LSP --------------------
+    -- use {
+    --     'neoclide/coc.nvim',
+    --     branch = 'release'
+    -- }
+    -- mason
+    use({
+      "williamboman/mason.nvim",
+      run = ":MasonUpdate", -- :MasonUpdate updates registry contents
+    })
+    use("jay-babu/mason-null-ls.nvim")
+    use("williamboman/mason-lspconfig.nvim")
+    use({ "neovim/nvim-lspconfig" })
+    use("hrsh7th/nvim-cmp") -- completion plugin
+    use("hrsh7th/cmp-nvim-lsp")
+    use("onsails/lspkind.nvim")
+    -- 自动关闭标签
+    use({ "windwp/nvim-ts-autotag" })
+    -- snippet 引擎
+    use({ "saadparwaiz1/cmp_luasnip" })
+    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" })
+    -- lazygit
+    use({
+      "kdheepak/lazygit.nvim",
+      -- optional for floating window border decoration
+      requires = {
+        "nvim-lua/plenary.nvim",
+      },
+    })
+    -- eslint
+    use("MunifTanjim/eslint.nvim")
+    -- indent
+    use("lukas-reineke/indent-blankline.nvim")
+    --  闭合高亮
+    use("leafOfTree/vim-matchtag")
+    -- 切换窗口大小
+    use("szw/vim-maximizer")
+    -- 错误提示
+    use({ "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons" })
+    -- 括号自动补全
+    use({
+      "windwp/nvim-autopairs",
+      config = function()
+        require("nvim-autopairs").setup({})
+      end,
+    })
+    -- 代码注释 gcc
+    use({
+      "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")
+    -- TypeScript 增强
+    use({ "jose-elias-alvarez/nvim-lsp-ts-utils", requires = "nvim-lua/plenary.nvim" })
+    use("jose-elias-alvarez/typescript.nvim")
+    -- 代码格式化
+    use("MunifTanjim/prettier.nvim")
+    use("mhartington/formatter.nvim")
+    use({ "jose-elias-alvarez/null-ls.nvim", requires = "nvim-lua/plenary.nvim" })
+    -- lua 增强
+    use("folke/neodev.nvim")
+    --json 增强
+    use("b0o/schemastore.nvim")
+    -- Rust 增强
+    use("simrat39/rust-tools.nvim")
+    -- 彩虹括号
+    use("p00f/nvim-ts-rainbow")
+    -- nvim-notify
+    use({
+      "rcarriga/nvim-notify",
+      config = function()
+        require("plugin-config.nvim-notify")
+      end,
+    })
 
-       -- fidget.nvim
-        use({
-          "j-hui/fidget.nvim",
-          config = function()
-            require("plugin-config.fidget")
-          end,
+    -- fidget.nvim
+    use({
+      "j-hui/fidget.nvim",
+      config = function()
+        require("plugin-config.fidget")
+      end,
+    })
+  end,
+  config = {
+    -- 并发数限制
+    max_jobs = 16,
+    -- 自定义源
+    git = {
+      -- default_url_format = "https://hub.fastgit.xyz/%s",
+      -- default_url_format = "https://mirror.ghproxy.com/https://github.com/%s"
+      -- default_url_format = "https://gitcode.net/mirrors/%s"
+      -- default_url_format = "https://gitclone.com/github.com/%s",
+    },
+    display = {
+      open_fn = function()
+        return require("packer.util").float({
+          border = "single",
         })
-    end,
-    config = {
-        -- 并发数限制
-        max_jobs = 16,
-        -- 自定义源
-        git = {
-            -- default_url_format = "https://hub.fastgit.xyz/%s",
-            -- default_url_format = "https://mirror.ghproxy.com/https://github.com/%s"
-            -- default_url_format = "https://gitcode.net/mirrors/%s"
-            -- default_url_format = "https://gitclone.com/github.com/%s",
-        },
-        display = {
-            open_fn = function()
-                return require("packer.util").float({
-                    border = "single"
-                })
-            end
-        }
-    }
+      end,
+    },
+  },
 })
 
 -- 每次保存 plugins.lua 自动安装插件
-pcall(vim.cmd, [[
+pcall(
+  vim.cmd,
+  [[
     augroup packer_user_config
     autocmd!
     autocmd BufWritePost plugins.lua source <afile> | PackerSync
     augroup end
-  ]])
+  ]]
+)

+ 44 - 9
plugin/packer_compiled.lua

@@ -110,6 +110,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
     url = "https://github.com/hrsh7th/cmp-vsnip"
   },
+  cmp_luasnip = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
+    url = "https://github.com/saadparwaiz1/cmp_luasnip"
+  },
   ["dashboard-nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/dashboard-nvim",
@@ -120,6 +125,12 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/eslint.nvim",
     url = "https://github.com/MunifTanjim/eslint.nvim"
   },
+  ["fidget.nvim"] = {
+    config = { "\27LJ\2\n4\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\25plugin-config.fidget\frequire\0" },
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/fidget.nvim",
+    url = "https://github.com/j-hui/fidget.nvim"
+  },
   ["formatter.nvim"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/formatter.nvim",
@@ -174,7 +185,7 @@ _G.packer_plugins = {
   ["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"
+    url = "https://github.com/jay-babu/mason-null-ls.nvim"
   },
   ["mason.nvim"] = {
     loaded = true,
@@ -202,11 +213,22 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-cmp",
     url = "https://github.com/hrsh7th/nvim-cmp"
   },
+  ["nvim-lsp-ts-utils"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-lsp-ts-utils",
+    url = "https://github.com/jose-elias-alvarez/nvim-lsp-ts-utils"
+  },
   ["nvim-lspconfig"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
     url = "https://github.com/neovim/nvim-lspconfig"
   },
+  ["nvim-notify"] = {
+    config = { "\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugin-config.nvim-notify\frequire\0" },
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-notify",
+    url = "https://github.com/rcarriga/nvim-notify"
+  },
   ["nvim-tree-docs"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/nvim-tree-docs",
@@ -298,6 +320,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/trouble.nvim",
     url = "https://github.com/folke/trouble.nvim"
   },
+  ["typescript.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/typescript.nvim",
+    url = "https://github.com/jose-elias-alvarez/typescript.nvim"
+  },
   ["vim-floaterm"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/vim-floaterm",
@@ -321,22 +348,30 @@ _G.packer_plugins = {
 }
 
 time([[Defining packer_plugins]], 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: 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: fidget.nvim
+time([[Config for fidget.nvim]], true)
+try_loadstring("\27LJ\2\n4\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\25plugin-config.fidget\frequire\0", "config", "fidget.nvim")
+time([[Config for fidget.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)
+-- Config for: nvim-notify
+time([[Config for nvim-notify]], true)
+try_loadstring("\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugin-config.nvim-notify\frequire\0", "config", "nvim-notify")
+time([[Config for nvim-notify]], 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: nvim-treesitter
 time([[Config for nvim-treesitter]], true)
 try_loadstring("\27LJ\2\n=\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\"plugin-config.nvim-treesitter\frequire\0", "config", "nvim-treesitter")
 time([[Config for nvim-treesitter]], 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)
 
 _G._packer.inside_compile = false
 if _G._packer.needs_bufread == true then