migrate from packer to lazy

This commit is contained in:
Lord Of Nougate 2023-12-02 16:51:36 +01:00
parent 221eadd375
commit 05fa907bbf
6 changed files with 166 additions and 158 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
plugin/packer_compiled.lua plugin/packer_compiled.lua
lazy-lock.json

View File

@ -1,11 +1,13 @@
-- fast switching between files local harpoon = require("harpoon")
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file) -- REQUIRED
vim.keymap.set("n", "<leader>h", ui.toggle_quick_menu) harpoon:setup()
-- REQUIRED
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end) vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
vim.keymap.set("n", "<C-j>", function() ui.nav_file(2) end) vim.keymap.set("n", "<leader>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<C-k>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-l>", function() ui.nav_file(4) end) vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)

View File

@ -1,11 +1,15 @@
-- language server manager (via Mason) local lsp_zero = require('lsp-zero')
local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr) lsp_zero.on_attach(function(client, bufnr)
lsp.default_keymaps({buffer = bufnr}) -- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
end) end)
-- (Optional) Configure lua language server for neovim require('mason').setup({})
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) require('mason-lspconfig').setup({
ensure_installed = {},
lsp.setup() handlers = {
lsp_zero.default_setup,
},
})

View File

@ -1 +1,16 @@
require("sevi-kun") require("sevi-kun")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.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("sevi-kun.plugins")

View File

@ -1,141 +0,0 @@
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
-- Only required if you have packer configured as `opt`
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- treesitter
use ('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
use ('nvim-treesitter/playground')
use ('nvim-treesitter/nvim-treesitter-context')
-- useful
use { 'rmagatti/auto-session' }
use {
'rmagatti/session-lens',
requires = {'rmagatti/auto-session', 'nvim-telescope/telescope.nvim'},
}
use {
'nvim-telescope/telescope.nvim', branch = '0.1.x',
requires = 'nvim-lua/plenary.nvim'
}
use {
'ThePrimeagen/harpoon',
requires = 'nvim-lua/plenary.nvim'
}
use {
'NeogitOrg/neogit',
requires = 'nvim-lua/plenary.nvim'
}
use { 'stevearc/oil.nvim' }
use {
"nvim-neorg/neorg",
tag = "*",
run = ":Neorg sync-parsers",
requires = "nvim-lua/plenary.nvim",
config = function ()
require('neorg').setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.summary"] = {},
["core.export"] = {},
["core.export.markdown"] = {},
["core.ui"] = {},
["core.ui.calendar"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/Documents/Notes",
},
default_workspace = "notes",
},
},
},
}
end
}
use({
"kylechui/nvim-surround",
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup()
end
})
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
}
use ('mbbill/undotree')
use {
'm4xshen/autoclose.nvim',
config = function ()
require("autoclose").setup()
end
}
-- pretty
use {
'navarasu/onedark.nvim',
config = function()
vim.cmd('colorscheme onedark')
end
}
use { "lukas-reineke/indent-blankline.nvim" }
use {
"utilyre/barbecue.nvim", tag = "*",
requires = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons", -- optional dependency
},
after = "nvim-web-devicons", -- keep this if you're using NvChad
config = function()
require("barbecue").setup()
end,
}
-- lsp
use ('github/copilot.vim')
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
requires = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{ -- Optional
'williamboman/mason.nvim',
run = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{'williamboman/mason-lspconfig.nvim'}, -- Optional
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'L3MON4D3/LuaSnip'}, -- Required
}
}
end)

126
lua/sevi-kun/plugins.lua Normal file
View File

@ -0,0 +1,126 @@
-- lazy.nvim plugins
return {
-- treesitter
{ "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
},
{ "nvim-treesitter/playground" },
{ "nvim-treesitter/nvim-treesitter-context" },
-- useful
{ "rmagatti/session-lens",
dependencies = {
"rmagatti/auto-session",
"nvim-telescope/telescope.nvim"
}
},
{ "nvim-telescope/telescope.nvim", version = "0.1.x",
dependencies = { "nvim-lua/plenary.nvim" }
},
{ "ThePrimeagen/harpoon",
version = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
},
{ "NeogitOrg/neogit",
dependencies = { "nvim-lua/plenary.nvim" }
},
{ "stevearc/oil.nvim" },
{ "nvim-neorg/neorg",
version = "*",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/Documents/Notes",
},
default_workspace = "notes",
},
},
},
}
end,
},
{ "kylechui/nvim-surround",
version = "*",
config = function()
require("nvim-surround").setup()
end
},
{ "numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end
},
{ "mbbill/undotree" },
{ "m4xshen/autoclose.nvim",
config = function ()
require("autoclose").setup()
end
},
-- pretty
{ "navarasu/onedark.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme onedark")
end
},
{ "lukas-reineke/indent-blankline.nvim",
lazy = false,
main = "ibl",
opts = {},
config = function()
require("ibl").setup({})
end
},
{ "utilyre/barbecue.nvim",
lazy = false,
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
},
},
-- lsp
{ "github/copilot.vim" },
{"williamboman/mason.nvim",
lazy = false,
config = function()
require("mason").setup({})
end
},
{"williamboman/mason-lspconfig.nvim"},
{"VonHeikemen/lsp-zero.nvim", branch = "v3.x"},
{"neovim/nvim-lspconfig"},
{"hrsh7th/cmp-nvim-lsp"},
{"hrsh7th/nvim-cmp"},
{"L3MON4D3/LuaSnip"},
}