A collection of Eclipse shortcuts that new graduates find useful

This article is the 19th day article of WebCrew Advent Calender 2018. Yesterday, @ yuko-tsutsui said, "[Introduction to Nginx compiled by people who had never been aware of nginx or apache until a while ago](https: // qiita.com/yuko-tsutsui/items/b831e917539a89a5b83f) ".

Introduction

Nice to meet you! This is @yagiyuuuu, a new graduate development engineer who has been assigned to the university since October after completing the new graduate training. In the new graduate training, I had many opportunities to write code in Java and used Eclipse. I had never written code in Java, let alone Eclipse, so when I first started using Eclipse, I didn't know what it was. So, I would like to introduce a shortcut key that I used Eclipse and found "This is convenient !!"! !! I hope that after reading this article, beginners like me can develop as efficiently as possible.

Shortcut collection

Ctrl + / Comment out

You can do this by hovering over the line you want to comment out and pressing Ctrl + /. commentOut1.gif Commenting out is useful to remember, as you will always need it when you want to write notes in your code or when debugging.

Ctrl + Shift + / Comment out multiple lines

Shortcut key to comment out multiple lines. commentOut2.gif

Ctrl + Alt + K Camel case ⇔ Snake case conversion

You can do this by selecting the variable you want to convert and pressing Ctrl + Alt + K. kyasune_transfer.gif To be honest, I haven't used this shortcut key so much, but I'm surprised that I can do this!

Ctrl + Shift + F code format

If the code in the file gets dirty, press Ctrl + Shift + F! codeF.gif The code format is really convenient, so please use it! Even if you have written hard-to-read code, you can use this shortcut key to convert it into surprisingly easy-to-read code! However, don't try to code format other people's code just because it's convenient. That may result in an unintended format. .. ..

ʻAlt + Shift + R` Rename (refactoring)

Select the code you want to rename and press ʻAlt + Shift + R` to execute it. rifa.gif I think there are times when you are developing and want to change variable names. By using this shortcut key, all the code used with the same name in the project will be renamed.

ʻAlt + ↑ ↓ `Move each selected line

You can move the code in the selected range line by line with ʻAlt + ↑ ↓ . ![move.gif](https://qiita-image-store.s3.amazonaws.com/0/311462/e5703a3f-d278-2a42-8828-9cdb9923399c.gif) You can reduce the work of selecting with Shift + ➝etc., then deleting withCtrl + X, and doing Ctrl + V` on the line you want to insert.

Ctrl + Shift + X Y Change the size of characters

You can select a code and press Ctrl + Shift + X to enlarge the text. (You can make the characters smaller with Ctrl + Shift + Y.) fontsize.gif

Open the F3 declaration

You can fly to the place declared in the class etc. F3.gif I use this shortcut key the most! When looking at the code of the site operated by our company, it often has a complicated structure, and it often says "I don't know where this method is declared." When that happens, you can press F3 to open the declaration in an instant, which is very convenient.

Ctrl + Alt + H Open the call hierarchy

The opposite of F3, you can open the hierarchy that calls the declaration. callkaiso.gif I don't use it much compared to F3, but I can investigate the range of influence when changing the method.

Ctrl + H Search dialog display

You can perform various searches. kensaku.gif You can do various searches, but I basically only use it for File searches.

Ctrl + Shift + R Open resource

The file corresponding to the entered characters will be displayed. risosuhiraku.gif If you want to do a File search, this may be more convenient than using Ctrl + H.

Ctrl + O Quick outline

You can display the outline. You can also search. outline.gif

Finally

There are many useful shortcut keys other than the shortcut keys mentioned here, so if you are new to Eclipse, let's actively remember them! Remembering shortcut keys will dramatically increase your development speed! !!

Tomorrow is @ wc-keisuke_tokunaga. Thank you.

WebCrew is always looking for people to work with. Please feel free to enter. Recruitment of development engineers Recruitment of front-end engineers

Recommended Posts

A collection of Eclipse shortcuts that new graduates find useful
[Rails] A collection of tips that are immediately useful for improving performance
A collection of RSpecs that I used frequently
A collection of commands that were frequently used on heroku
Generate a unique collection of values from a collection that contains duplicate values
11 Eclipse shortcuts that impressed programmers in their first year of graduation
A collection of phrases that impresses the "different feeling" of Java and JavaScript
Rails Basics of creating a new application
Find the difference from a multiple of 10
It's just now, but a collection of commands that frequently appear in Rails
[Android Studio] A collection of shortcuts sent by people who love shortcuts [IntelliJ IDEA]