Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ key shortcuts #34

Open
makingthematrix opened this issue Jan 8, 2018 · 17 comments
Open

IntelliJ key shortcuts #34

makingthematrix opened this issue Jan 8, 2018 · 17 comments
Assignees
Labels
Milestone

Comments

@makingthematrix
Copy link
Owner

makingthematrix commented Jan 8, 2018

Ha :)

In my career I usedVisual Studio, Eclipse, IntelliJ on Linux and IntelliJ on Mac OS. As a result, I have remembering key shortcuts for the most popular actions, because apparently designes of each IDE had different ideas, and I suspect that sometimes they just pushed keys at random. The "Cmd/Meta" sign on Macs is also very confusing to me. So, as a part of learning Rust and writing this project I want to finally create and memorize a set of the most important shortcuts I'm going to use them in Intellij in on my projects from now on.

One more problem: Mac OS assigns special character to certain "Left Alt + something" combinations.
Alt+D: ∂
Alt+C: ć
and so on. I had to disable Left Alt from doing anything: https://stackoverflow.com/questions/11876485/how-to-disable-typing-special-characters-when-pressing-option-key-in-mac-os-x

Search for a Class, Create a Class, and Type Info does not work for Rust - only Scala.

Action Mac 10.5+ Eclipse New
Find Action Cmd+Shift+A Ctrl+Shift+A Ctrl+Shift+A
Extend Selection Alt+Up Ctrl+W Alt+X
Navigate -> Class Cmd+O Ctrl+Alt+T Ctrl+Alt+C
Create a new Class - - Ctrl+Alt+Shift+C
Search for a File Shift+Cmd+O Ctrl+Alt+R Ctrl+Alt+F
Create a new File - - Ctrl+Alt+Shift+F
Go to Declaration Cmd+B F3 Shift+F3
Quick Definition Alt+Space Shift+Space
Find Usages Alt+F7 Ctrl+G Ctrl+Alt+U
Find Usages in File Ctrl+F7 Ctrl+Shift+G Ctrl+Shift+U
Type Info Ctrl+Shift+P Alt+Equals Ctrl+Shift+T
Hint Actions Alt+Enter Alt+Enter Alt + Enter
Basic Completion Ctrl+Space Ctrl+Space Ctrl+Space
Comment/Uncomment Cmd+/ Ctrl+/ Ctrl+/
Block Comment/Un. Alt+Cmd+/ Ctrl+Shift+/ Ctrl+Shift+/
Reformat Code Alt+Cmd+L Ctrl+Alt+L Ctrl+Alt+E
Refactor This Alt+T Ctrl+Alt+Shift+T Alt+T
Rename Shift+F6 Alt+Shift+R Shift+F6
Rename File - Ctrl+F6
Optimize Imports Shift+Alt+O Shift+Alt+I
Navigate Back Cmd+[ Alt+Left Alt+Left
Navigate Forward Cmd+] Alt+Right Alt+Right
Move a line up - Alt+Up
Move a line down - Alt+Down
Move a statement up Alt+Up Shift+Alt+Up
Move a statement down Alt+Down Shift+Alt+Down
Auto-indent lines Ctrl+Shift+I Ctrl+Shift+I
@makingthematrix makingthematrix added this to the 0.1 milestone Jan 8, 2018
@makingthematrix makingthematrix self-assigned this Jan 8, 2018
@makingthematrix
Copy link
Owner Author

Alright, since I have to use these shortcuts across Linux and Mac, Rust and Scala, and maintain sanity in the process, I decided to create my own shortcuts for the actions which are the most useful to me. Here I'll leave a list of them, together with how they are defined on Mac.

The idea is that I need only 10-15 shortcuts and I can probably assign them to keys which start the name of the action, with Ctrl+Shift, or Alt-Shift as command keys (Ctrl+Alt is usually occupied already by something important).

@makingthematrix
Copy link
Owner Author

Ctrl+Shift+A - shows the list of possible actions. It stays like this. Except that, of course, its Cmd+Shift+A on Mac (and I'm going to change it to Ctrl+Shift).

@makingthematrix
Copy link
Owner Author

makingthematrix commented Jan 22, 2018

Extend selection: Ctrl+W (Eclipse), Alt+Up (Mac 10.5+). Changing to Alt+X

@makingthematrix
Copy link
Owner Author

makingthematrix commented Jan 22, 2018

Search for Class: Ctrl+Alt+T (Eclipse). Changing to Alt+C.
(btw, I added Ctrl+Alt+Shift+C as "Create new Class" for Scala)

@makingthematrix
Copy link
Owner Author

Search for File: Ctrl+Alt+R (Eclipse). Changing to Alt+F.
Ctrl+Alt+Shift+F as "Create new File" for Rust.

@makingthematrix
Copy link
Owner Author

Go to Definition: F3 (Eclipse). Let it stay like this.

@makingthematrix
Copy link
Owner Author

Find Usages: Ctrl+G (Eclipse). Changing to Alt+U.
Find Usages in File: Ctrl+Shift+G (Eclipse). Changing to Ctrl+Shift+U.

@makingthematrix
Copy link
Owner Author

Type Info: Alt+Equals (Eclipse). Changing to Alt+I.
In Rust the type is hinted in the editior screen and this shortcut doesn't work... I guess.

@makingthematrix
Copy link
Owner Author

Do The Needful: Alt+Enter. Stays.

@makingthematrix
Copy link
Owner Author

Basic completion: Ctrl+Space (Eclipse). Stays.

@makingthematrix
Copy link
Owner Author

makingthematrix commented Jan 22, 2018

Commenting/uncommenting: Ctrl+Slash (Eclipse). Stays.
Also Ctrl+Shift+Slash which comments the code with a block.

@makingthematrix
Copy link
Owner Author

Reformatting code: Ctrl+Alt+L (Eclipse) which interferes with Screen lock on Ubuntu, changing to Alt+L.

@makingthematrix
Copy link
Owner Author

Refactor This: Ctrl+Alt+Shift+T (Eclipse) changing to Ctrl+Shift+R.
Worth to remember that Alt+Shift+R (Eclipse) is Rename (stays)
and Alt+R opens the Refactor menu.

@makingthematrix
Copy link
Owner Author

makingthematrix commented Jan 25, 2018

Optimize Imports: Shift+Alt+O (Mac), changing to Shift+Ctrl+I

@makingthematrix
Copy link
Owner Author

Find in Path: Shift+Cmd+F (Mac), changing to Shift+Ctrl+F
Replace in Path: Shift+Cmd+R (Mac), changing to Shift+Ctrl+R. That removes "Run context configuration".

@makingthematrix
Copy link
Owner Author

Navigate Back: Alt-Left (Eclipse). Stays.
Navigate Forward: Alt-Right (Eclipse). Stays.

@makingthematrix
Copy link
Owner Author

Move a block of code up: Alt+Up (Eclipse). Changing to Shift+Alt+Up.
Move a block of code down: Alt+Down (Eclipse). Changing to Shift+Alt+Down.
Move a line up: nothing on Eclipse. Changing to Alt+Up.
Move a line down: nothing on Eclise. Changing to Alt+Down.

I find moving lines of code much more useful than moving whole blocks. If I want to move a function or a data structure, I can easily select it with a mouse and I have much more control over it this way. And moving single lines is one of the most common things I do during refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant