add new shortcut <localleader>tt => ToggleRspecTest(), which toggles now: true of a spec test
This commit is contained in:
parent
f6402e096a
commit
5f2532e1e3
@ -304,5 +304,15 @@ function! TogglePaste()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ToggleRspecTest()
|
||||||
|
let l:line=getline('.')
|
||||||
|
if l:line =~? ',\s*now:\s.*true'
|
||||||
|
call setline('.', substitute(l:line, "\,\\s*now:\\s*true", "", ""))
|
||||||
|
else
|
||||||
|
call setline('.', substitute(l:line, "\\(['\"]\\)\\s*do", "\\1, now: true do", ""))
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" set paste
|
" set paste
|
||||||
nnoremap <localleader>p :call TogglePaste()<cr>
|
nnoremap <localleader>tp :call TogglePaste()<cr>
|
||||||
|
nnoremap <localleader>tt :call ToggleRspecTest()<cr>
|
||||||
|
Loading…
Reference in New Issue
Block a user