aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/todo-comments
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/todo-comments')
-rw-r--r--bundle/todo-comments/autoload/todo_comments.vim19
-rw-r--r--bundle/todo-comments/plugin/todo_comments.vim17
2 files changed, 36 insertions, 0 deletions
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 <silent> <Plug>(todo-comments-previous) :<C-u>call todo_comments#PreviousTODO()<CR>
+nnoremap <silent> <Plug>(todo-comments-next) :<C-u>call todo_comments#NextTODO()<CR>
+
+
+if !hasmapto('<Plug>(todo-comments-previous)', 'n') && !maparg('[t', 'n')
+ nmap [t <Plug>(todo-comments-previous)
+endif
+
+if !hasmapto('<Plug>(todo-comments-next)', 'n') && !maparg(']t', 'n')
+ nmap ]t <Plug>(todo-comments-next)
+endif