Search code examples
eclipsetagskeyboardtask

Keyboard shortcut to place tasktags in Eclipse


Is there any keyboard shortcut for placing task tags in eclipse like the TODO / FIXME / XXX ( user-defined)

Have searched on Google and was not able to find a shortcut.


Solution

  • I did not find any TODO shortcut but a possible solution is to create a template so when you write some string and hit Ctrl + spacebar and Enter your TODO code will be entered.

    Window -> Preferences -> Java -> Editor -> Templates -> New

    • Set the Name of the template (e.g. todo)
    • Set the Pattern (e.g. //TODO)

    When you type todo and press Ctrl + spacebar and Enter // TODO will be inserted

    Such a trivial todo is useless but you can tweak it by using variables as shown in the picture. Use "Insert Variable" button to insert variables.

    enter image description here

    When you use the pattern shown in the picture following will be inserted:

    // TODO inserted by UserName [21. 1. 2015, 13:07:07]


    More about Java Editor Template Variables can be found here