136 lines
4.5 KiB
Lua
136 lines
4.5 KiB
Lua
-- The MIT License (MIT)
|
|
--
|
|
-- Copyright © 2026 Scott E. Graves <scott.e.graves@protonmail.com>
|
|
--
|
|
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
-- and associated documentation files (the “Software”), to deal in the Software without restriction,
|
|
-- including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
-- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
-- furnished to do so, subject to the following conditions:
|
|
--
|
|
-- The above copyright notice and this permission notice shall be included in all copies or
|
|
-- substantial portions of the Software.
|
|
--
|
|
-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
-- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
--
|
|
require("darcula.config")
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
"PackChanged",
|
|
{
|
|
callback = function(ev)
|
|
local kind = ev.data.kind
|
|
if (ev.data.kind ~= "install" and kind ~= "update") then
|
|
return
|
|
end
|
|
|
|
local name = ev.data.spec.name
|
|
if NV_DARCULA_ENABLE_COC then
|
|
if name == "coc.nvim" then
|
|
vim.system(
|
|
{"npm", "i"},
|
|
{
|
|
cwd = vim.fs.joinpath(
|
|
vim.fn.stdpath("data"),
|
|
"site",
|
|
"pack",
|
|
"core",
|
|
"opt",
|
|
"coc.nvim"
|
|
)
|
|
}
|
|
):wait()
|
|
return
|
|
end
|
|
end
|
|
end
|
|
}
|
|
)
|
|
|
|
local packages = {
|
|
{src = "https://github.com/nvim-lua/plenary.nvim"},
|
|
{src = "https://github.com/rktjmp/lush.nvim"},
|
|
{src = "https://git.fifthgrid.com/sgraves/darcula_lush"}
|
|
}
|
|
|
|
if NV_DARCULA_ENABLE_COC then
|
|
vim.list_extend(
|
|
packages,
|
|
{
|
|
{src = "https://github.com/neoclide/coc.nvim", {version = "release"}},
|
|
{src = "https://github.com/fannheyward/telescope-coc.nvim"},
|
|
{src = "https://github.com/honza/vim-snippets"}
|
|
}
|
|
)
|
|
else
|
|
vim.list_extend(
|
|
packages,
|
|
{
|
|
{src = "https://github.com/neovim/nvim-lspconfig"},
|
|
{src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"},
|
|
{src = "https://github.com/akinsho/flutter-tools.nvim"},
|
|
{src = "https://github.com/kosayoda/nvim-lightbulb"},
|
|
{src = "https://github.com/mason-org/mason-lspconfig.nvim"},
|
|
{src = "https://github.com/mason-org/mason.nvim"}
|
|
}
|
|
)
|
|
end
|
|
|
|
vim.list_extend(
|
|
packages,
|
|
{
|
|
{
|
|
src = "https://github.com/catgoose/nvim-colorizer.lua",
|
|
version = "85a5e83cd4daa258cf95c3204e277991d6fbe747"
|
|
},
|
|
{src = "https://github.com/dart-lang/dart-vim-plugin"},
|
|
{src = "https://github.com/dstein64/nvim-scrollview"},
|
|
{src = "https://github.com/kyazdani42/nvim-tree.lua"},
|
|
{src = "https://github.com/leoluz/nvim-dap-go"},
|
|
{src = "https://github.com/lewis6991/gitsigns.nvim"},
|
|
{src = "https://github.com/mfussenegger/nvim-dap"},
|
|
{src = "https://github.com/mhartington/formatter.nvim"},
|
|
{src = "https://github.com/nvim-mini/mini.nvim"},
|
|
{src = "https://github.com/nvim-neotest/nvim-nio"},
|
|
{src = "https://github.com/nvim-telescope/telescope-ui-select.nvim"},
|
|
{src = "https://github.com/nvim-telescope/telescope.nvim"},
|
|
{src = "https://github.com/nvim-treesitter/nvim-treesitter"},
|
|
{src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"},
|
|
{src = "https://github.com/rcarriga/nvim-dap-ui"},
|
|
{src = "https://github.com/rktjmp/shipwright.nvim"},
|
|
{src = "https://github.com/sgraves76/cppman.nvim"},
|
|
{src = "https://github.com/stevearc/dressing.nvim"},
|
|
{src = "https://github.com/ten3roberts/window-picker.nvim"},
|
|
{src = "https://github.com/tpope/vim-dispatch"},
|
|
{src = "https://github.com/tpope/vim-fugitive"}
|
|
}
|
|
)
|
|
|
|
vim.pack.add(packages, {confirm = false})
|
|
|
|
local theme_set = false
|
|
local set_colorscheme = function()
|
|
if theme_set then
|
|
return
|
|
end
|
|
|
|
vim.cmd("colorscheme " .. NV_DARCULA_COLOR_SCHEME)
|
|
theme_set = true
|
|
end
|
|
|
|
for _, pkg in ipairs(packages) do
|
|
local parts = vim.split(pkg.src, "/", {plain = true})
|
|
local name = parts[#parts]
|
|
vim.cmd("packadd! " .. name)
|
|
|
|
if name == NV_DARCULA_COLOR_SCHEME then
|
|
set_colorscheme()
|
|
end
|
|
end
|
|
|
|
set_colorscheme()
|