kitchen sink cause I'm too lazy to sort through this junk
This commit is contained in:
@ -1,2 +1 @@
|
||||
require('mngr.menu')
|
||||
require('mngr.updates')
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
-- janky popen madness to use curl without luarocks
|
||||
-- local remoteCommit = io.popen([[curl -s https://git.squi.bid/nvim/commit/ | grep -o "<a href='/nvim/commit/?id=.*>" | cut -d "'" -f 2 | cut -d "=" -f 2 | head -1]])
|
||||
-- local remoteResult = remoteCommit:read("*a")
|
||||
-- remoteCommit:close()
|
||||
--
|
||||
-- local localCommit = io.popen([[cd $XDG_CONFIG_HOME/nvim; git log | head -1 | cut -d " " -f 2]])
|
||||
-- local localResult = localCommit:read("*a")
|
||||
-- localCommit:close()
|
||||
--
|
||||
-- if remoteResult ~= localResult then
|
||||
-- vim.notify("Out of date with remote repo :(", vim.log.levels.WARN, {title = "Nvim Config"})
|
||||
-- else
|
||||
-- vim.notify("Up to date with remote repo :)", vim.log.levels.INFO, {title = "Nvim Config"})
|
||||
-- end
|
Reference in New Issue
Block a user