diff options
-rw-r--r-- | ftplugin/todo.vim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim new file mode 100644 index 0000000..3009845 --- /dev/null +++ b/ftplugin/todo.vim @@ -0,0 +1,36 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + + +nnoremap <silent> <buffer> <Plug>TwodoNewTodoBelow o- +nnoremap <silent> <buffer> <Plug>TwodoNewTodoAbove O- +nnoremap <silent> <buffer> <Plug>TwodoMarkComplete m`:<c-u>s/\v^(\s*)- /\1v /<cr>`` +nnoremap <silent> <buffer> <Plug>TwodoMarkDeleted m`:<c-u>s/\v^(\s*)- /\1x /<cr>`` +nnoremap <silent> <buffer> <Plug>TwodoMarkPartiallyCompleted m`:<c-u>s/\v^(\s*)- /\1S /<cr>`` +nnoremap <silent> <buffer> <Plug>TwodoRemoveOldTodos :<c-u>g/^\s*[vSx] /d<cr> + +if !hasmapto('<Plug>TwodoNewTodoBelow') || !maparg('<leader>n', 'n') + nmap <silent> <buffer> <leader>n <Plug>TwodoNewTodoBelow +endif + +if !hasmapto('<Plug>TwodoNewTodoAbove') || !maparg('<leader>N', 'n') + nmap <silent> <buffer> <leader>N <Plug>TwodoNewTodoAbove +endif + +if !hasmapto('<Plug>TwodoMarkComplete') || !maparg('<leader>c', 'n') + nmap <silent> <buffer> <leader>c <Plug>TwodoMarkComplete +endif + +if !hasmapto('<Plug>TwodoMarkDeleted') || !maparg('<leader>d', 'n') + nmap <silent> <buffer> <leader>d <Plug>TwodoMarkDeleted +endif + +if !hasmapto('<Plug>TwodoMarkPartiallyCompleted') || !maparg('<leader>s', 'n') + nmap <silent> <buffer> <leader>s <Plug>TwodoMarkPartiallyCompleted +endif + +if !hasmapto('<Plug>TwodoRemoveOldTodos') || !maparg('<leader>R', 'n') + nmap <silent> <buffer> <leader>R <Plug>TwodoRemoveOldTodos +endif |