diff options
author | Squibid <me@zacharyscheiman.com> | 2023-10-22 18:08:38 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-10-22 18:08:38 -0400 |
commit | b6807d63cd284a73969f81da7c4b5213880c8bc5 (patch) | |
tree | 8b3f93a06cf6b59fc8d00ab0c8d3e0ad1f7af5db /lua/mngr/menu.lua | |
parent | a7929fa1c04758a0da28a58d3da195c7b218679b (diff) | |
download | nvim-b6807d63cd284a73969f81da7c4b5213880c8bc5.tar.gz nvim-b6807d63cd284a73969f81da7c4b5213880c8bc5.tar.bz2 nvim-b6807d63cd284a73969f81da7c4b5213880c8bc5.zip |
move config menu
Diffstat (limited to '')
-rw-r--r-- | lua/cfgmenu.lua (renamed from lua/mngr/menu.lua) | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lua/mngr/menu.lua b/lua/cfgmenu.lua index 8930043..7335079 100644 --- a/lua/mngr/menu.lua +++ b/lua/cfgmenu.lua @@ -1,6 +1,7 @@ --- helper functions that can come in handy +-- helper functions that can come in handy ------------------------------------ local function run(cmd) local x = io.popen(cmd) + if not x then return 1 end local y = x:read("*a") x:close() return y @@ -21,7 +22,6 @@ local function genmenu() add('edit config', nil) add('update plugins', 'dep') - add('update config', nil) add('show keybinds', 'telescope') add('change colorscheme', 'telescope') add('new plugins', 'telescope') @@ -31,7 +31,6 @@ end local function configmenu() local list = genmenu() - vim.ui.select(list, { vpt = 'Config Menu' }, function(choice) if choice == 'edit config' then @@ -46,14 +45,11 @@ local function configmenu() require('mason.api.command').MasonUpdate() end end - if choice == 'update config' then - require('mngr.updates') - end if choice == 'show keybinds' then require('telescope.builtin').keymaps() end if choice == 'change colorscheme' then - require('telescope.builtin').colorscheme() + vim.cmd("Colorscheme") end -- search though plugins (powered by nvim.sh) if choice == 'new plugins' then @@ -63,9 +59,13 @@ local function configmenu() table.insert(array, s) end 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 -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, {}) |