Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Example Sublimetext 2 TODO plugin config

View Preferences.sublime-settings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
{
"color_scheme": "Packages/User/textmate-solarized/Solarized (Dark).tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_white_space": "selection",
"find_selected_text": true,
"font_face": "menlo",
"font_size": 12,
"highlight_line": true,
 
"todo":
{
"file_exclude_patterns":[
"*.css", "*.po", "*.mo"
],
"folder_exclude_patterns": [
"static", "vendor", "tmp"
],
"patterns":
{
"BUG": "BUG[\\s]*?:+(?P<bug>.*)$"
},
"case_sensitive": true,
"result_title": "TODO Results"
}
}

[
{
"command": "todo",
"keys": [
"ctrl+shift+t"
]
}
]

Key binding for user! AWESOME

Here is the same key binding but operates on the whole project:

{
  "keys": ["ctrl+shift+t"],
  "command": "todo",
  "args": {"open_files_only": false}
}

Patterns that will match normal TODO: foo as well as Google Python style guide -style TODO(person): foo:

    "patterns":
    {
        "TODO": "TODO[(]*.*[)]*:+(?P<todo>.*)$",
        "NOTE": "NOTE[(]*.*[)]*:+(?P<note>.*)$",
        "FIXME": "FIX ?ME[(]*.*[)]*:+(?P<fixme>\\S.*)$",
        "CHANGED": "CHANGED[(]*.*[)]*:+(?P<changed>\\S.*)$",
        "BUG": "BUG[(]*.*[)]*:+(?P<bug>.*)$"
    },

If you want to use this for php DocBlocks you can use this as your setting (didn't add all, just enough to see how):

"todo":
    {
        "case_sensitive": false,
        "file_exclude_patterns":
        [
        ],
        "folder_exclude_patterns":
        [
        ],
        "patterns":
        {
            "TODO": "@todo+(?P<todo>.*)$",
            "FILE": "@file+(?P<file>.*)$"
        },
        "result_title": "TODO Results"
    }

If I want a file to configure project-specific settings, where must be placed (related to my project folder) and how must be named?

All plugin configuration must be placed in user or project-specific settings inside a todo object, for example;

Inside the "settings" entry, like in this example to search PHPDoc comments for @todo

{
    "folders":
    [
        {
            "path": "."
        }
    ],
    "settings":
    {
        "detect_indentation": false,
        "tab_size": 4,
        "translate_tabs_to_spaces": true,
        "trim_trailing_white_space_on_save": true,
        "todo": {
            "patterns": {
                "TODO": "\\@todo[\\s]+(?P<todo>.*)$"
            },
            "folder_exclude_patterns": [
                "vendor"
            ]
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.