neovim: migrate to lazy from packer

This commit is contained in:
2025-05-24 17:28:10 +03:00
parent 3673d6f5fe
commit b18650e335
2 changed files with 75 additions and 69 deletions

2
.gitignore vendored
View File

@@ -1 +1 @@
neovim/.config/nvim/plugin neovim/.config/nvim/lazy-lock.json

View File

@@ -1,72 +1,78 @@
-- Install packer automagically -- Install lazy automagically
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then if not (vim.uv or vim.loop).fs_stat(lazypath) then
PACKER_BOOTSTRAP = vim.fn.system({ local lazyrepo = "https://github.com/folke/lazy.nvim.git"
"git", local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
"clone", if vim.v.shell_error ~= 0 then
"--depth", vim.api.nvim_echo({
"1", { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
"https://github.com/wbthomason/packer.nvim", { out, "WarningMsg" },
install_path, { "\nPress any key to exit..." },
}) }, true, {})
vim.fn.getchar()
os.exit(1)
end
end end
vim.opt.rtp:prepend(lazypath)
require("packer").startup(function(use) vim.g.mapleader = " "
use({ "wbthomason/packer.nvim" }) vim.opt.termguicolors = true
use({ "nvim-lua/plenary.nvim" })
use({ "nvim-treesitter/nvim-treesitter", "nvim-treesitter/playground" }) require("lazy").setup({
use({ spec = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
{ "nvim-treesitter/playground" },
{
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
config = function() config = function()
require("ts_context_commentstring").setup({}) require("ts_context_commentstring").setup({})
vim.g.skip_ts_context_commentstring_module = true vim.g.skip_ts_context_commentstring_module = true
end, end,
}) },
use({ "nvim-telescope/telescope.nvim" }) { "nvim-telescope/telescope.nvim" },
use({ "tpope/vim-fugitive" }) { "tpope/vim-fugitive" },
use({ "lewis6991/gitsigns.nvim" }) { "lewis6991/gitsigns.nvim" },
use({
"hrsh7th/nvim-cmp",
{ {
"hrsh7th/nvim-cmp",
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" }, { "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" }, { "hrsh7th/cmp-cmdline" },
{ "petertriho/cmp-git" }, { "petertriho/cmp-git" },
}, },
}) },
use({ "L3MON4D3/LuaSnip", {
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
} }) },
},
use({ "nvimtools/none-ls.nvim" }) { "nvimtools/none-ls.nvim" },
use({ "kyazdani42/nvim-tree.lua" }) {
use({ "kyazdani42/nvim-web-devicons" }) "kyazdani42/nvim-tree.lua",
dependencies = {
{ "kyazdani42/nvim-web-devicons" },
},
},
use({ { "windwp/nvim-autopairs", opts = {} },
"windwp/nvim-autopairs", { "windwp/nvim-ts-autotag" },
config = function()
require("nvim-autopairs").setup({})
end,
})
use({ "windwp/nvim-ts-autotag" })
use({ "numToStr/Comment.nvim" }) { "numToStr/Comment.nvim" },
use({ "nvim-lualine/lualine.nvim" }) { "nvim-lualine/lualine.nvim" },
use({ "b0o/SchemaStore.nvim" }) { "b0o/SchemaStore.nvim" },
},
if PACKER_BOOTSTRAP then })
require("packer").sync()
end
end)
vim.g.mapleader = " "
vim.opt.termguicolors = true