feat: migrate from vim.pack to lazy.nvim

Replace vim.pack bootstrap and all vim.pack.add calls with lazy.nvim.
Convert kickstart and custom plugin files to return lazy specs.
Fix wezterm.nvim to only load when wezterm executable is present.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
Patrick Pagni 2026-05-28 10:54:43 +01:00
parent cc3d4d5376
commit 01f1b78aed
10 changed files with 480 additions and 835 deletions

1018
init.lua

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,35 @@
{ {
"LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"claudecode.nvim": { "branch": "main", "commit": "102d835c964069c9c5e37abaf05ae4f9c3ee6f00" },
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
"fidget.nvim": { "branch": "main", "commit": "82404b196e73a00b1727a91903beef5ddc319d22" },
"fzf-lua": { "branch": "main", "commit": "fea9eedc6894c44d44cbb772a5cd11c93b82d7a1" },
"gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" },
"gruvbox.nvim": { "branch": "main", "commit": "c14c475585494c592ef48064ad338424f15f8bad" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"image.nvim": { "branch": "master", "commit": "44e07129cd0ea0c60afa7a1991d35b5765b51a6b" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"mini.icons": { "branch": "main", "commit": "9c7b1b90b15bdd69c52f6e31889dbc9987c30ec4" }, "live-preview.nvim": { "branch": "main", "commit": "c1fcf75c5f9c9c01dd392852de44204b60f1b5b1" },
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" } "mason-lspconfig.nvim": { "branch": "main", "commit": "7b01e2974a47d489bb92f47a41e4c0088ea8f86e" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" },
"mini.nvim": { "branch": "main", "commit": "44657837c7338e52727facc85c1d95bec1f6bd7c" },
"mini.pick": { "branch": "main", "commit": "4522d9ab65224675df2cf1ede8c12f0410aae2be" },
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
"nvim-lint": { "branch": "master", "commit": "d48f3a76189d03b2239f6df1b2f7e3fa8353743b" },
"nvim-lspconfig": { "branch": "master", "commit": "6f76a3eeadc2ee235d74cd7d5319e95a261084af" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
"wezterm.nvim": { "branch": "main", "commit": "032c33b621b96cc7228955b4352b48141c482098" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
} }

View File

@ -1,15 +1,3 @@
-- You can add your own plugins here or in other files in this directory! -- Lazy auto-discovers all *.lua files in this directory.
-- I promise not to create any merge conflicts in this directory :) -- This file is intentionally empty (lazy imports the other files directly).
-- return {}
-- See the kickstart.nvim README for more information
-- Iterate over all Lua files in the plugins directory and load them
local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins')
for file_name, type in vim.fs.dir(plugins_dir) do
if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then
local module = file_name:gsub('%.lua$', '')
require('custom.plugins.' .. module)
end
end
--return {}

View File

@ -1,18 +1,11 @@
-- Define the configuration for the dbt language server -- dbt language server (requires dbt-language-server in $PATH)
-- Uses native Neovim LSP APIs — no extra plugin needed.
vim.lsp.config('dbt', { vim.lsp.config('dbt', {
-- The command to start the server cmd = { 'dbt-language-server' },
-- Ensure 'dbt-language-server' is in your system $PATH filetypes = { 'sql', 'yaml' },
cmd = { "dbt-language-server" }, root_markers = { 'dbt_project.yml' },
-- The filetypes this server should attach to
filetypes = { "sql", "yaml" },
-- How to find the project root (replaces util.root_pattern)
root_markers = { "dbt_project.yml" },
-- General settings (standard for most servers)
settings = {}, settings = {},
}) })
-- Tell Neovim to actually use/enable this server
vim.lsp.enable('dbt') vim.lsp.enable('dbt')
return {}

View File

@ -12,6 +12,7 @@ return {
}, },
{ {
'willothy/wezterm.nvim', 'willothy/wezterm.nvim',
cond = vim.fn.executable('wezterm') == 1,
config = true config = true
}, },

View File

@ -1,7 +1,8 @@
-- Initialize the icons (optional, but highly recommended for Oil) return {
require('mini.icons').setup({}) 'stevearc/oil.nvim',
dependencies = { 'nvim-mini/mini.nvim' },
-- Initialize and configure Oil config = function()
require('oil').setup({ require('mini.icons').setup()
-- You can add any custom oil options here later! require('oil').setup()
}) end,
}

View File

@ -1,21 +1,19 @@
-- [[ Colorscheme ]] return {
-- You can easily change to a different colorscheme. {
-- Change the name of the colorscheme plugin below, and then 'folke/tokyonight.nvim',
-- change the command under that to load whatever the name of that colorscheme is. opts = {
-- styles = {
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. comments = { italic = false },
vim.pack.add { 'folke/tokyonight.nvim' } },
---@diagnostic disable-next-line: missing-fields },
require('tokyonight').setup { },
styles = { {
comments = { italic = false }, -- Disable italics in comments 'motaz-shokry/gruvbox.nvim',
url = 'https://gitlab.com/motaz-shokry/gruvbox.nvim',
priority = 1000,
config = function()
require('gruvbox').setup()
vim.cmd('colorscheme gruvbox-medium')
end,
}, },
} }
vim.pack.add({
{ src = "https://gitlab.com/motaz-shokry/gruvbox.nvim" }
})
require("gruvbox").setup() -- for configs
vim.cmd("colorscheme gruvbox-medium") -- apply the theme

View File

@ -2,56 +2,56 @@
-- NOTE: gitsigns is already included in init.lua but contains only the base -- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps. -- config. This will add also the recommended keymaps.
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' } return {
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
require('gitsigns').setup { local function map(mode, l, r, opts)
on_attach = function(bufnr) opts = opts or {}
local gitsigns = require 'gitsigns' opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function() -- Navigation
if vim.wo.diff then map('n', ']c', function()
vim.cmd.normal { '[c', bang = true } if vim.wo.diff then
else vim.cmd.normal { ']c', bang = true }
gitsigns.nav_hunk 'prev' else
end gitsigns.nav_hunk 'next'
end, { desc = 'Jump to previous git [c]hange' }) end
end, { desc = 'Jump to next git [c]hange' })
-- Actions map('n', '[c', function()
-- visual mode if vim.wo.diff then
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) vim.cmd.normal { '[c', bang = true }
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) else
-- normal mode gitsigns.nav_hunk 'prev'
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) end
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) end, { desc = 'Jump to previous git [c]hange' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' })
-- Text object -- Actions (visual mode)
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
end, map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
-- Actions (normal mode)
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' })
-- Text object
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
end,
},
} }

View File

@ -1,6 +1,5 @@
-- Add indentation guides even on blank lines return {
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim` main = 'ibl',
-- See `:help ibl` opts = {},
vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' } }
require('ibl').setup {}

View File

@ -1,53 +1,16 @@
-- Linting return {
'mfussenegger/nvim-lint',
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } config = function()
local lint = require 'lint'
local lint = require 'lint' lint.linters_by_ft = {
lint.linters_by_ft = { markdown = { 'markdownlint' },
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm }
} local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
-- To allow other plugins to add linters to require('lint').linters_by_ft, group = lint_augroup,
-- instead set linters_by_ft like this: callback = function()
-- lint.linters_by_ft = lint.linters_by_ft or {} if vim.bo.modifiable then lint.try_lint() end
-- lint.linters_by_ft['markdown'] = { 'markdownlint' } end,
-- })
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.bo.modifiable then lint.try_lint() end
end, end,
}) }