diff options
author | Squibid <me@zacharyscheiman.com> | 2023-11-24 21:38:31 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-11-24 21:38:31 -0500 |
commit | f35b13d669867209427449840ff0930a732591dc (patch) | |
tree | 3acb658ec5d01f456c49a097d56f736cbfbbfc7d /lua/cfgmenu.lua | |
parent | ebf9d2d1c4682068f5116f7efc1568ce5adf4f1b (diff) | |
download | nvim-f35b13d669867209427449840ff0930a732591dc.tar.gz nvim-f35b13d669867209427449840ff0930a732591dc.tar.bz2 nvim-f35b13d669867209427449840ff0930a732591dc.zip |
more stuff too lazy to seperate
Diffstat (limited to '')
-rw-r--r-- | lua/cfgmenu.lua | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/lua/cfgmenu.lua b/lua/cfgmenu.lua deleted file mode 100644 index 7335079..0000000 --- a/lua/cfgmenu.lua +++ /dev/null @@ -1,71 +0,0 @@ --- 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 -end - --- custom menu for simpler neovim managment ----------------------------------- -local function genmenu() - local list = {} - local function add(name, plug) - if not plug then - table.insert(list, name) - return - end - if package.loaded[plug] then - table.insert(list, name) - end - end - - add('edit config', nil) - add('update plugins', 'dep') - add('show keybinds', 'telescope') - add('change colorscheme', 'telescope') - add('new plugins', 'telescope') - - return list -end - -local function configmenu() - local list = genmenu() - vim.ui.select(list, { vpt = 'Config Menu' }, - function(choice) - if choice == 'edit config' then - vim.cmd('e $XDG_CONFIG_HOME/nvim/init.lua') - end - if choice == 'update plugins' then - require('dep').sync() - if package.loaded['nvim-treesitter'] then - vim.cmd('TSUpdate') - end - if package.loaded['mason'] then - require('mason.api.command').MasonUpdate() - end - end - if choice == 'show keybinds' then - require('telescope.builtin').keymaps() - end - if choice == 'change colorscheme' then - vim.cmd("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(choice) - end) - end - end) -end - -vim.keymap.set('n', '<leader>m', configmenu, { - desc = "Neovim config manager menu", -}) -vim.api.nvim_create_user_command("ConfigMenu", configmenu, {}) |