From 967844cd5824b1221628afc06c1ff83f2d902553 Mon Sep 17 00:00:00 2001 From: NonlinearFruit <1123benji5813@gmail.com> Date: Mon, 10 Jun 2024 22:42:23 -0600 Subject: [PATCH] List nvim plugins (#27) --- scripts/nvim-plugins.nu | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/nvim-plugins.nu diff --git a/scripts/nvim-plugins.nu b/scripts/nvim-plugins.nu new file mode 100644 index 0000000..315470e --- /dev/null +++ b/scripts/nvim-plugins.nu @@ -0,0 +1,31 @@ +' +local plugins = {} +local installed_plugins = require("lazy").plugins() +for _, plugin in ipairs(installed_plugins) do + local handle = plugin[1] + local name = plugin.name or handle + local url = plugin.url + + if url and url:find("https://github.com") then + local name_parts = vim.split(handle, "/") + if #name_parts == 2 then + local author = name_parts[1] + + table.insert(plugins, { + name = name, + handle = handle, + url = url, + author = author, + }) + end + end +end +print(vim.json.encode(plugins)) +' +| do { + ^nvim -u ~/.config/nvim/init.lua -l /dev/stdin +} +| complete +| get stderr +| from json +| where author != local