move config menu

This commit is contained in:
2023-10-22 18:08:38 -04:00
parent 25931d94ef
commit 4a91fa2d65
3 changed files with 10 additions and 11 deletions

View File

@ -21,4 +21,4 @@ if pcall(require, "luasnip") then
end end
-- call the config manager ---------------------------------------------------- -- call the config manager ----------------------------------------------------
require('mngr') require('cfgmenu')

View File

@ -1,6 +1,7 @@
-- helper functions that can come in handy -- helper functions that can come in handy ------------------------------------
local function run(cmd) local function run(cmd)
local x = io.popen(cmd) local x = io.popen(cmd)
if not x then return 1 end
local y = x:read("*a") local y = x:read("*a")
x:close() x:close()
return y return y
@ -21,7 +22,6 @@ local function genmenu()
add('edit config', nil) add('edit config', nil)
add('update plugins', 'dep') add('update plugins', 'dep')
add('update config', nil)
add('show keybinds', 'telescope') add('show keybinds', 'telescope')
add('change colorscheme', 'telescope') add('change colorscheme', 'telescope')
add('new plugins', 'telescope') add('new plugins', 'telescope')
@ -31,7 +31,6 @@ end
local function configmenu() local function configmenu()
local list = genmenu() local list = genmenu()
vim.ui.select(list, { vpt = 'Config Menu' }, vim.ui.select(list, { vpt = 'Config Menu' },
function(choice) function(choice)
if choice == 'edit config' then if choice == 'edit config' then
@ -46,14 +45,11 @@ local function configmenu()
require('mason.api.command').MasonUpdate() require('mason.api.command').MasonUpdate()
end end
end end
if choice == 'update config' then
require('mngr.updates')
end
if choice == 'show keybinds' then if choice == 'show keybinds' then
require('telescope.builtin').keymaps() require('telescope.builtin').keymaps()
end end
if choice == 'change colorscheme' then if choice == 'change colorscheme' then
require('telescope.builtin').colorscheme() vim.cmd("Colorscheme")
end end
-- search though plugins (powered by nvim.sh) -- search though plugins (powered by nvim.sh)
if choice == 'new plugins' then if choice == 'new plugins' then
@ -63,9 +59,13 @@ local function configmenu()
table.insert(array, s) table.insert(array, s)
end end
local header = table.remove(array, 1) local header = table.remove(array, 1)
vim.ui.select(array, { vpt = header}, function() end) vim.ui.select(array, { vpt = header }, function(choice)
end)
end end
end) end)
end end
vim.keymap.set('n', '<leader>m', configmenu, {}) vim.keymap.set('n', '<leader>m', configmenu, {
desc = "Neovim config manager menu",
})
vim.api.nvim_create_user_command("ConfigMenu", configmenu, {})

View File

@ -1 +0,0 @@
require('mngr.menu')