Skip to content

Commit 1a8fdfc

Browse files
committed
refactor(nvim): migrate to vim.pack from lazy.nvim
1 parent ed6d29c commit 1a8fdfc

43 files changed

Lines changed: 864 additions & 989 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

home/.chezmoiscripts/run_onchange_after_update-neovim-plugins.sh.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env zsh
22

3-
# lazy-lock.json hash: {{ include "dot_config/exact_nvim/lazy-lock.json" | sha256sum }}
3+
# nvim-pack-lock.json hash: {{ include "dot_config/exact_nvim/nvim-pack-lock.json" | sha256sum }}
44

55
autoload -Uz colors && colors
66

@@ -16,8 +16,8 @@ if (! type "nvim" &> /dev/null) {
1616
echo
1717
print "${fg_bold[blue]}==>${reset_color} ${bold_color}[${script_name}]${reset_color} Syncing Neovim plugins..."
1818

19-
# Run nvim in headless mode to sync lazy.nvim plugins with lock file.
20-
zsh -c "nvim --headless '+Lazy! sync' +qall" > /dev/null
19+
# Run nvim in headless mode to sync vim.pack plugins with lock file.
20+
zsh -c "nvim --headless +'lua vim.pack.update(nil, { target = \"lockfile\", force = true })' +qall" > /dev/null
2121

2222
echo
2323
print "${fg_bold[green]}==>${reset_color} ${bold_color}[${script_name}]${reset_color} Neovim plugins synced."

home/dot_config/exact_nvim/exact_lua/exact_specs/arbor.lua

Lines changed: 0 additions & 57 deletions
This file was deleted.

home/dot_config/exact_nvim/exact_lua/exact_specs/blink.lua renamed to home/dot_config/exact_nvim/exact_lua/exact_specs/blink_cmp.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
local Plugin = { 'saghen/blink.cmp' }
2-
3-
Plugin.version = '1.*'
1+
vim.pack.add({
2+
{
3+
name = 'blink-cmp',
4+
src = 'github:saghen/blink.cmp',
5+
version = vim.version.range('1'),
6+
},
7+
})
48

5-
Plugin.event = 'InsertEnter'
9+
local blink_cmp = require('blink.cmp')
610

7-
Plugin.opts = {
11+
local opts = {
812
keymap = {
913
preset = 'none',
1014
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
@@ -58,6 +62,4 @@ Plugin.opts = {
5862
},
5963
}
6064

61-
Plugin.opts_extend = { 'sources.default' }
62-
63-
return Plugin
65+
blink_cmp.setup(opts)
Lines changed: 67 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,79 @@
1-
local Plugin = { 'akinsho/bufferline.nvim' }
2-
3-
Plugin.name = 'bufferline'
4-
Plugin.version = '*'
5-
6-
Plugin.dependencies = {
7-
'devicons',
8-
'grapple',
9-
}
10-
11-
Plugin.event = 'VeryLazy'
12-
Plugin.keys = {
1+
vim.pack.add({
132
{
14-
'<M-p>',
15-
'<cmd>BufferLineCyclePrev<cr>',
16-
desc = 'Prev Buffer',
3+
name = 'bufferline',
4+
src = 'github:akinsho/bufferline.nvim',
175
},
18-
{
19-
'<M-n>',
20-
'<cmd>BufferLineCycleNext<cr>',
21-
desc = 'Next Buffer',
22-
},
23-
}
6+
})
247

25-
Plugin.config = function()
26-
local bufferline = require('bufferline')
8+
local bufferline = require('bufferline')
279

28-
bufferline.setup({
29-
options = {
30-
show_buffer_close_icons = false,
31-
show_close_icon = false,
32-
style_preset = {
33-
bufferline.style_preset.no_italic,
34-
bufferline.style_preset.no_bold,
35-
},
36-
offsets = {
37-
{
38-
filetype = 'snacks_layout_box',
39-
highlight = 'Directory',
40-
},
10+
local opts = {
11+
options = {
12+
show_buffer_close_icons = false,
13+
show_close_icon = false,
14+
style_preset = {
15+
bufferline.style_preset.no_italic,
16+
bufferline.style_preset.no_bold,
17+
},
18+
offsets = {
19+
{
20+
filetype = 'snacks_layout_box',
21+
highlight = 'Directory',
4122
},
42-
name_formatter = function(buf)
43-
local mark = require('grapple').exists({ buffer = buf.bufnr })
44-
and ' '
45-
or ''
46-
return mark .. buf.name
47-
end,
48-
custom_areas = {
49-
right = function()
50-
local result = {}
51-
local severity = vim.diagnostic.severity
52-
local error = #vim.diagnostic.get(0, { severity = severity.ERROR })
53-
local warning = #vim.diagnostic.get(0, { severity = severity.WARN })
54-
local info = #vim.diagnostic.get(0, { severity = severity.INFO })
55-
local hint = #vim.diagnostic.get(0, { severity = severity.HINT })
23+
},
24+
name_formatter = function(buf)
25+
local mark = require('grapple').exists({ buffer = buf.bufnr }) and ' '
26+
or ''
27+
return mark .. buf.name
28+
end,
29+
custom_areas = {
30+
right = function()
31+
local result = {}
32+
local severity = vim.diagnostic.severity
33+
local error = #vim.diagnostic.get(0, { severity = severity.ERROR })
34+
local warning = #vim.diagnostic.get(0, { severity = severity.WARN })
35+
local info = #vim.diagnostic.get(0, { severity = severity.INFO })
36+
local hint = #vim.diagnostic.get(0, { severity = severity.HINT })
5637

57-
if error ~= 0 then
58-
table.insert(
59-
result,
60-
{ text = ' ' .. error, link = 'DiagnosticError' }
61-
)
62-
end
38+
if error ~= 0 then
39+
table.insert(
40+
result,
41+
{ text = ' ' .. error, link = 'DiagnosticError' }
42+
)
43+
end
6344

64-
if warning ~= 0 then
65-
table.insert(
66-
result,
67-
{ text = ' ' .. warning, link = 'DiagnosticWarn' }
68-
)
69-
end
45+
if warning ~= 0 then
46+
table.insert(
47+
result,
48+
{ text = ' ' .. warning, link = 'DiagnosticWarn' }
49+
)
50+
end
7051

71-
if hint ~= 0 then
72-
table.insert(
73-
result,
74-
{ text = '' .. hint, link = 'DiagnosticHint' }
75-
)
76-
end
52+
if hint ~= 0 then
53+
table.insert(result, { text = ' ' .. hint, link = 'DiagnosticHint' })
54+
end
7755

78-
if info ~= 0 then
79-
table.insert(
80-
result,
81-
{ text = '' .. info, link = 'DiagnosticInfo' }
82-
)
83-
end
56+
if info ~= 0 then
57+
table.insert(result, { text = ' ' .. info, link = 'DiagnosticInfo' })
58+
end
8459

85-
return result
86-
end,
87-
},
60+
return result
61+
end,
8862
},
89-
})
90-
end
63+
},
64+
}
65+
66+
bufferline.setup(opts)
9167

92-
return Plugin
68+
vim.keymap.set(
69+
'n',
70+
'<S-M-[>',
71+
'<cmd>BufferLineCyclePrev<cr>',
72+
{ desc = 'Previous buffer' }
73+
)
74+
vim.keymap.set(
75+
'n',
76+
'<S-M-]>',
77+
'<cmd>BufferLineCycleNext<cr>',
78+
{ desc = 'Next buffer' }
79+
)

home/dot_config/exact_nvim/exact_lua/exact_specs/catppuccin.lua

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
local Plugin = { 'catppuccin/nvim' }
2-
3-
Plugin.name = 'catppuccin'
1+
vim.pack.add({
2+
{
3+
name = 'catppuccin',
4+
src = 'github:catppuccin/nvim',
5+
},
6+
})
47

5-
Plugin.lazy = false
6-
Plugin.priority = 1000
8+
local catppuccin = require('catppuccin')
79

8-
Plugin.opts = {
10+
local opts = {
911
flavour = 'auto',
1012
background = {
1113
dark = 'mocha',
@@ -86,11 +88,6 @@ Plugin.opts = {
8688
},
8789
}
8890

89-
Plugin.config = function(_, opts)
90-
local catppuccin = require('catppuccin')
91-
catppuccin.setup(opts)
92-
93-
vim.cmd.colorscheme('catppuccin')
94-
end
91+
catppuccin.setup(opts)
9592

96-
return Plugin
93+
vim.cmd.colorscheme('catppuccin')
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
local Plugin = { 'alker0/chezmoi.vim' }
2-
3-
Plugin.name = 'chezmoi'
4-
5-
Plugin.lazy = false
6-
7-
Plugin.init = function()
8-
vim.g['chezmoi#use_tmp_buffer'] = true
9-
end
10-
11-
return Plugin
1+
vim.pack.add({
2+
{
3+
name = 'chezmoi',
4+
src = 'github:alker0/chezmoi.vim',
5+
},
6+
})
7+
8+
vim.g['chezmoi#use_tmp_buffer'] = true
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
local Plugin = { 'NTBBloodbath/color-converter.nvim' }
2-
3-
Plugin.name = 'color-converter'
4-
Plugin.opts = {}
5-
6-
Plugin.keys = {
1+
vim.pack.add({
72
{
8-
'\\cc',
9-
function()
10-
local color_converter = require('color-converter')
11-
color_converter.cycle()
12-
end,
13-
desc = 'Color Converter',
3+
name = 'color-converter',
4+
src = 'github:NTBBloodbath/color-converter.nvim',
145
},
15-
}
6+
})
7+
8+
local color_converter = require('color-converter')
9+
10+
color_converter.setup()
1611

17-
return Plugin
12+
vim.keymap.set(
13+
'n',
14+
'\\cc',
15+
color_converter.cycle,
16+
{ desc = 'Cycle color format' }
17+
)

0 commit comments

Comments
 (0)