scorpio 1 년 전
부모
커밋
08dd97af8f
4개의 변경된 파일43개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 0
      init.lua
  2. 24 0
      lua/plugin-config/eslint.lua
  3. 4 1
      lua/plugins.lua
  4. 14 4
      plugin/packer_compiled.lua

+ 1 - 0
init.lua

@@ -17,5 +17,6 @@ require("plugin-config.nvim-treesitter")
 require("plugin-config.prettier")
 require("plugin-config.null-ls")
 require("plugin-config.gitsigns")
+require("plugin-config.eslint")
 -- 内置LSP (新增)
 require("lsp.config.coc")

+ 24 - 0
lua/plugin-config/eslint.lua

@@ -0,0 +1,24 @@
+local null_ls = require("null-ls")
+local eslint = require("eslint")
+
+null_ls.setup()
+
+eslint.setup({
+  bin = 'eslint', -- or `eslint_d`
+  code_actions = {
+    enable = true,
+    apply_on_save = {
+      enable = true,
+      types = { "directive", "problem", "suggestion", "layout" },
+    },
+    disable_rule_comment = {
+      enable = true,
+      location = "separate_line", -- or `same_line`
+    },
+  },
+  diagnostics = {
+    enable = true,
+    report_unused_disable_directives = false,
+    run_on = "type", -- or `save`
+  },
+})

+ 4 - 1
lua/plugins.lua

@@ -84,9 +84,12 @@ packer.startup({
           "nvim-lua/plenary.nvim",
          },
         })
+        -- eslint
+        use ('MunifTanjim/eslint.nvim')
         -- indent
         use("nathanaelkane/vim-indent-guides")
-        -- 
+        --  闭合高亮
+        use ('leafOfTree/vim-matchtag')
     --use("hrsh7th/nvim-cmp")
         -- snippet 引擎
         -- 补全源

+ 14 - 4
plugin/packer_compiled.lua

@@ -95,6 +95,11 @@ _G.packer_plugins = {
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/dashboard-nvim",
     url = "https://github.com/glepnir/dashboard-nvim"
   },
+  ["eslint.nvim"] = {
+    loaded = true,
+    path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/eslint.nvim",
+    url = "https://github.com/MunifTanjim/eslint.nvim"
+  },
   ["friendly-snippets"] = {
     loaded = true,
     path = "/Users/sdaduanbilei/.local/share/nvim/site/pack/packer/start/friendly-snippets",
@@ -195,18 +200,23 @@ _G.packer_plugins = {
     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",
+    url = "https://github.com/leafOfTree/vim-matchtag"
   }
 }
 
 time([[Defining packer_plugins]], 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: 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)
 
 _G._packer.inside_compile = false
 if _G._packer.needs_bufread == true then