diff --git a/lazy-lock.json b/lazy-lock.json index 7f3ae3e..e83af26 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -24,13 +24,15 @@ "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" }, "mason-null-ls.nvim": { "branch": "main", "commit": "2b8433f76598397fcc97318d410e0c4f7a4bea6a" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "f5425eb1d0d794f0305d5eeebddabb74614683ff" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mini.indentscope": { "branch": "main", "commit": "56d42be090e8fcc68eda69cfe55af8c5e562300e" }, "neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" }, "neotest": { "branch": "master", "commit": "f30bab1faef13d47f3905e065215c96a42d075ad" }, - "neotest-gtest": { "branch": "main", "commit": "b44c8afc26cea75ffc80617ce07b4e745a56e589" }, - "neotest-java": { "branch": "main", "commit": "320f31c71b183f2c584198f33f93542fd0e5a768" }, + "neotest-golang": { "branch": "main", "commit": "7d0c75265cbd4567f4a41795c263913c354c7a91" }, "neotest-phpunit": { "branch": "main", "commit": "baae8dfa0a3aaacd9f0bb6845d6348f5bcdc48bb" }, + "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, + "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, "noice.nvim": { "branch": "main", "commit": "8f1d9966762e62fa8788e5fb1a5f6a86784221d9" }, "none-ls-extras.nvim": { "branch": "main", "commit": "336e84b9e43c0effb735b08798ffac382920053b" }, "none-ls.nvim": { "branch": "main", "commit": "f1b438ab1709cf9d8875843559d20265013ac755" }, @@ -39,8 +41,9 @@ "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-dap": { "branch": "master", "commit": "5ba8ceace596360321cf33fa4b56d9d46e057ce9" }, + "nvim-dap-go": { "branch": "main", "commit": "a0c5a2b991d7e9304a9a032cf177e22a4b0acda1" }, "nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" }, - "nvim-jdtls": { "branch": "master", "commit": "a5c6f38f8151d7b4f5b32c005a95022fa66f4c9d" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" }, "nvim-lint": { "branch": "master", "commit": "941fa1220a61797a51f3af9ec6b7d74c8c7367ce" }, "nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" }, "nvim-material-icon": { "branch": "main", "commit": "2f1d6333bbec2e787774193c9fc7b447b878069a" }, diff --git a/lua/custom/default.lua b/lua/custom/default.lua index d5a28f0..4eaa729 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -157,10 +157,10 @@ pcode.active_javascript_config = { jest_config = "jest.config.mjs", } pcode.active_php_config = true -pcode.active_golang_config = false +pcode.active_golang_config = true pcode.active_python_config = false -pcode.active_cpp_config = true +pcode.active_cpp_config = false pcode.active_java_config = { - active = true, + active = false, project = "gradle", -- gradle or maven } diff --git a/lua/plugins/gocfg.lua b/lua/plugins/gocfg.lua index 245f4ac..3d627d4 100644 --- a/lua/plugins/gocfg.lua +++ b/lua/plugins/gocfg.lua @@ -134,6 +134,45 @@ if pcode.active_golang_config then }) end, }, + { + "mfussenegger/nvim-lint", + events = { "BufWritePost", "BufReadPost", "InsertLeave" }, + opts = function(_, opts) + opts.linters_by_ft = opts.linters_by_ft or {} + opts.linters_by_ft.go = { "golangcilint" } + return opts + end, + config = function(_, opts) + require("lint").linters_by_ft = opts.linters_by_ft + end, + }, + { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = function(_, opts) + local psave = pcode.format_on_save or 0 + opts.formatters_by_ft = opts.formatters_by_ft or {} + opts.formatters_by_ft.go = { "gofmt" } + if psave == 1 then + opts.format_on_save = { + timeout_ms = pcode.format_timeout_ms or 500, + lsp_fallback = true, + } + end + return opts + end, + config = function(_, opts) + local conform = require("conform") + conform.setup(opts) + vim.keymap.set({ "n", "v" }, "lF", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = pcode.format_timeout_ms or 500, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, + }, } end diff --git a/lua/plugins/phpcfg.lua b/lua/plugins/phpcfg.lua index 0f737ca..8e8f64e 100644 --- a/lua/plugins/phpcfg.lua +++ b/lua/plugins/phpcfg.lua @@ -128,7 +128,7 @@ if pcode.active_php_config then conform.format({ lsp_fallback = true, async = false, - timeout_ms = 500, + timeout_ms = pcode.format_timeout_ms or 500, }) end, { desc = "Format file or range (in visual mode)" }) end, diff --git a/lua/plugins/themes/_globalvar.lua b/lua/plugins/themes/_globalvar.lua index b69bff3..3d0a6b5 100644 --- a/lua/plugins/themes/_globalvar.lua +++ b/lua/plugins/themes/_globalvar.lua @@ -59,8 +59,6 @@ if pcode.active_golang_config then table.insert(pcode.treesitter_ensure_installed, ts) end table.insert(pcode.mason_ensure_installed, "gopls") - table.insert(pcode.null_ls_ensure_installed, "ast_grep") - table.insert(pcode.null_ls_ensure_installed, "gofumpt") end -- run if python config true if pcode.active_python_config then