summaryrefslogtreecommitdiffstats
path: root/lua/mngr/menu.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-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