qqq:g/remote/exe "norm! ?ago\<cr>\"Qy/ago$\<cr>"
qqq:g/python/exe "norm! ?ago\<cr>\"Qy/ago$\<cr>"
will do the trick.