Skip to content

Commit 8d2bb2c

Browse files
committed
[Neovim] Use vim.pack
I don't use most of what [lazy.nvim] has to offer, so now that Neovim has a builtin plugin manager (`vim.pack`), I figured I'd check it out. For the most part this is a 1:1 translation from [lazy.nvim] to `vim.pack`. There are, however, a few deviations of note. In a few instances, the config is being updated to bring it in line with the current state of the plugin. The requirements.txt plugin is no longer needed because Neovim handles the syntax itself. Neorg requires luarocks; this is handled automatically by [lazy.nvim], but not `vim.pack`. Rather than creating song long complicated way to handle this myself, I'm switching to [obsidian.nvim], specifically a fork that supports using [snacks.nvim] as the picker. While I don't use Obsidian itself, I can leverage the plugin for notes and todos, all with standard Markdown syntax. [lazy.nvim]: https://github.com/folke/lazy.nvim [obsidian.nvim]: https://github.com/obsidian-nvim/obsidian.nvim [snacks.nvim]: https://github.com/folke/snacks.nvim
1 parent bf43ec9 commit 8d2bb2c

62 files changed

Lines changed: 784 additions & 631 deletions

Some content is hidden

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

.config/nvim/ftplugin/markdown.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Let markdown hide text and show symbols and labels in its place.
2+
vim.o.conceallevel = 2

.config/nvim/ftplugin/norg.lua

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

.config/nvim/init.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
-- Set the leader first so that any plugins providing mappings will pick it up.
22
vim.g.mapleader = [[ ]]
33

4-
-- Install plugins.
5-
require("dirn.plugins")
6-
74
-- Initialize file types.
85
require("dirn.filetypes")
96

.config/nvim/lazy-lock.json

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

.config/nvim/lua/dirn/dashboard.lua

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,9 @@ local function plugins()
9999
opts = { position = "center", hl = "Comment" },
100100
}
101101

102-
local ok, lazy = pcall(require, "lazy")
103-
if not ok then
104-
return { opts }
105-
end
106-
107102
vim.api.nvim_create_autocmd({ "User" }, {
108103
pattern = { "AlphaReady" },
109104
callback = function()
110-
vim.keymap.set("n", "L", function()
111-
vim.cmd.Lazy()
112-
end, { silent = true, noremap = true, buffer = true })
113105
local ok, _ = pcall(require, "mason")
114106
if ok then
115107
vim.keymap.set("n", "M", function()
@@ -119,17 +111,28 @@ local function plugins()
119111
end,
120112
})
121113

122-
local stats = lazy.stats()
123-
local loaded = tostring(stats.loaded)
124-
if stats.loaded == stats.count then
125-
loaded = "All"
126-
end
114+
local all = vim.pack.get()
115+
if #all > 0 then
116+
local total = #all
127117

128-
opts.val = "You are using "
129-
.. stats.count
130-
.. " plugins, "
131-
.. loaded
132-
.. " of them are loaded. Open [L]azy to see more."
118+
local active = vim
119+
.iter(all)
120+
:filter(function(x)
121+
return x.active
122+
end)
123+
:totable()
124+
125+
local loaded = "All"
126+
if total ~= #active then
127+
loaded = tostring(#active)
128+
end
129+
130+
opts.val = "You are using "
131+
.. total
132+
.. " plugins. "
133+
.. loaded
134+
.. " of them are loaded."
135+
end
133136

134137
return { opts }
135138
end

.config/nvim/lua/dirn/lsp.lua

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
local has_mason, mason = pcall(require, "mason")
2-
if not has_mason then
3-
return
4-
end
5-
6-
local has_installer, installer = pcall(require, "mason-tool-installer")
7-
if not has_installer then
8-
return
9-
end
10-
11-
mason.setup()
12-
installer.setup({
13-
ensure_installed = {
14-
"diagnosticls",
15-
"lua-language-server",
16-
"mypy",
17-
"prettier",
18-
"ruff",
19-
"rust-analyzer",
20-
"stylua",
21-
"ty",
22-
"yamllint",
23-
},
24-
})
25-
261
local servers = {
272
"diagnosticls",
283
"lua_ls",
@@ -36,8 +11,6 @@ if has_lspextras then
3611
vim.list_extend(servers, lspextras)
3712
end
3813

39-
vim.lsp.enable(servers)
40-
4114
vim.api.nvim_create_autocmd("LspAttach", {
4215
desc = "Configure the buffer's capabilities.",
4316
callback = function(args)

.config/nvim/lua/dirn/specs/alpha.lua

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

.config/nvim/lua/dirn/specs/catppuccin.lua

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

.config/nvim/lua/dirn/specs/cmp.lua

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

.config/nvim/lua/dirn/specs/comment.lua

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

0 commit comments

Comments
 (0)