78

IntelliJ IDEA has an inspection that checks for spelling. In the analysis overview, I can see how many spelling mistakes were found, e.g. 12 typos found. In the code they are highlighted using a wavy green line.

However, I find it very hard to look manually for those wavy lines. Is there a keyboard shortcut or a search function which will automatically skip to the next highlighted typo?

0__
  • 66,707
  • 21
  • 171
  • 266
  • 5
    F2 and Shift+F2 shortcuts will navigate you to the Next / Previous highlighted error. You need to configure the error navigation first to _Go to next problem_ (from the context menu of editor right side bar). See [help](http://www.jetbrains.com/idea/webhelp/navigating-to-next-previous-error.html) for details. Another option is to use double click(F4 shortcut) from the Inspection Results window to go to the source. – Andrey Jan 28 '14 at 12:13
  • @Andrey ok, so there is no way to make this work without declaring typos to be errors (inspections -> spelling -> typo -> severity)? Because "Go to next problem" doesn't work with default green highlighting... – 0__ Jan 28 '14 at 12:35
  • For the highlighting navigation to work with typos you need to change error navigation level to **Go to next problem** instead of default **Go to high priority problems** option, http://imageshack.us/a/img826/1082/c9ux.png – Andrey Jan 28 '14 at 13:18
  • Thanks Andrey; I got confused. On OS X with Darcula, the menu items are not shown as _checkbox_ menus, so I didn't see which one was checked but thought that they are _action_ menus (nothing happening when I click on them). After "toggling" the item blindly, now F2 works. Please post as answer. – 0__ Jan 28 '14 at 13:37

4 Answers4

102

F2 and Shift + F2 shortcuts will navigate you to the Next / Previous highlighted error. You need to configure the error navigation first to Go to next problem instead of default Go to high priority problems option(from the context menu of editor right side bar):

enter image description here

See help for details. Another option is to use double click (F4 shortcut) from the Inspection Results window to go to the source.

Pavel
  • 4,912
  • 7
  • 49
  • 69
Andrey
  • 15,144
  • 25
  • 91
  • 187
  • This is the correct answer because the question asked for a keyboard shortcut. Those who would rather have a typo show up on the sidebar check out this answer: https://stackoverflow.com/a/37002620/6243324 – Sub 6 Resources Jun 20 '18 at 20:01
59

IntelliJ IDEA 2016.3

If you want to fix all typos from the project, you can list all of them and iterate through them using double click (or F4 to open the source):

  • Analyze > Run Inspection by Name...

    Analyze > Run Inspection by Name

  • Type "Typo"

    Typo

You will be able to see a list containing all typos grouped by file:

Spelling

Community
  • 1
  • 1
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
6

In Settings -> Editor -> Colors & Fonts -> General, you can add an 'Error stripe mark' color to Typo.

Mark Jeronimus
  • 9,278
  • 3
  • 37
  • 50
4

With the default settings of IntelliJ I find it difficult to spot the typos. So I do the following hack to spot and correct them once in a while.

  1. Temporarily change inspection setting to show Typos as Errors. Inspection settings
  2. IntelliJ then highlights the typos as Errors, making it much easier to spot them in the editor. I correct them and then revert the inspection setting changes. The changes can be kept permanently but I don't prefer that!
Curious
  • 2,783
  • 3
  • 29
  • 45