-
Notifications
You must be signed in to change notification settings - Fork 116
/
ruby_mappings.vim
31 lines (25 loc) · 908 Bytes
/
ruby_mappings.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function! TestContext()
wall
let [_, lnum, cnum, _] = getpos('.')
RubyBlockSpecParentContext
TestNearest
call cursor(lnum, cnum)
endfunction
command! TestContext :call TestContext()
map <silent> <LocalLeader>rc :TestContext<CR>
map <silent> <LocalLeader>rb :wa<CR>:TestFile<CR>
map <silent> <LocalLeader>rf :wa<CR>:TestNearest<CR>
map <silent> <LocalLeader>rl :wa<CR>:TestLast<CR>
map <silent> <LocalLeader>rx :wa<CR>:VimuxCloseRunner<CR>
map <silent> <LocalLeader>ri :wa<CR>:VimuxInspectRunner<CR>
map <silent> <LocalLeader>rs :!ruby -c %<CR>
map <silent> <LocalLeader>AA :A<CR>
map <silent> <LocalLeader>AV :AV<CR>
map <silent> <LocalLeader>AS :AS<CR>
" Restore vim-diff shortcuts
silent! unmap ]c
map <silent> ]C :RubyBlockSpecParentContext<CR>
map <LocalLeader>rd Orequire "pry"; binding.pry<ESC>
" Search for tag
nmap <silent> <LocalLeader>] :Tags '<C-R><C-W> <CR>
setlocal isk+=?