From 2043ce6e5d97730413de2f864e6ebbf0efbe1b41 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 25 Mar 2020 20:25:54 +0100 Subject: todo: Rename plugin to 'todo-comments' This plugin (specifically the `autoload/todo.vim` file) was colliding with the 'vim-twodo' plugin, which uses the same file name. Rename this plugin to prevent name conflicts. --- bundle/todo-comments/autoload/todo_comments.vim | 19 +++++++++++++++++++ bundle/todo-comments/plugin/todo_comments.vim | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 bundle/todo-comments/autoload/todo_comments.vim create mode 100644 bundle/todo-comments/plugin/todo_comments.vim (limited to 'bundle/todo-comments') diff --git a/bundle/todo-comments/autoload/todo_comments.vim b/bundle/todo-comments/autoload/todo_comments.vim new file mode 100644 index 0000000..8f0d19a --- /dev/null +++ b/bundle/todo-comments/autoload/todo_comments.vim @@ -0,0 +1,19 @@ +function! s:MoveToTODO(search_flags) + let cnt = v:count1 + normal! m' + + let i = 0 + while i < cnt + call search('TODO', a:search_flags) + + let i += 1 + endwhile +endfunction + +function! todo_comments#NextTODO() + call s:MoveToTODO('') +endfunction + +function! todo_comments#PreviousTODO() + call s:MoveToTODO('b') +endfunction diff --git a/bundle/todo-comments/plugin/todo_comments.vim b/bundle/todo-comments/plugin/todo_comments.vim new file mode 100644 index 0000000..26d243b --- /dev/null +++ b/bundle/todo-comments/plugin/todo_comments.vim @@ -0,0 +1,17 @@ +if exists('g:loaded_todo_comments') + finish +endif +let g:loaded_todo = 1 + + +nnoremap (todo-comments-previous) :call todo_comments#PreviousTODO() +nnoremap (todo-comments-next) :call todo_comments#NextTODO() + + +if !hasmapto('(todo-comments-previous)', 'n') && !maparg('[t', 'n') + nmap [t (todo-comments-previous) +endif + +if !hasmapto('(todo-comments-next)', 'n') && !maparg(']t', 'n') + nmap ]t (todo-comments-next) +endif -- cgit v1.2.3