Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 761
Ajay Avatar asked Jan 02 '13 21:01

Ajay


People also ask

What does Ctrl k do in Eclipse?

In Eclipse, if the cursor is over a word and you press Ctrl + K you will jump to the next occurrence of that word in the file.

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

What is Ctrl Shift R in Eclipse?

Open project, file, etc. Ctrl+Shift+R. Open Resource (file, folder or project) Alt+Enter. Show and access file properties.

What does Ctrl Shift F do in Eclipse?

Ctrl + Shift + F formats the selected line(s) or the whole source code if you haven't selected any line(s) as per the formatter specified in your Eclipse, while Ctrl + I gives proper indent to the selected line(s) or the current line if you haven't selected any line(s).


1 Answers

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

like image 57
vitfo Avatar answered Oct 06 '22 23:10

vitfo