summaryrefslogtreecommitdiffstats
path: root/lua/mngr/menu.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2023-08-11 20:43:58 -0400
committerSquibid <me@zacharyscheiman.com>2023-08-11 20:43:58 -0400
commit590f0309995a569954fc94b1d5df6b6391ead9fa (patch)
treecfca10f62e189018c0bb7944d446423e6397f375 /lua/mngr/menu.lua
parentb8d70ed288b3b542b7bb24609384aa540339b2da (diff)
downloadnvim-590f0309995a569954fc94b1d5df6b6391ead9fa.tar.gz
nvim-590f0309995a569954fc94b1d5df6b6391ead9fa.tar.bz2
nvim-590f0309995a569954fc94b1d5df6b6391ead9fa.zip
kitchen sink cause I'm too lazy to sort through this junk
Diffstat (limited to 'lua/mngr/menu.lua')
-rw-r--r--lua/mngr/menu.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/lua/mngr/menu.lua b/lua/mngr/menu.lua
index 68a6670..8930043 100644
--- a/lua/mngr/menu.lua
+++ b/lua/mngr/menu.lua
@@ -1,3 +1,11 @@
+-- helper functions that can come in handy
+local function run(cmd)
+ local x = io.popen(cmd)
+ local y = x:read("*a")
+ x:close()
+ return y
+end
+
-- custom menu for simpler neovim managment -----------------------------------
local function genmenu()
local list = {}
@@ -15,6 +23,8 @@ local function genmenu()
add('update plugins', 'dep')
add('update config', nil)
add('show keybinds', 'telescope')
+ add('change colorscheme', 'telescope')
+ add('new plugins', 'telescope')
return list
end
@@ -42,6 +52,19 @@ local function configmenu()
if choice == 'show keybinds' then
require('telescope.builtin').keymaps()
end
+ if choice == 'change colorscheme' then
+ require('telescope.builtin').colorscheme()
+ end
+ -- search though plugins (powered by nvim.sh)
+ if choice == 'new plugins' then
+ local result = run("curl -s https://nvim.sh/s")
+ local array = {}
+ for s in string.gmatch(result, "[^\r\n]+") do
+ table.insert(array, s)
+ end
+ local header = table.remove(array, 1)
+ vim.ui.select(array, { vpt = header}, function() end)
+ end
end)
end