kitchen sink cause I'm too lazy to sort through this junk
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user