enc: config default golang

This commit is contained in:
asep.komarudin 2024-06-29 11:07:33 +07:00
parent a7ae61e8af
commit 0d0de22c7b
4 changed files with 46 additions and 12 deletions

View file

@ -28,14 +28,17 @@
"mini.indentscope": { "branch": "main", "commit": "56d42be090e8fcc68eda69cfe55af8c5e562300e" },
"neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" },
"neotest": { "branch": "master", "commit": "f30bab1faef13d47f3905e065215c96a42d075ad" },
"neotest-gtest": { "branch": "main", "commit": "b44c8afc26cea75ffc80617ce07b4e745a56e589" },
"neotest-golang": { "branch": "main", "commit": "b31607b6936f7965eb14355e7f4f2ac8d71f820a" },
"neotest-java": { "branch": "main", "commit": "320f31c71b183f2c584198f33f93542fd0e5a768" },
"neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
"neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" },
"noice.nvim": { "branch": "main", "commit": "03c6a75661e68012e30b0ed81f050358b1e2233c" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"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-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
"nvim-jdtls": { "branch": "master", "commit": "a5c6f38f8151d7b4f5b32c005a95022fa66f4c9d" },

View file

@ -168,9 +168,9 @@ pcode.active_javascript_config = {
jest_config = "jest.config.mjs",
}
pcode.active_php_config = false
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,
project = "gradle", -- gradle or maven

View file

@ -3,6 +3,37 @@
local M = {}
if pcode.active_golang_config then
M = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "go", "gomod", "gosum", "gotmpl", "gowork" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "gopls" })
end,
},
{
"stevearc/conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "gofumpt"
require("user.utils.masoncfg").try_install(package)
opts.formatters_by_ft.python = { package }
end,
},
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
require("user.utils.masoncfg").try_install("ast-grep")
opts.linters_by_ft.php = { "ast-grep" }
end,
},
{
"nvim-neotest/neotest",
event = "VeryLazy",

View file

@ -81,15 +81,15 @@ if pcode.active_php_config then
table.insert(pcode.null_ls_ensure_installed, "phpcs")
end
-- run if golang config true
if pcode.active_golang_config then
local lst_ts = { "go", "gomod", "gosum", "gotmpl", "gowork" }
for _, ts in pairs(lst_ts) do
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
-- if pcode.active_golang_config then
-- local lst_ts = { "go", "gomod", "gosum", "gotmpl", "gowork" }
-- for _, ts in pairs(lst_ts) do
-- 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
-- table.insert(pcode.treesitter_ensure_installed, "python")