summary refs log tree commit diff
path: root/.config/nvim/plugin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/nvim/plugin/mod.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nvim/plugin/mod.lua b/.config/nvim/plugin/mod.lua
new file mode 100644
index 0000000..a26bf46
--- /dev/null
+++ b/.config/nvim/plugin/mod.lua
@@ -0,0 +1,25 @@
+-- register keybinds and commands for lua/mod/?.lua here
+
+-- jobs.lua
+vim.api.nvim_create_user_command('Jobs', function(a) require('mod.jobs').select(a) end,
+  { nargs = 0, desc = 'jobs: List running jobs' })
+
+vim.keymap.set('n', ';j', '<cmd>Jobs<cr>', { desc = 'fzf: jobs' })
+
+-- termopen.lua
+vim.api.nvim_create_user_command('Term', function(a) require('mod.termopen').term(a) end,
+  { nargs = '*', desc = 'termopen: Terminal' })
+vim.api.nvim_create_user_command('Make', function(a) require('mod.termopen').make(a) end,
+  { nargs = '*', desc = 'termopen: Make' })
+
+vim.keymap.set('n', '<leader><leader>m', '<cmd>Make<cr>', { desc = 'termopen: make' })
+vim.keymap.set('n', '<leader><leader>t', '<cmd>Termopen<cr>', { desc = 'termopen: shell' })
+vim.keymap.set('n', '<leader><leader>l', function()
+  vim.ui.input({ prompt = 'Launch: ' }, function(input)
+    if input ~= nil and #input > 0 then
+      require('mod.termopen').termopen({ cmd = { vim.env.SHELL, '-c', input } })
+    else
+      vim.notify('termopen: empty arguments', vim.log.levels.WARN)
+    end
+  end)
+end, { desc = 'termopen: Launch' })