Home » Java » Core Java » Using IntelliJ bookmarks

About Michael Scharhag

Michael Scharhag
Michael Scharhag is a Java Developer, Blogger and technology enthusiast. Particularly interested in Java related technologies including Java EE, Spring, Groovy and Grails.

Using IntelliJ bookmarks

This is a quick post about IntelliJ’s nice bookmark feature.

IntelliJ gives you the option to bookmark single lines of code. After a line has been bookmarked, you can use various ways to jump directly back to this line. So it can be a good idea to bookmarks code locations you often work with.

To create a new bookmark you only have to press F11 inside the code editor. Bookmarked lines show a small checkmark next to the line number.

 
 
 
 
intellij-bookmark1
Bookmarks can be removed by selecting the bookmarked line and pressing F11 again.

To see all bookmarks you can press Shift – F11. This opens a small popup window which shows a list of all bookmarks you have created.

intellij-bookmark5

Note that this window can be completely controlled by using the keyboard:

  • With Up / Down you can browse the list of bookmarks
  • With Enter you jump to the selected bookmark
  • Esc closes the window
  • A bookmark can be moved up or down using Alt – Up / Alt – Down

Note that you can also add a mnemonic identifier to a bookmark. You do this by selecting a line and pressing Ctrl – F11. This opens a small menu in which you can choose a mnemonic identifier (which is a character or a number).

intellij-bookmark3
You can choose an identifier by clicking on one of the menu buttons or by simply pressing the corresponding key on your keyboard.

Bookmark mnemonics are also shown next to the line number. In the following image 1 was choosen as mnemonic.

intellij-bookmark2

Mnemonics give you the option to move even quicker between bookmarks. You can directly jump to a mnemonic bookmark by opening the bookmark popup (Shift – F11) and pressing the mnemonic key (1 in this example).

For numerical bookmarks even more shortcuts are available. You can toggle a numeric mnemonic on a selected line by pressing Ctrl – Shift – <number>. If you want to jump to a numeric mnemonic you use the Ctrl – <number> shortcut.

For example: Ctrl – 5 brings you directly to the mnemonic bookmark 5.

Note that bookmarks are also shown in the Favorites view. So if you like clicking with your mouse, this is for you!

Reference: Using IntelliJ bookmarks from our JCG partner Michael Scharhag at the mscharhag, Programming and Stuff blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

and many more ....

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*


2 + = four

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close