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