local M = require('module'):new() function M:boot() self.plugins = nukevim.modules:get('plugins') end function M:on_change_branch() vim.ui.input({ prompt = "branch? ", -- completion = }, function(branch) if (branch ~= nil) then vim.cmd(':G branch '..branch) vim.cmd(':G checkout '..branch) end end) end function M:on_checkout() branches_out = vim.fn.system('git branch') branches = {} for branch in branches_out:gmatch("[^\r\n]+") do if (branch:sub(1, 1) ~= '*') then table.insert(branches, branch) end end vim.ui.select(branches, { prompt = 'branch? ' }, function(branch) if (branch ~= nil) then vim.cmd(':G checkout '..branch) end end ) end return M