From 3b9798fb3faece9edabfc2c54fb077d2620074cc Mon Sep 17 00:00:00 2001 From: Daryl Ronningen Date: Thu, 9 May 2024 16:22:03 -0700 Subject: [PATCH] make pretterd and typescript-tools deletus --- lazy-lock.json | 1 - lua/community.lua | 3 -- lua/plugins/astrolsp.lua | 18 ++++++-- lua/plugins/html-css.lua | 37 ++++++++++++++++ lua/plugins/none-ls.lua | 6 +-- lua/plugins/typescript.lua | 91 ++++++++++++++++++++++++++++++++++++++ lua/plugins/yaml.lua | 51 +++++++++++++++++++++ 7 files changed, 195 insertions(+), 12 deletions(-) create mode 100644 lua/plugins/html-css.lua create mode 100644 lua/plugins/typescript.lua create mode 100644 lua/plugins/yaml.lua diff --git a/lazy-lock.json b/lazy-lock.json index f8bffd7..e295879 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -68,7 +68,6 @@ "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, "tsc.nvim": { "branch": "main", "commit": "c37d7b3ed954e4db13814f0ed7aa2a83b2b7e9dd" }, - "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "042587c63b2b2776a83337748d53dba8b67ec545" }, "venv-selector.nvim": { "branch": "main", "commit": "9b1bfe5aea225853e14358f504c656d4af007035" }, "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, diff --git a/lua/community.lua b/lua/community.lua index 9ce70f0..86e01b3 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -5,14 +5,11 @@ ---@type LazySpec return { "AstroNvim/astrocommunity", - { import = "astrocommunity.pack.typescript" }, { import = "astrocommunity.pack.lua" }, { import = "astrocommunity.pack.python" }, - { import = "astrocommunity.pack.html-css" }, { import = "astrocommunity.pack.vue" }, { import = "astrocommunity.pack.rust" }, { import = "astrocommunity.pack.sql" }, - { import = "astrocommunity.pack.yaml" }, { import = "astrocommunity.editing-support.ultimate-autopair-nvim" }, { import = "astrocommunity.indent.indent-blankline-nvim" }, { import = "astrocommunity.indent.mini-indentscope" }, diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index d7f0aa6..3efb40d 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -15,11 +15,23 @@ return { semantic_tokens = true, }, formatting = { + format_on_save = { + enabled = true, + }, disabled = { "sqls", - "typescript-tools", - "tsserver", - "eslint", + }, + }, + config = { + eslint = { + settings = { + eslint = { + format = { + enable = true, + }, + autoFixOnSave = true, + }, + }, }, }, }, diff --git a/lua/plugins/html-css.lua b/lua/plugins/html-css.lua new file mode 100644 index 0000000..f152526 --- /dev/null +++ b/lua/plugins/html-css.lua @@ -0,0 +1,37 @@ +return { + { import = "astrocommunity.pack.json" }, + { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "html", "css" }) + end + end, + }, + { + "williamboman/mason-lspconfig.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = + require("astrocore").list_insert_unique(opts.ensure_installed, { "html", "cssls", "emmet_ls" }) + end, + }, + { + "AstroNvim/astrolsp", + opts = { + config = { + html = { init_options = { provideFormatter = false } }, + cssls = { init_options = { provideFormatter = false } }, + }, + }, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = + require("astrocore").list_insert_unique(opts.ensure_installed, { "html-lsp", "css-lsp", "emmet-ls" }) + end, + }, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 3770cb3..7b0eb3e 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -5,11 +5,7 @@ return { "nvimtools/none-ls.nvim", dependencies = { "nvimtools/none-ls-extras.nvim" }, opts = function(_, config) - config.sources = { - require "none-ls.diagnostics.eslint_d", - require "none-ls.formatting.eslint_d", - require "none-ls.code_actions.eslint_d", - } + config.sources = {} return config -- return final config table end, } diff --git a/lua/plugins/typescript.lua b/lua/plugins/typescript.lua new file mode 100644 index 0000000..7708750 --- /dev/null +++ b/lua/plugins/typescript.lua @@ -0,0 +1,91 @@ +return { + "AstroNvim/astrocommunity", + { import = "astrocommunity.pack.json" }, + { import = "astrocommunity.lsp.nvim-lsp-file-operations" }, + { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = + require("astrocore").list_insert_unique(opts.ensure_installed, { "javascript", "typescript", "tsx", "jsdoc" }) + end + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "tsserver", "eslint" }) + end, + }, + { + "jay-babu/mason-nvim-dap.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "js" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique( + opts.ensure_installed, + { "typescript-language-server", "eslint-lsp", "js-debug-adapter" } + ) + end, + }, + { + "vuki656/package-info.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + opts = {}, + event = "BufRead package.json", + }, + { + "dmmulroy/tsc.nvim", + cmd = "TSC", + opts = {}, + }, + { + "mfussenegger/nvim-dap", + optional = true, + config = function() + local dap = require "dap" + dap.adapters["pwa-node"] = { + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + args = { + require("mason-registry").get_package("js-debug-adapter"):get_install_path() + .. "/js-debug/src/dapDebugServer.js", + "${port}", + }, + }, + } + local js_config = { + { + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = "${workspaceFolder}", + }, + { + type = "pwa-node", + request = "attach", + name = "Attach", + processId = require("dap.utils").pick_process, + cwd = "${workspaceFolder}", + }, + } + + if not dap.configurations.javascript then + dap.configurations.javascript = js_config + else + require("astrocore").extend_tbl(dap.configurations.javascript, js_config) + end + end, + }, +} diff --git a/lua/plugins/yaml.lua b/lua/plugins/yaml.lua new file mode 100644 index 0000000..3556bf6 --- /dev/null +++ b/lua/plugins/yaml.lua @@ -0,0 +1,51 @@ +return { + { + "b0o/SchemaStore.nvim", + lazy = true, + dependencies = { + { + "AstroNvim/astrolsp", + optional = true, + ---@type AstroLSPOpts + opts = { + ---@diagnostic disable: missing-fields + config = { + yamlls = { + on_new_config = function(config) + config.settings.yaml.schemas = vim.tbl_deep_extend( + "force", + config.settings.yaml.schemas or {}, + require("schemastore").yaml.schemas() + ) + end, + settings = { yaml = { schemaStore = { enable = false, url = "" } } }, + }, + }, + }, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yaml" }) + end + end, + }, + { + "williamboman/mason-lspconfig.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yamlls" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "yaml-language-server" }) + end, + }, +}