nvim: simplify rspec mapping

This commit is contained in:
2023-10-05 22:31:35 +03:00
parent a2a3dde5e7
commit 95642f0874
2 changed files with 3 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
local function map(mode, lhs, rhs, opts)
local options = { noremap = true }
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
vim.keymap.set(mode, lhs, rhs, options)
end
local function nmap(lhs, rhs, opts)
@@ -69,8 +69,8 @@ nmap('<leader>gb',':Git blame<CR>')
nmap('<leader>a', ':A<CR>')
-- test
nmap('<leader>r', ':TestFile<CR>')
nmap('<leader>R', ':TestSuite<CR>')
nmap('<leader>r', function() os.execute("tmux send-keys -t '{down-of}' 'bundle exec rspec '" .. vim.fn.expand("%") .. " Enter") end)
nmap('<leader>R', function() os.execute("tmux send-keys -t '{down-of}' 'bundle exec rspec .' Enter") end)
-- CtrlSF
nmap('<C-f>', '<Plug>CtrlSFPrompt')