commit 8a843ef55aaf79c5ffc44c2590b526ea222182ed Author: Gilson Filho Date: Wed Oct 17 14:14:08 2012 -0300 First commit diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..9a95360 --- /dev/null +++ b/README.markdown @@ -0,0 +1,34 @@ +# Search Tasks - Search TODO, FIXME and XXX in your project + + +## Introduction + +When you develop, it is likely that inserts comments that serves +as a reminder of what needs to improve, implement, or withdraw future. +You also have situations where you need to put a comment from a hack +who made or an encoding that need a better fix. + +For it is common to use labels TODO, FIXME and XXX in comments. +But how does all of them to look in a directory containing your source code? + +This plugin help and do a scan of all kinds of comments that matches the labels used. + + +## Commands + +```vimL +" Search in root directory (TODO, FIXME, XXX) +:SearchTasks . + +" Search in directory app/ in files .py +:SearchTasks app/*.py +``` + +## Configuration + +If you want to change or enter new labels for searchtask search, just enter the following in your configuration ``.vimrc``: + +```vimL +" List occurrences for search +let g:searchtasks_list=["TODO", "FIXME", "XXX"] +``` diff --git a/doc/searchtasks.txt b/doc/searchtasks.txt new file mode 100644 index 0000000..707af24 --- /dev/null +++ b/doc/searchtasks.txt @@ -0,0 +1,44 @@ +*searchtasks.vim* Plugin for searching occurrences in the tasks with TODO, + FIXME and XXX + +Author: Gilson Filho + +|searchtasks-introduction| Introduction +|searchtasks-commands| General Commands +|searchtasks-configuration| Configurations + +This plugin is only available if 'compatible' is not set. + +{Vi does not have any of this} + +INTRODUCTION *searchtasks-introduction* *searchtasks* + +When you develop, it is likely that inserts comments that serves +as a reminder of what needs to improve, implement, or withdraw future. +You also have situations where you need to put a comment from a hack +who made or an encoding that need a better fix. + +For it is common to use labels TODO, FIXME and XXX in comments. +But how does all of them to look in a directory containing your source code? + +This plugin help and do a scan of all kinds of comments that matches the labels used. + +GENERAL COMMANDS *searchtasks-commands* *searchtasks* + + *searchtasks-:SearchTasks* +:SearchTasks The only global command. Search occurrences in directory and list window matches. For example: > + + :SearchTasks /home/user/projects/app/*.py + :SearchTasks **/*.php + :SearchTasks *.c +< + + +CONFIGURATIONS *searchtasks-configurations* *searchtasks* + +If you want to change or enter new labels for searchtask search, just enter the following in your configuration .vimrc: > + + let g:searchtasks_list=["TODO", "FIXME", "XXX"] +< + +vim:tw=78:ts=8:ft=help:norl: diff --git a/plugin/.searchtasks.vim.swp b/plugin/.searchtasks.vim.swp new file mode 100644 index 0000000..c9d53c3 Binary files /dev/null and b/plugin/.searchtasks.vim.swp differ diff --git a/plugin/searchtasks.vim b/plugin/searchtasks.vim new file mode 100644 index 0000000..12191b3 --- /dev/null +++ b/plugin/searchtasks.vim @@ -0,0 +1,29 @@ +" searchtasks.vim - Search TODO, FIXME and XXX tasks +" Maintainer: Gilson Filho +" Version: 1.0 + +if exists("g:searchtasks_list") || &cp || v:version < 700 + finish +endif + +let g:searchtasks_list=["TODO", "FIXME", "XXX"] + + +" Search tasks {{{ +function s:SearchTasks(directory) + if !a:directory + echo "Directory is required (e.g: SearchTasks **/*.c)." + return '' + endif + + for task in g:searchtasks_list + execute 'vimgrepadd /' . task . '/gj ' . a:directory + endfor + + " show results + cwindow +endfunction +" }}} + +command -nargs=1 SearchTasks silent call s:SearchTasks('') +" vim:set sw=2 sts=2: