diff --git a/vim/settings/yadr-keymap.vim b/vim/settings/yadr-keymap.vim index 961745c..4353704 100644 --- a/vim/settings/yadr-keymap.vim +++ b/vim/settings/yadr-keymap.vim @@ -304,5 +304,15 @@ function! TogglePaste() endif 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 -nnoremap p :call TogglePaste() +nnoremap tp :call TogglePaste() +nnoremap tt :call ToggleRspecTest()