Skip to content

Commit

Permalink
setup ,. to mark a file for testing, and ,, to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldmartin committed Mar 5, 2024
1 parent 813a992 commit 456164d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,6 @@ function! CleanClose(tosave)
exe "bd".todelbufNr
endfunction

" function! MapTests()
" nnoremap ,, :Dispatch ls /
" endfunction


" nmap ,, :w \| !ruby -Itest %<cr>

" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
Expand All @@ -467,18 +460,25 @@ autocmd BufWritePost *vimrc,*exrc :call feedkeys(":source %\<cr>")

" -------= plugin ssettings ------------------------

let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
"p let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>"
" let g:UltiSnipsJumpBackwardTrigger="<c-z>"

" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
nnoremap ,, :Dispatch fab test:backend,customers.tests
" nnoremap ,. :nnoremap ,, :Dispatch docker-compose exec worker python manage.py
" \ test --failfast --keepdb --debug-mode --noinput customers.tests
" nnoremap ,. :nnoremap ,, :Dispatch docker-compose exec worker pytest --reuse-db --exitfirst % \<CR><CR>
" nnoremap ,- :echo \:Dispatch fab test:backend,customers.tests
function! DispatchDockerTest(currentFile)
execute 'nnoremap ,, :Dispatch docker-compose exec worker pytest --reuse-db --exitfirst -W ignore::DeprecationWarning ' . a:currentFile . '<CR>'
endfunction

nnoremap ,. :call DispatchDockerTest(expand('%'))<CR>
" ------ auto commmands ------------------------------------------------------

Expand Down

0 comments on commit 456164d

Please sign in to comment.