nvim: simplify rspec mapping
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
local function map(mode, lhs, rhs, opts)
|
local function map(mode, lhs, rhs, opts)
|
||||||
local options = { noremap = true }
|
local options = { noremap = true }
|
||||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
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
|
end
|
||||||
|
|
||||||
local function nmap(lhs, rhs, opts)
|
local function nmap(lhs, rhs, opts)
|
||||||
@@ -69,8 +69,8 @@ nmap('<leader>gb',':Git blame<CR>')
|
|||||||
nmap('<leader>a', ':A<CR>')
|
nmap('<leader>a', ':A<CR>')
|
||||||
|
|
||||||
-- test
|
-- test
|
||||||
nmap('<leader>r', ':TestFile<CR>')
|
nmap('<leader>r', function() os.execute("tmux send-keys -t '{down-of}' 'bundle exec rspec '" .. vim.fn.expand("%") .. " Enter") end)
|
||||||
nmap('<leader>R', ':TestSuite<CR>')
|
nmap('<leader>R', function() os.execute("tmux send-keys -t '{down-of}' 'bundle exec rspec .' Enter") end)
|
||||||
|
|
||||||
-- CtrlSF
|
-- CtrlSF
|
||||||
nmap('<C-f>', '<Plug>CtrlSFPrompt')
|
nmap('<C-f>', '<Plug>CtrlSFPrompt')
|
||||||
|
|||||||
@@ -85,10 +85,6 @@ packer.startup(function()
|
|||||||
use 'tpope/vim-rhubarb'
|
use 'tpope/vim-rhubarb'
|
||||||
use 'tpope/vim-repeat'
|
use 'tpope/vim-repeat'
|
||||||
|
|
||||||
-- tests
|
|
||||||
use 'vim-test/vim-test'
|
|
||||||
use 'benmills/vimux'
|
|
||||||
|
|
||||||
-- TODO: find lua replacement / or learn :grep / cfdo
|
-- TODO: find lua replacement / or learn :grep / cfdo
|
||||||
use 'dyng/ctrlsf.vim'
|
use 'dyng/ctrlsf.vim'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user