diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index e2f6842..d132805 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -55,3 +55,12 @@ local function toggle_rspec() end end vim.keymap.set('n', 'ti', toggle_rspec, { silent = true, desc = "Toggle Test F(i)le" }) +vim.keymap.set('n', 'tt', + function () + vim.fn.setreg("+", "bundle exec rspec " .. vim.fn.expand("%")) + local opts = { cwd = LazyVim.root(), interactive = true } + local term, _ = Snacks.terminal.get(nil, opts) + if term and term.closed == true then + Snacks.terminal(nil, opts) + end + end, { silent = true, desc = "Toggle Test Terminal" })