From 5ee078bc4c434764f413b036fcb39ca97b5ae74e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 21 Mar 2020 17:59:40 +0100 Subject: Try adding xmaps and omaps for next and previous commands The xmaps don't really work. Going to the next/previous TODO works, but extending the selection doesn't because of the way I set it up with the mark system. We'd probably need a more involved function here to do what we want. Currently doesn't support counts. I'll have to add that in. --- ftplugin/todo.vim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ftplugin') diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index a223984..c876313 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -17,6 +17,10 @@ nnoremap TwodoDescalate :call todo#Descalate() nnoremap TwodoNextIncomplete :call todo#motion#NextIncomplete() nnoremap TwodoPreviousIncomplete :call todo#motion#PreviousIncomplete() +xnoremap TwodoNextIncomplete :call todo#motion#NextIncomplete()v''o +xnoremap TwodoPreviousIncomplete :call todo#motion#PreviousIncomplete()v''o +onoremap TwodoNextIncomplete :call todo#motion#NextIncomplete() +onoremap TwodoPreviousIncomplete :call todo#motion#PreviousIncomplete() if !hasmapto('TwodoNewTodoBelow') || !maparg('n', 'n') nmap n TwodoNewTodoBelow @@ -52,8 +56,12 @@ endif if !hasmapto('TwodoNextIncomplete') && !maparg(']u', 'n') nmap ]u TwodoNextIncomplete + xmap ]u TwodoNextIncomplete + omap ]u TwodoNextIncomplete endif if !hasmapto('TwodoPreviousIncomplete') && !maparg('[u', 'n') nmap [u TwodoPreviousIncomplete + xmap [u TwodoPreviousIncomplete + omap [u TwodoPreviousIncomplete endif -- cgit v1.2.3