summaryrefslogtreecommitdiffstats
path: root/lua/mngr
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mngr')
-rw-r--r--lua/mngr/init.lua1
-rw-r--r--lua/mngr/menu.lua23
-rw-r--r--lua/mngr/updates.lua14
3 files changed, 23 insertions, 15 deletions
diff --git a/lua/mngr/init.lua b/lua/mngr/init.lua
index c72f50f..37a7c03 100644
--- a/lua/mngr/init.lua
+++ b/lua/mngr/init.lua
@@ -1,2 +1 @@
require('mngr.menu')
-require('mngr.updates')
diff --git a/lua/mngr/menu.lua b/lua/mngr/menu.lua
index 68a6670..8930043 100644
--- a/lua/mngr/menu.lua
+++ b/lua/mngr/menu.lua
@@ -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
diff --git a/lua/mngr/updates.lua b/lua/mngr/updates.lua
deleted file mode 100644
index ed0d622..0000000
--- a/lua/mngr/updates.lua
+++ /dev/null
@@ -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