diff --git a/lazy-lock.json b/lazy-lock.json index 773c275..bf15f4a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,49 +1,50 @@ { "LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" }, - "SchemaStore.nvim": { "branch": "main", "commit": "c957914d75b4a008ce09f4116e57e59fe6e3fae1" }, - "blink.cmp": { "branch": "main", "commit": "586ee87534f5bf65f1c8dea2d1da2a57e8cddd36" }, + "SchemaStore.nvim": { "branch": "main", "commit": "21a54161a87ab38b85d8b1eb52cc86c973a5fafe" }, + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" }, - "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, + "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" }, + "conform.nvim": { "branch": "master", "commit": "3543d000dafbc41cc7761d860cfdb24e82154f75" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "07326bb95827f1f4b7d7aead5e8094d844588d08" }, - "gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" }, - "grug-far.nvim": { "branch": "main", "commit": "45981a9af7f4e666a3cdaedb1d21d2ab926727a2" }, + "fzf-lua": { "branch": "main", "commit": "5d2ba91230356dce4dac52df32ddc6cf5a940d56" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "463e5e7441c17c0f9fba35b3016e7691a78983b9" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "5fcd0dfdcf55d8a1c1a02cccc14ee5d79728a496" }, - "mason.nvim": { "branch": "main", "commit": "253961cfe9b0a63b2524088be294acd7522366e5" }, - "mini.ai": { "branch": "main", "commit": "e66a71449bdf719b4b9c96e0cd7b7d6cc4112f88" }, - "mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" }, - "mini.pairs": { "branch": "main", "commit": "42407ccb80ec59c84e7c91d815f42ed90a8cc093" }, - "neo-tree.nvim": { "branch": "main", "commit": "b85cc7611ff8fb443b0a1591c53669ead195a826" }, - "neotest": { "branch": "master", "commit": "3c81345c28cd639fcc02843ed3653be462f47024" }, - "neotest-golang": { "branch": "main", "commit": "9521843942423fcac9991c596ff19c1f4f500650" }, - "neotest-minitest": { "branch": "main", "commit": "7ff057de8ab2c27491ff27c7be9826b8f3bb5ec1" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.ai": { "branch": "main", "commit": "1cd4f021a05c29acd4ab511c0981da14217daf38" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "mini.pairs": { "branch": "main", "commit": "1e1ca3f60f58d4050bf814902b472eec9963a5dd" }, + "neo-tree.nvim": { "branch": "main", "commit": "bbeda076c8a2e7d16614287cd70239f577e5bf55" }, + "neotest": { "branch": "master", "commit": "35a59c1f59dbb954d92b74ab64a966a668cea495" }, + "neotest-golang": { "branch": "main", "commit": "fa49d01f28ccb6262914f344a831eec8855e57f1" }, + "neotest-minitest": { "branch": "main", "commit": "4d1c19f80be0efff7656dea76a589c02bf418b68" }, "neotest-python": { "branch": "master", "commit": "ed9b4d794b89044cc32e5476e637936331473c6e" }, "neotest-rspec": { "branch": "main", "commit": "825bc085b7a691860d5cafc5fa7ab140c713e6c8" }, + "neotest-vitest": { "branch": "main", "commit": "a6099e1fb55a2c2851da3dd0f4d510af9a234c92" }, "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, "nord": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" }, + "nvim-dap": { "branch": "master", "commit": "f777d1d20ed50c2f312e286892c062d9c2f1c6fe" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, - "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, + "nvim-dap-python": { "branch": "master", "commit": "eafd6d3b6175b6f7e5ecaadbcf604a1bb7419351" }, "nvim-dap-ruby": { "branch": "main", "commit": "ba36f9905ca9c6d89e5af5467a52fceeb2bbbf6d" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, - "nvim-lint": { "branch": "master", "commit": "52e603c4b66f2fb4f268916725076e6c3ae412fd" }, - "nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, + "nvim-lint": { "branch": "master", "commit": "ee04d481d4e6089892c2fb2ad8924b1a053591e1" }, + "nvim-lspconfig": { "branch": "master", "commit": "1c505a2a37c7732fb2a7e290c0f822abfb2ba1c5" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown.nvim": { "branch": "main", "commit": "7620d4e96eb5cf8d12e76c6fcaf1267628564ba9" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "c4ff9acddcf0f79b3187393319adb5cac5865bd3" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, diff --git a/lua/plugins/format.lua b/lua/plugins/conform.lua similarity index 52% rename from lua/plugins/format.lua rename to lua/plugins/conform.lua index bd998a2..aebe9bd 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/conform.lua @@ -1,3 +1,37 @@ +local has_prettier_config = function() + local configs = { + ".prettierrc", + ".prettierrc.json", + ".prettierrc.yml", + ".prettierrc.yaml", + ".prettierrc.js", + ".prettierrc.mjs", + ".prettierrc.cjs", + "prettier.config.js", + "prettier.config.mjs", + "prettier.config.cjs", + } + + for _, config in ipairs(configs) do + if vim.fn.findfile(config, ".;") ~= "" then + return true + end + end + + local package_json = vim.fn.findfile("package.json", ".;") + if package_json ~= "" then + local ok, content = pcall(vim.fn.readfile, package_json) + if ok then + local still_ok, parsed = pcall(vim.json.decode, content) + if still_ok and parsed.prettier then + return true + end + end + end + + return false +end + return { { "stevearc/conform.nvim", @@ -17,9 +51,9 @@ return { javascriptreact = { "prettier" }, typescript = { "prettier" }, typescriptreact = { "prettier" }, - json = { "fixjson" }, - jsonc = { "fixjson" }, - yaml = { "yamlfix" }, + json = has_prettier_config() and { "prettier" } or { "fixjson" }, + jsonc = has_prettier_config() and { "prettier" } or { "fixjson" }, + yaml = has_prettier_config() and { "prettier" } or { "yamlfix" }, markdown = { "markdownlint" }, ["markdown.mdx"] = { "markdownlint" }, python = { "ruff_format" }, diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..f6966b6 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,90 @@ +-- lua/plugins/dap-js.lua +return { + { + "mfussenegger/nvim-dap", + dependencies = { "jay-babu/mason-nvim-dap.nvim" }, + + opts = function() + local dap = require("dap") + + if not dap.adapters["pwa-node"] then + local js_debug_path = + require("lazyvim.util").get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js") + if vim.fn.filereadable(js_debug_path) == 0 then + vim.notify("js-debug-adapter not found", vim.log.levels.WARN) + return + end + + dap.adapters["pwa-node"] = { + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + args = { + js_debug_path, + "${port}", + }, + }, + } + end + + -- Shared defaults + local common = { + cwd = "${workspaceFolder}", + skipFiles = { "/**", "**/node_modules/**" }, + resolveSourceMapLocations = { "${workspaceFolder}/**", "!**/node_modules/**" }, + autoAttachChildProcesses = true, + } + + local function with_common(tbl) + for k, v in pairs(common) do + if tbl[k] == nil then + tbl[k] = v + end + end + return tbl + end + + -- Configurations for TS/JS + local configs = { + with_common({ + type = "pwa-node", + request = "launch", + name = "Launch file (tsx)", + program = "${file}", + runtimeExecutable = "node", + runtimeArgs = { "--loader=tsx" }, + console = "integratedTerminal", + }), + with_common({ + type = "pwa-node", + request = "attach", + name = "Attach 9229", + port = 9229, + restart = true, + }), + with_common({ + type = "pwa-node", + request = "launch", + name = "Nodemon (tsx)", + runtimeExecutable = "nodemon", + runtimeArgs = { + "--exec", + "node --loader=tsx", + "--signal", + "SIGTERM", + "${workspaceFolder}/src/index.ts", + }, + restart = true, + console = "integratedTerminal", + }), + } + + dap.configurations.typescript = configs + dap.configurations.javascript = configs + dap.configurations.typescriptreact = configs + dap.configurations.javascriptreact = configs + end, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index cac86c5..99172f5 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -31,4 +31,21 @@ return { lazy = true, version = false, -- last release is way too old }, + { + "nvim-lspconfig", + opts = { + servers = { + jinja_lsp = { + filetypes = { "jinja", "html" }, + }, + vtsls = { + preferences = { + -- importModuleSpecifier = "relative", + importModuleSpecifier = "non-relative", + importModuleSpecifierEnding = "minimal", + }, + }, + }, + }, + }, } diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index a82ef96..4902e0b 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -23,20 +23,8 @@ return { "prettierd", "nixfmt", "yamlfix", - }, - }, - }, - { - "nvim-lspconfig", - opts = { - servers = { - vtsls = { - preferences = { - -- importModuleSpecifier = "relative", - importModuleSpecifier = "non-relative", - importModuleSpecifierEnding = "minimal", - }, - }, + "jinja-lsp", + "django-template-lsp", }, }, }, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index e0ecb15..c94d43f 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -6,9 +6,11 @@ return { filtered_items = { hide_dotfiles = false, hide_gitignored = true, - always_show = { ".aws", ".circleci", ".github" }, + always_show = { ".aws", ".circleci", ".github", ".env" }, always_show_by_pattern = { ".env*", + "devbox.*", + ".venv", }, }, }, diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index 45e850f..543d78c 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -4,6 +4,7 @@ return { "nvim-neotest/neotest", dependencies = { "zidhuss/neotest-minitest", + "marilari88/neotest-vitest", }, config = { adapters = { @@ -17,6 +18,7 @@ return { }) end, }, + ["neotest-vitest"] = {}, }, }, },