mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 00:25:47 +02:00
add mograte from dev
This commit is contained in:
parent
f5f74f80e0
commit
d2749f48eb
12 changed files with 440 additions and 120 deletions
|
@ -1,7 +1,7 @@
|
|||
vim.opt_local.expandtab = true
|
||||
vim.opt_local.shiftwidth = 4
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
-- vim.opt_local.expandtab = true
|
||||
-- vim.opt_local.shiftwidth = 4
|
||||
-- vim.opt_local.tabstop = 4
|
||||
-- vim.opt_local.softtabstop = 4
|
||||
|
||||
-- local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
-- if not status_ok then
|
||||
|
|
|
@ -13,37 +13,40 @@
|
|||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" },
|
||||
"codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" },
|
||||
"conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" },
|
||||
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "4036c8ae9cc29faf8e6443fa5b23e679db055d24" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "378bfb465673a747e9e9f966e518063499e20cfe" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "37c7163f8d27243993ac07db8477e44cd5275027" },
|
||||
"lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" },
|
||||
"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-java": { "branch": "main", "commit": "320f31c71b183f2c584198f33f93542fd0e5a768" },
|
||||
"noice.nvim": { "branch": "main", "commit": "d580646db85f49b8226d52b143a458161f41954a" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "336e84b9e43c0effb735b08798ffac382920053b" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "f1b438ab1709cf9d8875843559d20265013ac755" },
|
||||
"neotest-python": { "branch": "master", "commit": "2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50" },
|
||||
"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-python": { "branch": "master", "commit": "d777c2b32ed39f61209c09bede28d7491621a631" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
|
||||
"nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" },
|
||||
"nvim-material-icon": { "branch": "main", "commit": "5ad42234d880659dfe9d4ff936c310cd6c5a1610" },
|
||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||
"nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" },
|
||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-scrollview": { "branch": "main", "commit": "fd334e5ad0c616987d1b9114890a59c97165cf83" },
|
||||
"nvim-scrollview": { "branch": "main", "commit": "06563ae0c9928a2df42aefe66f2aed2f2943e32e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "09700b88b41ed96391de3d2010d74dc54fd5c210" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "c11d49cbefb3c22550747840843eb86ab4a3b267" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "ddfccbf0df1b9349c2b9e9b17f4afa8f9b6c1ed1" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" },
|
||||
|
@ -53,7 +56,7 @@
|
|||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
|
||||
"rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "58ec6eca1c3704d130d749843e16fbf6c8cdc57e" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "7bd2f9b72f8449780b79bcf351534e2cd36ec43a" },
|
||||
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
|
|
|
@ -70,7 +70,7 @@ pcode.mason_ensure_installed = { -- sebelumnya register_lsp
|
|||
-- tambahkan di bawah sini setelah melakukan :masoninstall
|
||||
}
|
||||
pcode.unregister_lsp = {
|
||||
"jdtls", -- tambahkan di bawah ini
|
||||
-- "jdtls", -- tambahkan di bawah ini
|
||||
}
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
|
||||
|
@ -169,9 +169,10 @@ pcode.active_javascript_config = {
|
|||
}
|
||||
pcode.active_php_config = false
|
||||
pcode.active_golang_config = false
|
||||
pcode.active_python_config = false
|
||||
pcode.active_python_config = true
|
||||
pcode.active_cpp_config = false
|
||||
pcode.active_java_config = {
|
||||
active = true,
|
||||
active = false,
|
||||
project = "gradle", -- gradle or maven
|
||||
use_nvim_jdtls = true, -- mfussenegger/nvim-jdtls
|
||||
}
|
||||
|
|
|
@ -62,20 +62,22 @@ return {
|
|||
end,
|
||||
},
|
||||
},
|
||||
opts = function()
|
||||
opts = function(_, opts)
|
||||
opts.skip_config = opts.skip_config or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
local servers = { "lua_ls" }
|
||||
local mason_install = pcode.mason_ensure_installed or {}
|
||||
local unregis_lsp = pcode.unregister_lsp or {}
|
||||
vim.list_extend(servers, mason_install)
|
||||
return {
|
||||
ensure_installed = servers,
|
||||
automatic_installation = true,
|
||||
}
|
||||
vim.list_extend(opts.ensure_installed, servers)
|
||||
vim.list_extend(opts.skip_config, unregis_lsp)
|
||||
opts.automatic_installation = true
|
||||
return opts
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mason-lspconfig").setup(opts)
|
||||
|
||||
local option = {}
|
||||
local unregis_lsp = pcode.unregister_lsp or {}
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name) -- default handler (optional)
|
||||
local capabilities = require("user.lsp.handlers").capabilities
|
||||
|
@ -83,7 +85,7 @@ return {
|
|||
capabilities.offsetEncoding = { "utf-16" }
|
||||
end
|
||||
local is_skip = false
|
||||
local my_index = idxOf(unregis_lsp, server_name)
|
||||
local my_index = idxOf(opts.skip_config, server_name)
|
||||
if my_index ~= nil then
|
||||
is_skip = true
|
||||
end
|
||||
|
|
|
@ -4,12 +4,36 @@ local M = {}
|
|||
if pcode.active_cpp_config then
|
||||
M = {
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.clang_format.with({ filetypes = { "cpp", "c" } }))
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "cpp", "c" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "clangd" })
|
||||
require("user.utils.masoncfg").try_install("clang-format")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "codelldb" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local package = "clang-format"
|
||||
require("user.utils.masoncfg").try_install(package)
|
||||
opts.formatters_by_ft.cpp = { package }
|
||||
opts.formatters_by_ft.c = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local M = {}
|
||||
if vim.fn.has("win32") == 0 and pcode.nvim_dap then
|
||||
if pcode.nvim_dap or pcode.active_cpp_config then
|
||||
M = {
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
@ -15,7 +15,7 @@ if vim.fn.has("win32") == 0 and pcode.nvim_dap then
|
|||
},
|
||||
},
|
||||
},
|
||||
enabled = vim.fn.has("win32") == 0,
|
||||
-- enabled = vim.fn.has("win32") == 0,
|
||||
config = function()
|
||||
require("user.dapui")
|
||||
end,
|
||||
|
@ -42,9 +42,25 @@ if vim.fn.has("win32") == 0 and pcode.nvim_dap then
|
|||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
|
||||
enabled = vim.fn.has("win32") == 0,
|
||||
config = function()
|
||||
require("user.mason_dap")
|
||||
opts = function(_, opts)
|
||||
local dap_data = pcode.dap_ensure_installed or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, dap_data)
|
||||
opts.automatic_setup = true
|
||||
opts.handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
|
||||
-- Keep original functionality
|
||||
require("mason-nvim-dap").default_setup(config)
|
||||
end,
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
-- enabled = vim.fn.has("win32") == 0,
|
||||
config = function(_, opts)
|
||||
require("mason").setup()
|
||||
require("mason-nvim-dap").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,9 +1,219 @@
|
|||
local M = {}
|
||||
local java_filetypes = { "java" }
|
||||
local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
|
||||
|
||||
-- Utility function to extend or override a config table, similar to the way
|
||||
-- that Plugin.opts works.
|
||||
---@param config table
|
||||
---@param custom function | table | nil
|
||||
local function extend_or_override(config, custom, ...)
|
||||
if type(custom) == "function" then
|
||||
config = custom(config, ...) or config
|
||||
elseif custom then
|
||||
config = vim.tbl_deep_extend("force", config, custom) --[[@as table]]
|
||||
end
|
||||
return config
|
||||
end
|
||||
|
||||
if pcode.active_java_config.active then
|
||||
M = {
|
||||
-- {
|
||||
-- "mfussenegger/nvim-jdtls",
|
||||
-- },
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.skip_config = opts.skip_config or {}
|
||||
if pcode.active_java_config.use_nvim_jdtls or false then
|
||||
vim.list_extend(opts.skip_config, { "jdtls" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-jdtls",
|
||||
ft = java_filetypes,
|
||||
enabled = pcode.active_java_config.use_nvim_jdtls or false,
|
||||
opts = function()
|
||||
return {
|
||||
root_dir = require("jdtls.setup").find_root(root_markers),
|
||||
project_name = function()
|
||||
return vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
|
||||
end,
|
||||
|
||||
-- Where are the config and workspace dirs for a project?
|
||||
jdtls_config_dir = function(project_name)
|
||||
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config"
|
||||
end,
|
||||
jdtls_workspace_dir = function(project_name)
|
||||
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace"
|
||||
end,
|
||||
cmd = { vim.fn.exepath("jdtls") },
|
||||
full_cmd = function(opts)
|
||||
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
|
||||
local cmd = vim.deepcopy(opts.cmd)
|
||||
if project_name then
|
||||
vim.list_extend(cmd, {
|
||||
"-configuration",
|
||||
opts.jdtls_config_dir(project_name),
|
||||
"-data",
|
||||
opts.jdtls_workspace_dir(project_name),
|
||||
})
|
||||
end
|
||||
return cmd
|
||||
end,
|
||||
|
||||
-- These depend on nvim-dap, but can additionally be disabled by setting false here.
|
||||
dap = { hotcodereplace = "auto", config_overrides = {} },
|
||||
dap_main = {},
|
||||
test = true,
|
||||
settings = {
|
||||
java = {
|
||||
inlayHints = {
|
||||
parameterNames = {
|
||||
enabled = "all",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
vim.opt_local.shiftwidth = 4
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
vim.opt_local.ts = 4
|
||||
vim.opt_local.expandtab = true
|
||||
|
||||
local mason_registry = require("mason-registry")
|
||||
local bundles = {} ---@type string[]
|
||||
if opts.dap and mason_registry.is_installed("java-debug-adapter") then
|
||||
local java_dbg_pkg = mason_registry.get_package("java-debug-adapter")
|
||||
local java_dbg_path = java_dbg_pkg:get_install_path()
|
||||
local jar_patterns = {
|
||||
java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar",
|
||||
}
|
||||
-- java-test also depends on java-debug-adapter.
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
local java_test_pkg = mason_registry.get_package("java-test")
|
||||
local java_test_path = java_test_pkg:get_install_path()
|
||||
vim.list_extend(jar_patterns, {
|
||||
java_test_path .. "/extension/server/*.jar",
|
||||
})
|
||||
end
|
||||
for _, jar_pattern in ipairs(jar_patterns) do
|
||||
for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do
|
||||
table.insert(bundles, bundle)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function attach_jdtls()
|
||||
local fname = vim.api.nvim_buf_get_name(0)
|
||||
|
||||
-- Configuration can be augmented and overridden by opts.jdtls
|
||||
local config = extend_or_override({
|
||||
cmd = opts.full_cmd(opts),
|
||||
root_dir = require("jdtls.setup").find_root(root_markers),
|
||||
init_options = {
|
||||
bundles = bundles,
|
||||
},
|
||||
settings = opts.settings,
|
||||
-- enable CMP capabilities
|
||||
capabilities = require("user.lsp.handlers").capabilities or nil,
|
||||
}, opts.jdtls)
|
||||
|
||||
-- Existing server will be reused if the root_dir matches.
|
||||
require("jdtls").start_or_attach(config)
|
||||
-- not need to require("jdtls.setup").add_commands(), start automatically adds commands
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = java_filetypes,
|
||||
callback = attach_jdtls,
|
||||
})
|
||||
|
||||
-- Setup keymap and dap after the lsp is fully attached.
|
||||
-- https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration
|
||||
-- https://neovim.io/doc/user/lsp.html#LspAttach
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client and client.name == "jdtls" then
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
["<leader>cx"] = { name = "+extract" },
|
||||
["<leader>cxv"] = { require("jdtls").extract_variable_all, "Extract Variable" },
|
||||
["<leader>cxc"] = { require("jdtls").extract_constant, "Extract Constant" },
|
||||
["gs"] = { require("jdtls").super_implementation, "Goto Super" },
|
||||
["<leader>co"] = { require("jdtls").organize_imports, "Organize Imports" },
|
||||
}, { mode = "n", buffer = args.buf })
|
||||
wk.register({
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>cx"] = { name = "+extract" },
|
||||
["<leader>cxm"] = {
|
||||
[[<ESC><CMD>lua require('jdtls').extract_method(true)<CR>]],
|
||||
"Extract Method",
|
||||
},
|
||||
["<leader>cxv"] = {
|
||||
[[<ESC><CMD>lua require('jdtls').extract_variable_all(true)<CR>]],
|
||||
"Extract Variable",
|
||||
},
|
||||
["<leader>cxc"] = {
|
||||
[[<ESC><CMD>lua require('jdtls').extract_constant(true)<CR>]],
|
||||
"Extract Constant",
|
||||
},
|
||||
}, { mode = "v", buffer = args.buf })
|
||||
|
||||
if opts.dap and mason_registry.is_installed("java-debug-adapter") then
|
||||
-- custom init for Java debugger
|
||||
require("jdtls").setup_dap(opts.dap)
|
||||
require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main)
|
||||
|
||||
-- Java Test require Java debugger to work
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
-- custom keymaps for Java test runner (not yet compatible with neotest)
|
||||
wk.register({
|
||||
["<leader>t"] = { name = "+test" },
|
||||
["<leader>tt"] = { require("jdtls.dap").test_class, "Run All Test" },
|
||||
["<leader>tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" },
|
||||
["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" },
|
||||
}, { mode = "n", buffer = args.buf })
|
||||
end
|
||||
end
|
||||
|
||||
-- User can set additional keymaps in opts.on_attach
|
||||
if opts.on_attach then
|
||||
opts.on_attach(args)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Avoid race condition by calling attach the first time, since the autocmd won't fire.
|
||||
attach_jdtls()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "java" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "jdtls" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local package = "lsp_fmt"
|
||||
require("user.utils.masoncfg").try_install("java-debug-adapter")
|
||||
require("user.utils.masoncfg").try_install("java-test")
|
||||
opts.formatters_by_ft.java = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
|
@ -46,33 +256,48 @@ if pcode.active_java_config.active then
|
|||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- "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.java = { "lsp_fmt" }
|
||||
-- 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" }, "<leader>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,
|
||||
-- },
|
||||
{
|
||||
"rockerBOO/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
config = function()
|
||||
require("symbols-outline").setup({
|
||||
symbols = {
|
||||
File = { icon = "", hl = "@text.uri" },
|
||||
Module = { icon = "", hl = "@namespace" },
|
||||
Namespace = { icon = "", hl = "@namespace" },
|
||||
Package = { icon = "", hl = "@namespace" },
|
||||
Class = { icon = "𝓒", hl = "@type" },
|
||||
Method = { icon = "ƒ", hl = "@method" },
|
||||
Property = { icon = "", hl = "@method" },
|
||||
Field = { icon = "", hl = "@field" },
|
||||
Constructor = { icon = "", hl = "@constructor" },
|
||||
Enum = { icon = "ℰ", hl = "@type" },
|
||||
Interface = { icon = "", hl = "@type" },
|
||||
Function = { icon = "", hl = "@function" },
|
||||
Variable = { icon = "", hl = "@constant" },
|
||||
Constant = { icon = "", hl = "@constant" },
|
||||
String = { icon = "𝓐", hl = "@string" },
|
||||
Number = { icon = "#", hl = "@number" },
|
||||
Boolean = { icon = " ", hl = "@boolean" },
|
||||
Array = { icon = "", hl = "@constant" },
|
||||
Object = { icon = "⦿", hl = "@type" },
|
||||
Key = { icon = "🔐", hl = "@type" },
|
||||
Null = { icon = "NULL", hl = "@type" },
|
||||
EnumMember = { icon = "", hl = "@field" },
|
||||
Struct = { icon = "𝓢", hl = "@type" },
|
||||
Event = { icon = "🗲", hl = "@type" },
|
||||
Operator = { icon = "+", hl = "@operator" },
|
||||
TypeParameter = { icon = "𝙏", hl = "@parameter" },
|
||||
Component = { icon = "", hl = "@function" },
|
||||
Fragment = { icon = "", hl = "@constant" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>S", "<cmd>SymbolsOutline<cr>", desc = "Toggle Outline" },
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -102,6 +102,31 @@ if pcode.active_python_config then
|
|||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "python" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "pyright" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local package = "black"
|
||||
require("user.utils.masoncfg").try_install("flake8")
|
||||
require("user.utils.masoncfg").try_install("black")
|
||||
require("user.utils.masoncfg").try_install("debugpy")
|
||||
opts.formatters_by_ft.python = { package }
|
||||
end,
|
||||
},
|
||||
}
|
||||
if vim.fn.has("win32") ~= 0 then
|
||||
table.insert(M, nvim_dap)
|
||||
|
|
|
@ -9,6 +9,9 @@ return {
|
|||
}
|
||||
local live_grep = {
|
||||
only_sort_text = true,
|
||||
additional_args = function()
|
||||
return { "--multiline" }
|
||||
end,
|
||||
}
|
||||
if pcode.telescope_theme_find_file and pcode.telescope_theme_find_file ~= "center" then
|
||||
find_files = {
|
||||
|
@ -20,6 +23,9 @@ return {
|
|||
live_grep = {
|
||||
theme = pcode.telescope_theme_live_grep,
|
||||
only_sort_text = true,
|
||||
additional_args = function()
|
||||
return { "--multiline" }
|
||||
end,
|
||||
}
|
||||
end
|
||||
local actions = require("telescope.actions")
|
||||
|
|
|
@ -37,6 +37,20 @@ _G.idxOf = function(array, value)
|
|||
return nil
|
||||
end
|
||||
|
||||
_G.unique_list = function(list)
|
||||
local seen = {}
|
||||
local result = {}
|
||||
|
||||
for _, val in ipairs(list) do
|
||||
if not seen[val] then
|
||||
table.insert(result, val)
|
||||
seen[val] = true
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
-- run if rust config true
|
||||
if pcode.active_rust_config then
|
||||
table.insert(pcode.mason_ensure_installed, "rust_analyzer")
|
||||
|
@ -62,7 +76,7 @@ if pcode.active_php_config then
|
|||
end
|
||||
table.insert(pcode.mason_ensure_installed, "intelephense")
|
||||
table.insert(pcode.mason_ensure_installed, "stimulus_ls")
|
||||
table.insert(pcode.null_ls_ensure_installed, "phpcbf")
|
||||
table.insert(pcode.null_ls_ensure_installed, "php-cs-fixer")
|
||||
table.insert(pcode.null_ls_ensure_installed, "blade_formatter")
|
||||
table.insert(pcode.null_ls_ensure_installed, "phpcs")
|
||||
end
|
||||
|
@ -78,29 +92,29 @@ if pcode.active_golang_config then
|
|||
end
|
||||
-- run if python config true
|
||||
if pcode.active_python_config then
|
||||
table.insert(pcode.treesitter_ensure_installed, "python")
|
||||
table.insert(pcode.mason_ensure_installed, "pyright")
|
||||
table.insert(pcode.null_ls_ensure_installed, "flake8")
|
||||
table.insert(pcode.null_ls_ensure_installed, "black")
|
||||
-- table.insert(pcode.treesitter_ensure_installed, "python")
|
||||
-- table.insert(pcode.mason_ensure_installed, "pyright")
|
||||
-- table.insert(pcode.null_ls_ensure_installed, "flake8")
|
||||
-- table.insert(pcode.null_ls_ensure_installed, "black")
|
||||
if vim.fn.has("win32") ~= 1 then
|
||||
pcode.nvim_dap = true
|
||||
end
|
||||
end
|
||||
-- run if cpp config true
|
||||
if pcode.active_cpp_config then
|
||||
table.insert(pcode.treesitter_ensure_installed, "cpp")
|
||||
table.insert(pcode.treesitter_ensure_installed, "c")
|
||||
table.insert(pcode.mason_ensure_installed, "clangd")
|
||||
table.insert(pcode.null_ls_ensure_installed, "clang_format")
|
||||
table.insert(pcode.dap_ensure_installed, "codelldb")
|
||||
pcode.nvim_dap = true
|
||||
end
|
||||
-- if pcode.active_cpp_config then
|
||||
-- table.insert(pcode.treesitter_ensure_installed, "cpp")
|
||||
-- table.insert(pcode.treesitter_ensure_installed, "c")
|
||||
-- table.insert(pcode.mason_ensure_installed, "clangd")
|
||||
-- table.insert(pcode.null_ls_ensure_installed, "clang_format")
|
||||
-- table.insert(pcode.dap_ensure_installed, "codelldb")
|
||||
-- pcode.nvim_dap = true
|
||||
-- end
|
||||
-- run if java config true
|
||||
if pcode.active_java_config.active then
|
||||
table.insert(pcode.treesitter_ensure_installed, "java")
|
||||
table.insert(pcode.mason_ensure_installed, "jdtls")
|
||||
table.insert(pcode.null_ls_ensure_installed, "google_java_format")
|
||||
-- table.insert(pcode.dap_ensure_installed, "javadbg")
|
||||
-- table.insert(pcode.unregister_lsp, "jdtls")
|
||||
end
|
||||
-- if pcode.active_java_config.active and pcode.active_java_config.use_nvim_jdtls then
|
||||
-- table.insert(pcode.treesitter_ensure_installed, "java")
|
||||
-- table.insert(pcode.mason_ensure_installed, "jdtls")
|
||||
-- table.insert(pcode.null_ls_ensure_installed, "google_java_format")
|
||||
-- table.insert(pcode.dap_ensure_installed, "javadbg")
|
||||
-- table.insert(pcode.unregister_lsp, "jdtls")
|
||||
-- end
|
||||
return {}
|
||||
|
|
|
@ -1,38 +1,41 @@
|
|||
-- https://luals.github.io/wiki/settings/
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
format = {
|
||||
enable = false,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim", "spec" },
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
special = {
|
||||
spec = "require",
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
hint = {
|
||||
enable = false,
|
||||
arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable"
|
||||
await = true,
|
||||
paramName = "Disable", -- "All" | "Literal" | "Disable"
|
||||
paramType = true,
|
||||
semicolon = "All", -- "All" | "SameLine" | "Disable"
|
||||
setType = false,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
Lua = {
|
||||
format = {
|
||||
enable = false,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim", "spec" },
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
special = {
|
||||
spec = "require",
|
||||
},
|
||||
},
|
||||
-- workspace = {
|
||||
-- checkThirdParty = false,
|
||||
-- library = {
|
||||
-- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
-- [vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
-- },
|
||||
-- },
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
hint = {
|
||||
enable = false,
|
||||
arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable"
|
||||
await = true,
|
||||
paramName = "Disable", -- "All" | "Literal" | "Disable"
|
||||
paramType = true,
|
||||
semicolon = "All", -- "All" | "SameLine" | "Disable"
|
||||
setType = false,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
filetypes = { "blade" },
|
||||
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
|
||||
singe_file_support = true,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue