nvim: packer -> lazy
This commit is contained in:
@ -1,10 +1,4 @@
|
|||||||
_G.load = function(file)
|
|
||||||
require("plenary.reload").reload_module(file, true)
|
|
||||||
return require(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
require("plugins")
|
require("plugins")
|
||||||
load("options")
|
require("options")
|
||||||
load("mappings")
|
require("mappings")
|
||||||
load("disablebuiltin")
|
require("colors")
|
||||||
load("colors")
|
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
local disabled_built_ins = {
|
|
||||||
"netrw",
|
|
||||||
"netrwPlugin",
|
|
||||||
"netrwSettings",
|
|
||||||
"netrwFileHandlers",
|
|
||||||
"gzip",
|
|
||||||
"zip",
|
|
||||||
"zipPlugin",
|
|
||||||
"tar",
|
|
||||||
"tarPlugin",
|
|
||||||
"getscript",
|
|
||||||
"getscriptPlugin",
|
|
||||||
"vimball",
|
|
||||||
"vimballPlugin",
|
|
||||||
"2html_plugin",
|
|
||||||
"logipat",
|
|
||||||
"rrhelper",
|
|
||||||
"spellfile_plugin",
|
|
||||||
"matchit",
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, plugin in pairs(disabled_built_ins) do
|
|
||||||
vim.g["loaded_" .. plugin] = 1
|
|
||||||
end
|
|
||||||
@ -86,34 +86,34 @@ vim.keymap.set("n", "]d", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- neotest
|
-- neotest
|
||||||
vim.keymap.set("n", "na", function()
|
vim.keymap.set("n", "<leader>na", function()
|
||||||
require("neotest").run.attach()
|
require("neotest").run.attach()
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nf", function()
|
vim.keymap.set("n", "<leader>nf", function()
|
||||||
require("neotest").run.run(vim.fn.expand("%"))
|
require("neotest").run.run(vim.fn.expand("%"))
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nF", function()
|
vim.keymap.set("n", "<leader>nF", function()
|
||||||
require("neotest").run.run({ vim.fn.expand("%"), strategy = "dap" })
|
require("neotest").run.run({ vim.fn.expand("%"), strategy = "dap" })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nl", function()
|
vim.keymap.set("n", "<leader>nl", function()
|
||||||
require("neotest").run.run_last()
|
require("neotest").run.run_last()
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nL", function()
|
vim.keymap.set("n", "<leader>nL", function()
|
||||||
require("neotest").run.run_last({ strategy = "dap" })
|
require("neotest").run.run_last({ strategy = "dap" })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nn", function()
|
vim.keymap.set("n", "<leader>nn", function()
|
||||||
require("neotest").run.run()
|
require("neotest").run.run()
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nN", function()
|
vim.keymap.set("n", "<leader>nN", function()
|
||||||
require("neotest").run.run({ strategy = "dap" })
|
require("neotest").run.run({ strategy = "dap" })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "no", function()
|
vim.keymap.set("n", "<leader>no", function()
|
||||||
require("neotest").output.open({ enter = true })
|
require("neotest").output.open({ enter = true })
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "nS", function()
|
vim.keymap.set("n", "<leader>nS", function()
|
||||||
require("neotest").run.stop()
|
require("neotest").run.stop()
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "ns", function()
|
vim.keymap.set("n", "<leader>ns", function()
|
||||||
require("neotest").summary.toggle()
|
require("neotest").summary.toggle()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@ -1,191 +1,184 @@
|
|||||||
require("packer").startup(function()
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
use("wbthomason/packer.nvim")
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
require("lazy").setup({
|
||||||
|
|
||||||
--
|
--
|
||||||
-- dev
|
-- dev
|
||||||
--
|
--
|
||||||
|
|
||||||
-- lspconfig
|
-- lspconfig
|
||||||
use({
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.lsp")
|
require("plugins.lsp")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- nvim lint
|
-- nvim lint
|
||||||
use({
|
{
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.lint")
|
require("plugins.lint")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- cmp
|
-- cmp
|
||||||
use({
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.cmp")
|
require("plugins.cmp")
|
||||||
end,
|
end,
|
||||||
})
|
dependencies = {
|
||||||
|
|
||||||
use({
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"hrsh7th/cmp-vsnip",
|
"hrsh7th/cmp-vsnip",
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||||
})
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- snippets
|
-- snippets
|
||||||
use({
|
{
|
||||||
"hrsh7th/vim-vsnip",
|
"hrsh7th/vim-vsnip",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.vsnip")
|
require("plugins.vsnip")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
use({
|
{
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
})
|
},
|
||||||
|
|
||||||
-- autopairs
|
-- autopairs
|
||||||
use({
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.autopairs")
|
require("plugins.autopairs")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- treesitter
|
-- treesitter
|
||||||
use({
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.treesitter")
|
require("plugins.treesitter")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
use({
|
{
|
||||||
"RRethy/nvim-treesitter-textsubjects",
|
"RRethy/nvim-treesitter-textsubjects",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.treesitter-textobjects")
|
require("plugins.treesitter-textobjects")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- formatter
|
-- formatter
|
||||||
use({
|
{
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
cmd = { "Format", "FormatWrite" },
|
cmd = { "Format", "FormatWrite" },
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.formatter")
|
require("plugins.formatter")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- toggleterm
|
-- toggleterm
|
||||||
use({
|
{
|
||||||
"akinsho/toggleterm.nvim",
|
"akinsho/toggleterm.nvim",
|
||||||
cmd = "ToggleTerm*",
|
cmd = "ToggleTerm",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.toggleterm")
|
require("plugins.toggleterm")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- comment.nvim
|
-- comment.nvim
|
||||||
use({
|
{
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.comment")
|
require("plugins.comment")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- neotest
|
-- neotest
|
||||||
use({
|
{
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.neotest")
|
require("plugins.neotest")
|
||||||
end,
|
end,
|
||||||
requires = {
|
dependencies = {
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
"nvim-neotest/neotest-python",
|
"nvim-neotest/neotest-python",
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
|
||||||
-- fugitive
|
-- fugitive
|
||||||
use({
|
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- files (and more)
|
-- files (and more)
|
||||||
--
|
--
|
||||||
|
|
||||||
-- telescope
|
-- telescope
|
||||||
use({
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
requires = { "nvim-lua/plenary.nvim" },
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.telescope")
|
require("plugins.telescope")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- nvim tree
|
-- nvim tree
|
||||||
use({
|
{
|
||||||
"kyazdani42/nvim-tree.lua",
|
"kyazdani42/nvim-tree.lua",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.nvim-tree")
|
require("plugins.nvim-tree")
|
||||||
end,
|
end,
|
||||||
})
|
dependencies = {
|
||||||
|
"kyazdani42/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
--
|
--
|
||||||
-- looks
|
-- looks
|
||||||
--
|
--
|
||||||
|
|
||||||
-- lualine
|
-- lualine
|
||||||
use({
|
{
|
||||||
"hoob3rt/lualine.nvim",
|
"hoob3rt/lualine.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.lualine")
|
require("plugins.lualine")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
--
|
--
|
||||||
-- colorscheme
|
-- colorscheme
|
||||||
--
|
--
|
||||||
|
|
||||||
use({
|
|
||||||
"crusoexia/vim-monokai",
|
"crusoexia/vim-monokai",
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"dylanaraps/wal.vim",
|
"dylanaraps/wal.vim",
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- telekasten
|
-- telekasten
|
||||||
--
|
--
|
||||||
|
|
||||||
use({
|
{
|
||||||
"renerocksai/telekasten.nvim",
|
"renerocksai/telekasten.nvim",
|
||||||
requires = "telescope.nvim",
|
dependencies = "telescope.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("plugins.telekasten")
|
require("plugins.telekasten")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
use({
|
|
||||||
"renerocksai/calendar-vim",
|
"renerocksai/calendar-vim",
|
||||||
})
|
})
|
||||||
end)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user