diff options
author | Teddy Wing | 2021-10-15 21:28:53 +0200 |
---|---|---|
committer | Teddy Wing | 2021-10-15 21:28:53 +0200 |
commit | 477256e48b026d01043a416c1bb20178bcc3cdd1 (patch) | |
tree | f2700568deff34d51fd8ef73bf8779f8c167d2b5 /ftplugin/todo.vim | |
parent | e24499b61189c1cde025a1fd1063a9b21f8e101b (diff) | |
download | vim-twodo-477256e48b026d01043a416c1bb20178bcc3cdd1.tar.bz2 |
Add new motions to move between regular and important TODOs
The existing `[u` and `]u` bindings allow moving to the previous and
next unfinished to-do, but when there are many low priority to-dos, and
a handful of regular and high priority items between them, those
commands are ineffective for quickly moving to the relevant ones.
Add two new sets of commands:
* `[o` & `]o` to move between regular priority to-dos
* `[y` & `]y` to move between high priority to-dos
I was looking for bracket mappings that aren't bound by default. Using
`o` seems to work, meaning "ordinary". And `y` could refer to
"yimportant". Close enough.
Diffstat (limited to 'ftplugin/todo.vim')
-rw-r--r-- | ftplugin/todo.vim | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index e1b3ddb..9ad32dd 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -36,6 +36,16 @@ nnoremap <silent> <buffer> <Plug>TwodoPreviousIncomplete :<c-u>call todo#motion# onoremap <silent> <buffer> <Plug>TwodoNextIncomplete :<c-u>call todo#motion#NextIncomplete()<cr> onoremap <silent> <buffer> <Plug>TwodoPreviousIncomplete :<c-u>call todo#motion#PreviousIncomplete()<cr> +nnoremap <silent> <buffer> <Plug>TwodoNextRegular :<c-u>call todo#motion#NextRegular()<cr> +nnoremap <silent> <buffer> <Plug>TwodoPreviousRegular :<c-u>call todo#motion#PreviousRegular()<cr> +onoremap <silent> <buffer> <Plug>TwodoNextRegular :<c-u>call todo#motion#NextRegular()<cr> +onoremap <silent> <buffer> <Plug>TwodoPreviousRegular :<c-u>call todo#motion#PreviousRegular()<cr> + +nnoremap <silent> <buffer> <Plug>TwodoNextImportant :<c-u>call todo#motion#NextImportant()<cr> +nnoremap <silent> <buffer> <Plug>TwodoPreviousImportant :<c-u>call todo#motion#PreviousImportant()<cr> +onoremap <silent> <buffer> <Plug>TwodoNextImportant :<c-u>call todo#motion#NextImportant()<cr> +onoremap <silent> <buffer> <Plug>TwodoPreviousImportant :<c-u>call todo#motion#PreviousImportant()<cr> + if !hasmapto('<Plug>TwodoNewTodoBelow') && !maparg('<LocalLeader>n', 'n') nmap <silent> <buffer> <LocalLeader>n <Plug>TwodoNewTodoBelow endif @@ -83,3 +93,35 @@ endif if !hasmapto('<Plug>TwodoPreviousIncomplete', 'o') && !maparg('[u', 'o') omap <buffer> [u <Plug>TwodoPreviousIncomplete endif + +if !hasmapto('<Plug>TwodoNextRegular', 'n') && !maparg(']o', 'n') + nmap <buffer> ]o <Plug>TwodoNextRegular +endif + +if !hasmapto('<Plug>TwodoNextRegular', 'o') && !maparg(']o', 'o') + omap <buffer> ]o <Plug>TwodoNextRegular +endif + +if !hasmapto('<Plug>TwodoPreviousRegular', 'n') && !maparg('[o', 'n') + nmap <buffer> [o <Plug>TwodoPreviousRegular +endif + +if !hasmapto('<Plug>TwodoPreviousRegular', 'o') && !maparg('[o', 'o') + omap <buffer> [o <Plug>TwodoPreviousRegular +endif + +if !hasmapto('<Plug>TwodoNextImportant', 'n') && !maparg(']y', 'n') + nmap <buffer> ]y <Plug>TwodoNextImportant +endif + +if !hasmapto('<Plug>TwodoNextImportant', 'o') && !maparg(']y', 'o') + omap <buffer> ]y <Plug>TwodoNextImportant +endif + +if !hasmapto('<Plug>TwodoPreviousImportant', 'n') && !maparg('[y', 'n') + nmap <buffer> [y <Plug>TwodoPreviousImportant +endif + +if !hasmapto('<Plug>TwodoPreviousImportant', 'o') && !maparg('[y', 'o') + omap <buffer> [y <Plug>TwodoPreviousImportant +endif |