removing directory from project
You can manage your project contents via the .blazeproject file (Blaze > Project > Open Project View
To remove a package, delete the relevant lines in the 'directories' and 'targets' sections, then re-run blaze sync.
https://stackoverflow.com/questions/21177495/renaming-a-project-in-intellij-idea
Renaming a project in IntelliJ IDEA
Plugsin
Key Promoter X
https://plugins.jetbrains.com/plugin/9792-key-promoter-x
Awesome Console
Quick Documentation is your friend. Press Ctrl+Q
Code completion case sensitivity #
https://www.jetbrains.com/help/idea/structural-search-and-replace.html
https://www.jetbrains.com/help/idea/structural-search-and-replace-examples.html
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207028715-Show-error-warning-markers-next-to-line-number
https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html
Automatically add import statements
Install plugins
File | settings | editor | general | other | "Show quick doc on mouse move".
https://www.jetbrains.com/help/idea/using-live-templates.html
https://stackoverflow.com/questions/934794/is-there-break-on-exception-in-intellij/28480419
https://stackoverflow.com/questions/26381013/introduce-parameter-object-refactoring-in-intellij-13
https://stackoverflow.com/questions/7934876/intellij-idea-show-javadoc-automatically/28409582
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207028715-Show-error-warning-markers-next-to-line-number
n IDEA 13 "Use single class import" does not prevent wildcard imports. The solution is to go to
https://stackoverflow.com/questions/1945213/what-is-eclipses-ctrlo-show-outline-shortcut-equivalent-in-intellij-idea
On the main menu, point to , and then choose , , or respectively, or use the following shortcuts:
Open the IntelliJ IDEA IDE and click on Run Configurations (top right).
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206912435-copy-fully-qualified-class-name
https://www.ysofters.com/2014/10/01/intellij-idea-zoom-text-by-mouse-wheel/
I believe Ctrl + F12 may do what you want: it is the shortcut for the File structure Popup in the default
cmd + f12 for OS X
https://stackoverflow.com/questions/18814076/how-to-make-intellij-show-eclipse-like-api-documentation-on-mouse-hover
https://stackoverflow.com/questions/17571348/idea-equivalent-of-eclipse-type-hierarchy-f4
http://stackoverflow.com/questions/5905896/intellij-inspection-gives-cannot-resolve-symbol-but-still-compiles-code
https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
https://www.jetbrains.com/help/idea/2016.3/adding-an-existing-module-to-a-project.html
https://www.jetbrains.com/help/idea/2016.2/choosing-a-method-to-step-into.html
https://www.jetbrains.com/help/idea/2016.2/navigating-to-recent.html
http://stackoverflow.com/questions/18073545/eclipse-inspection-ctrl-shift-i-equivalent-in-intellij-community
mac - alt+command+f8
http://stackoverflow.com/questions/7934876/intellij-idea-show-javadoc-automatically
http://stackoverflow.com/questions/7934876/intellij-idea-show-javadoc-automatically
https://dzone.com/articles/become-polyglot-language
https://blog.jetbrains.com/idea/2009/03/user-defined-language-injection/
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206258509-Tomcat-and-Java-Heap-size-settings-from-Idea
In your Tomcat run/debug configuration setting, on the "Server" tab, there is a field labeled "VM Parameters". Enter the settings in there.
While IntelliJ is bringing up tomcat you get some deployment information logged to the screen. On my system it looks like this:
http://stackoverflow.com/questions/16784703/enable-partial-compile-intellij/16784855#16784855
http://stackoverflow.com/questions/19364949/how-to-view-the-list-of-compile-errors-in-intellij
Switch to 'Problems' view in the Project pane:
Enable the setting to compile the project automatically :
http://stackoverflow.com/questions/14251624/intellij-idea-hide-iml-files
http://blog.coffeebeans.at/archives/984
Renaming a project in IntelliJ IDEA
You can change the project name, which is the name that is shown in the recent projects list, like so:
Go to
Project Structure
(Ctrl+Alt+Shift+S) → Project Settings / Project → Project name:
Plugsin
Key Promoter X
https://plugins.jetbrains.com/plugin/9792-key-promoter-x
Awesome Console
Bamboo Soy
https://stackoverflow.com/questions/21177495/renaming-a-project-in-intellij-idea
https://www.jetbrains.com/help/idea/pro-tips.html
You can change the project name, which is the name that is shown in the recent projects list, like so:
Go to
Project Structure
(Ctrl+Alt+Shift+S) → Project Settings / Project → Project name:
Quick Documentation is your friend. Press Ctrl+Q
Code completion case sensitivity #
Settings/Preferences dialog (Ctrl+Alt+S), Editor | General | Code Completion
https://www.jetbrains.com/help/idea/structural-search-and-replace.html
https://www.jetbrains.com/help/idea/structural-search-and-replace-examples.html
https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html
Automatically add import statements
- In the Settings/Preferences dialog (Ctrl+Alt+S), click .
- Select the Add unambiguous imports on the fly checkbox, and apply the changes.
Install plugins
- Press Ctrl+Alt+S to open the Settings/Preferences dialog and then go to .
File | settings | editor | general | other | "Show quick doc on mouse move".
https://www.jetbrains.com/help/idea/using-live-templates.html
psfs | |
psvm | |
sout |
https://stackoverflow.com/questions/934794/is-there-break-on-exception-in-intellij/28480419
Run | View Breakpoints | Exception Breakpoints
Place the cursor on the method and from the top menu choose
Refactor -> Extract -> Parameter Object
. In the dialog that's opened, choose the class' name, package etc. and press "Refactor".- When you write code:
File -> Settings -> Editor -> General -> Code Completion -> Autopopup documentation in (ms)
It's only available when you press CTRL+SPACE It's more usable if you select the pin icon when it popups. The documentation window will be added to the tabs on the right. Later on I recommend to resize the window and to uncheck the
Pinned
property.- On mouse hover:
File -> Settings -> Editor -> General -> Show quick documentation on mouse move
1) Pay attention to overall file status -> top left corner
2) Use Navigate|Next/Prev error (F2) to quickly scan the file
3) Try to make it 'green' after you make it work as expected and keep it that way
4) Use Code|Analyse to review the current changelist/other scope
2) Use Navigate|Next/Prev error (F2) to quickly scan the file
3) Try to make it 'green' after you make it work as expected and keep it that way
4) Use Code|Analyse to review the current changelist/other scope
- macOS:
~/Library/Preferences/IntelliJ IDEA<xx>/keymaps/
n IDEA 13 "Use single class import" does not prevent wildcard imports. The solution is to go to
Preferences
(⌘ + , on macOS / Ctrl + Alt + S on Windows) > Editor > Code Style > Java > Imports tab
set Class count to use import with '*'
and Names count to use static import with '*'
to a higher value.https://stackoverflow.com/questions/1945213/what-is-eclipses-ctrlo-show-outline-shortcut-equivalent-in-intellij-idea
- Mac: ⌘+F12
On the main menu, point to , and then choose , , or respectively, or use the following shortcuts:
- Class: ⌘O
- File (directory): ⇧⌘O
- Symbol: ⌥⌘O
If you are using ToolBox App to install your JetBrains products then please have a look at the comments in IDEA-167332 ticket -- you will have to locate your apps in
~/Library/Application Support/JetBrains/Toolbox/apps/
folder.
Downside -- you need to repeat this to every new build of such app that you will install as the path to actual app will be different every time.
go to: System preferences -> Keyboard -> Shortcuts -> Functions keys
Click the + icon
Then press CMD+SHIFT+G to open up a path window. Enter: ~/Library/Application Support/JetBrains/Toolbox/apps
https://docs.alfresco.com/5.2/tasks/sdk-debug-intellij.htmlOpen the IntelliJ IDEA IDE and click on Run Configurations (top right).
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206912435-copy-fully-qualified-class-name
CtrlAltShift+C - copy reference
IntelliJ Idea has this feature, but it’s disabled by default.
You can enable zoom in few steps. Open Settings (Ctrl+Alt+S), search for “zoom“, select Editor.
https://stackoverflow.com/questions/1945213/what-is-eclipses-ctrlo-show-outline-shortcut-equivalent-in-intellij-ideaI believe Ctrl + F12 may do what you want: it is the shortcut for the File structure Popup in the default
cmd + f12 for OS X
https://stackoverflow.com/questions/18814076/how-to-make-intellij-show-eclipse-like-api-documentation-on-mouse-hover
To show the documentation info with "Mac OS X 10.5+" keymap press CTRL + J (thanks @GreenTurtle for sharing this)
Settings -> Editor -> "Show quick doc on mouse move"
Is this the feature you are looking for? The shortcut is
Ctrl+H
http://stackoverflow.com/questions/5905896/intellij-inspection-gives-cannot-resolve-symbol-but-still-compiles-code
First of all you should try
File | Invalidate Caches
and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names using
javap
.- Configuration:
~/Library/Preferences/<PRODUCT><VERSION>
- Caches:
~/Library/Caches/<PRODUCT><VERSION>
- Plugins:
~/Library/Application Support/<PRODUCT><VERSION>
- Logs:
~/Library/Logs/<PRODUCT><VERSION>
https://www.jetbrains.com/help/idea/2016.3/adding-an-existing-module-to-a-project.html
- Open the project you want to add a module to, and select File | New | Module from Existing Sources.
1) Close IntelliJ
2) delete
.idea/libraries
internals
3) Start IntelliJ
4) right-clicked
pom.xml Maven > Reimport
After that there were no old versions and duplicate libraries in the External Libraries.
From the File menu:
It's a pretty big hammer, though, requiring a restart of the app, and multi-minute rebuild of the IntelliSense index.
http://stackoverflow.com/questions/3348816/intellij-never-use-wildcard-imports- File\Settings... (Ctrl+Alt+S)
- Project Settings > Code Style > Java > Imports tab
- Set Class count to use import with '*' to 999
- Set Names count to use static import with '*' to 999
- From the main menu, choose Edit | Find | Replace, or press ⌘R. The search and replace pane appears on top of the active editor.
F6 | F8 | Step over |
F5 | F7 | Step into |
Shift + F7 | Smart step into | |
F7 | Shift + F8 | Step out |
Ctrl + R | Alt + F9 | Run to cursor |
Ctrl + U | Alt + F8 | Evaluate expression |
F8 | F9 | Resume program |
Ctrl + Shift + B | Ctrl + F8 | Toggle breakpoint |
Alt + Shift + Q, B | Ctrl + Shift + F8 | View breakpoints |
https://www.jetbrains.com/help/idea/2016.2/choosing-a-method-to-step-into.html
https://www.jetbrains.com/help/idea/2016.2/navigating-to-recent.html
Using multi-selection in the lists of recent files
- To select non-adjacent files, use Ctrl + mouse click.
- To select adjacent files, use Shift + mouse click.
To navigate to a recently edited file
To jump to the latest edit location
To jump to the next edit location
http://stackoverflow.com/questions/18073545/eclipse-inspection-ctrl-shift-i-equivalent-in-intellij-community
Quick evaluate expression
with Ctrl + Alt + F8 give me exactly what I want.http://stackoverflow.com/questions/7934876/intellij-idea-show-javadoc-automatically
http://stackoverflow.com/questions/7934876/intellij-idea-show-javadoc-automatically
Show Javadoc in IntelliJ IDEA 14:
- When you write code:
File -> Settings -> Editor -> General -> Code Completion -> Autopopup documentation in (ms)
It's only available when you press CTRL+SPACE It's more usable if you select the pin icon when it popups. The documentation window will be added to the tabs on the right. Later on I recommend to resize the window and to uncheck the
Pinned
property.- On mouse hover:
File -> Settings -> Editor -> General -> Show quick documentation on mouse move
https://blog.jetbrains.com/idea/2009/03/user-defined-language-injection/
In IntelliJ IDEA you can quickly configure language injection for XML tags, attributes and Java method parameters and their return values. Just use Inject Language Intention on the code like this:
and it will immediately turn to:
And you get the complete coding assistance, with syntax and error highlighting, completion and navigation.
http://stackoverflow.com/questions/17571348/idea-equivalent-of-eclipse-type-hierarchy-f4
Is this the feature you are looking for? The shortcut is
http://stackoverflow.com/questions/16671418/what-is-the-intellij-shortcut-key-to-create-a-javadoc-commentCtrl+H
Typing /** + then pressing Enter above a method signature will create Javadoc stubs for you.
You can use the action 'Fix doc comment'. It doesn't have a default shortcut, but you can assign the Alt+Shift+J shortcut to it in the Keymap, because this shortcut isn't used for anything else. By default, you can also press Ctrl+Shift+A two times and begin typing
Fix doc comment
in order to find the action.In your Tomcat run/debug configuration setting, on the "Server" tab, there is a field labeled "VM Parameters". Enter the settings in there.
-Xms768m
-Xmx768m
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206227859-Where-are-Tomcat-log-files-generated-when-running-Tomcat-under-IDEA-While IntelliJ is bringing up tomcat you get some deployment information logged to the screen. On my system it looks like this:
http://stackoverflow.com/questions/16784703/enable-partial-compile-intellij/16784855#16784855
Modify your configuration to use
Make, no error check
option instead of Make
.http://stackoverflow.com/questions/19364949/how-to-view-the-list-of-compile-errors-in-intellij
Switch to 'Problems' view in the Project pane:
Enable the setting to compile the project automatically :
http://stackoverflow.com/questions/14251624/intellij-idea-hide-iml-files
http://blog.coffeebeans.at/archives/984
Check “Ignored files and folders” in File Types settings:
File | Settings | Editor | File Types for Windows and LinuxIntelliJ IDEA | Preferences | Editor | File Types for OS X
Then add
https://www.jetbrains.com/help/idea/2016.2/adding-an-existing-module-to-a-project.html*.iml;*.idea;
in the text box in the bottom:- Open the project you want to add a module to, and select File | New | Module from Existing Sources.
- Open the IDE Settings, and under Colors&Fonts, scroll through the list of components, and select the ones related to consoles:
You need copy existing theme then change it.
https://www.jetbrains.com/help/idea/2016.2/zooming-in-the-editor.html
To change font size using the keyboard
Press ⇧⌘A.
In the popup frame, type Increase font size or Decrease font size, and then click ⏎.
Font grows larger or smaller.In the popup frame, type Reset font size, and click ⏎.
https://blog.jetbrains.com/idea/2014/03/postfix-completion/
Postfix code completion helps reduce backward caret jumps as you write code. It lets you transform an already typed expression to another one based on the postfix you added, the type of expression and its context. For example, the “.if” postfix applied to a boolean expression wraps it with an if statement. Likewise the “.notnull” triggers a surround template checking the expression for the null value.
serr
soutf
geti - create singleton getInstance method
Create new template - sfl4j log
Preferences > Editor > Live Template
https://www.javacodegeeks.com/2014/01/code-faster-with-intellij-idea-live-templates.html
psfi – public static final int
psfs – public static final String
thr – throw new
Common Actions:
Build -> Build Artifacts
http://stackoverflow.com/questions/8492205/cant-find-system-out-println
https://www.jetbrains.com/help/idea/2016.2/keyboard-shortcuts-you-cannot-miss.html
https://www.jetbrains.com/help/idea/2016.2/generating-main-method-example-of-applying-a-simple-live-template.html
https://mythinkpond.com/2011/04/27/intellij-live-template-main-method-generation/
If you are wondering why when you make a POJO bean to implement Serializable, IntelliJ does not throw any warnings to create the serialVersionUID variable… It’s because you need to enable it
https://medium.com/@fedor/intellij-tips-and-tricks-3e1dce6561a#.8q4r0m2cq
Last Edit Location (⌘⇧Delete). It allows you to jump to the location you were editing last.
Back (⌘⌥←) and Forward (⌘⌥→) actions which allows to jump to previous and next caret locations.
Structure View (⌘F12)
going to a declaration of a method/function/class (⌘B or ⌘Click)
It is super handy to write less code and also it’s easier to read the code that way. But sometimes you want to know the actual type of a variable. Type Info action (⌃⇧P) will help you in this case.
This one is my personal favorite. Put a bookmark with F11 and search for one with ⇧F11. Simple as that. ???
Note: IntelliJ runs only light inspections on the fly. If you want to Run all available inspections use Analyze -> Inspect Code action.
Rename Refactoring (⇧F6) is much smarter then a regular find and replace
It allows you to select logical blocks like an expression or a group of statements. Note: you can invoke Extend Selection (⌘W) action and Shrink Selection (⌘⇧W) action multiple times
- alt+up/down
Surround With (⌘⌥T) action works with statements and helps to surround them with another statement.
IntelliJ knows not only about hierarchy of the classes, but also about all the methods that you can override or should implement. Pop-ups for Override Methods (⌘O) and Implement Methods(⌘I) automatically show only methods eligible for the action.
- ctrl+o
-ctrl+I
http://osxdaily.com/2015/06/17/home-end-button-mac-keyboard-functions/
https://dzone.com/articles/intellij-idea-small-tips-big
To see the magic, choose a block of code worth refactoring and instead of going up into the menu press Control + Shift + A and enter the name of the command you want to perform. Wild cards or incomplete names are of course allowed.
plugins
key promoter
https://www.eriwen.com/tools/best-intellij-plugin-ever-key-promoter/
https://plugins.jetbrains.com/search/topRated?pr=idea
7. String Manipulation
10. Grep Console
Maven Helper
Findbugs:
https://dzone.com/articles/intellij-idea-finds-bugs
http://stackoverflow.com/questions/11704327/how-to-optimize-imports-automatically-after-each-save-in-intellij
https://blog.jetbrains.com/idea/2014/07/try-intellij-idea-14-eap-138-1283-4-with-code-cleanup-android-studio-beta-features-and-more/
To use the feature, simply go to Analyse → Code Cleanup… menu.
https://confluence.jetbrains.com/display/IntelliJIDEA/Working+with+Scala+Worksheet
To create a Scala Worksheet, right-click on your project and select New→ Scala Worksheet:
http://netlicensing.io/blog/2012/12/25/intellij-idea-how-to-generate-serialversionuid/
http://stackoverflow.com/questions/746109/intellij-idea-equivalent-of-eclipse-link-with-editor
http://stackoverflow.com/questions/14127381/intellij-idea-12-code-completion-without-capitalisation
IntelliJ IDEA > Preferences > Plugins
https://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/
Preferences > code style > import new format xml
https://www.jetbrains.com/help/idea/2016.2/keyboard-shortcuts-you-cannot-miss.html
http://stackoverflow.com/questions/30500263/optimal-keymap-while-using-intelij-idea-on-linux-and-mac
http://stackoverflow.com/questions/6796545/convert-existing-generics-to-diamond-syntax
Other useful features:
spelling
Shortcuts:
https://resources.jetbrains.com/assets/products/intellij-idea/IntelliJIDEA_ReferenceCard_mac.pdf
http://stackoverflow.com/questions/746109/intellij-idea-equivalent-of-eclipse-link-with-editor
IntelliJ IDEA equivalent of Eclipse “Link with Editor”
Importing Gradle project - getting JAVA_HOME not defined yet
https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111
code distracts from the real problems we’re solving. Thankfully, there’s a solution: JSR 305’s
https://www.jetbrains.com/help/idea/parametersarenonnullbydefault-annotation.html
To change font size using the keyboard
Press ⇧⌘A.
In the popup frame, type Increase font size or Decrease font size, and then click ⏎.
Font grows larger or smaller.In the popup frame, type Reset font size, and click ⏎.
Postfix code completion helps reduce backward caret jumps as you write code. It lets you transform an already typed expression to another one based on the postfix you added, the type of expression and its context. For example, the “.if” postfix applied to a boolean expression wraps it with an if statement. Likewise the “.notnull” triggers a surround template checking the expression for the null value.
serr
soutf
geti - create singleton getInstance method
Create new template - sfl4j log
Preferences > Editor > Live Template
You can do it easily with the Live Templates, you just have to go to Editor -> Live Templates -> others -> create new
And in these fields :
- Abbreviation: log
- Description: Add log line
- Template text:
private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger($CLASS_NAME$.class);
- Applicable in: Java: declaration
- Edit variables: CLASS_NAME Expresion: className()
- ifn – Inserts “if null” statement
- inn – Inserts “if not null” statement
- inst – Checks object type with instanceof and down-casts it
- lazy – Performs lazy initialization
psfi – public static final int
psfs – public static final String
thr – throw new
Common Actions:
Build -> Build Artifacts
http://stackoverflow.com/questions/8492205/cant-find-system-out-println
soutm (+TAB) ==> System.out.println("Class.And.Method.Name")
soutv (+TAB) ==> System.out.println("Last variable used = " + value);
sout
- just print System.out.println()
soutm
- added Class name & method name
soutp
- added parameter
soutv
- added last variable name
For 2016 version, the settings is on File > Settings > Editor > General > Code Completion > Case Sensitive Completion > None
Find action by name | ⇧⌘A |
Show the list of available intention actions . | ⌥⏎ |
Switch between views (Project,Structure, etc.). | ⌥F1 |
Insert a live template. | ⌘J |
Surround with a live template. | ⌥⌘J |
Comment or uncomment a line or fragment of code with the line or block comment. | ⌘/ ⌥⌘/ |
Find class or file by name. | ⌘O ⇧⌘O |
Find/replace text string in the current file. | ⌘F ⌘R |
Find/replace text in the project or in the specified directory | ⇧⌘F ⇧⌘R |
Search everywhere. | Double-press Shift |
Quick view the usages of the selected symbol. | ⇧⌘F7 |
Expand or collapse a code fragment in the editor. | ⌘+ ⌘- |
Invoke code completion. | ⌃Space |
Smart statement completion. | ⇧⌘⏎ |
Smart completion | ⌃⇧Space |
Show the list of available refactorings (Refactor This). | ⌃T |
- On the main menu, choose . Alternatively, right-click the editor and choose Generate on the context menu, or use ⌘N keyboard shortcut.
https://www.jetbrains.com/help/idea/2016.2/generating-main-method-example-of-applying-a-simple-live-template.html
https://mythinkpond.com/2011/04/27/intellij-live-template-main-method-generation/
Type “psvm” Ctrl+J will generate the main method.
Why “psvm”?
“public static void main”
“public static void main”
“main” with Ctrl + J works by default on IntelliJ IDEA
https://mythinkpond.com/2011/02/18/intellij-serialversionuid-enabling/If you are wondering why when you make a POJO bean to implement Serializable, IntelliJ does not throw any warnings to create the serialVersionUID variable… It’s because you need to enable it
https://medium.com/@fedor/intellij-tips-and-tricks-3e1dce6561a#.8q4r0m2cq
Last Edit Location (⌘⇧Delete). It allows you to jump to the location you were editing last.
Back (⌘⌥←) and Forward (⌘⌥→) actions which allows to jump to previous and next caret locations.
Structure View (⌘F12)
going to a declaration of a method/function/class (⌘B or ⌘Click)
It is super handy to write less code and also it’s easier to read the code that way. But sometimes you want to know the actual type of a variable. Type Info action (⌃⇧P) will help you in this case.
Ok. Now you see the type of a variable but what if you want to navigate to the definition of the class? Type Declaration action (⌃⇧B) will do exactly what you want. And it works for expressions too!
While navigating through your code you are ending up opening a bunch of useless tabs in IntelliJ. By default it’s just 10 most recent tabs. Of course you can change the limit in Preferences -> Editor -> General -> Editor Tabs. But Quick Definition Action (⌘⇧I) will show the definition of a class/method/field etc in a pop-up and not in a new tab. - alt+space
- Find Usages ⌥F7
- Find Usages in File ⌘F7
- Highlight Usages in File ⌘⇧F7 - alt+f to search in file
This one is my personal favorite. Put a bookmark with F11 and search for one with ⇧F11. Simple as that. ???
Note: IntelliJ runs only light inspections on the fly. If you want to Run all available inspections use Analyze -> Inspect Code action.
Rename Refactoring (⇧F6) is much smarter then a regular find and replace
It allows you to select logical blocks like an expression or a group of statements. Note: you can invoke Extend Selection (⌘W) action and Shrink Selection (⌘⇧W) action multiple times
- alt+up/down
Surround With (⌘⌥T) action works with statements and helps to surround them with another statement.
IntelliJ knows not only about hierarchy of the classes, but also about all the methods that you can override or should implement. Pop-ups for Override Methods (⌘O) and Implement Methods(⌘I) automatically show only methods eligible for the action.
- ctrl+o
-ctrl+I
http://osxdaily.com/2015/06/17/home-end-button-mac-keyboard-functions/
The “Home” button on a Mac keyboard: Fn + Left Arrow
The ‘fn’ key on the Mac keyboard is the function button, hitting that with the left arrow will immediately jump to the very top of a page in the active application of OS X. This is the exact same function as hitting the “Home” button on a Windows PC.
The “End” button on a Mac Keyboard: Fn + Right Arrow
fn+command+left arrow
https://dzone.com/articles/intellij-idea-small-tips-big
To see the magic, choose a block of code worth refactoring and instead of going up into the menu press Control + Shift + A and enter the name of the command you want to perform. Wild cards or incomplete names are of course allowed.
plugins
key promoter
https://www.eriwen.com/tools/best-intellij-plugin-ever-key-promoter/
https://plugins.jetbrains.com/search/topRated?pr=idea
7. String Manipulation
10. Grep Console
Maven Helper
Findbugs:
https://dzone.com/articles/intellij-idea-finds-bugs
http://stackoverflow.com/questions/11704327/how-to-optimize-imports-automatically-after-each-save-in-intellij
File > Settings > Plugins > Browse repositories... > Search 'Save Actions' > Category 'Code tools'
https://blog.jetbrains.com/idea/2014/07/try-intellij-idea-14-eap-138-1283-4-with-code-cleanup-android-studio-beta-features-and-more/
To use the feature, simply go to Analyse → Code Cleanup… menu.
https://confluence.jetbrains.com/display/IntelliJIDEA/Working+with+Scala+Worksheet
To create a Scala Worksheet, right-click on your project and select New→ Scala Worksheet:
http://netlicensing.io/blog/2012/12/25/intellij-idea-how-to-generate-serialversionuid/
- Go to “File” => “Settings… (Ctrl+Alt+S)” => “Inspections” => “Serialization issues”
- … and enable “Serializable classes without ‘serialVersionUID’”
- Then use the IntelliJ IDEA light bulb or press Alt+Enter to generate the field
Main Menu | Search | Find Action (Ctrl+Shift+A) Command+Shift+A in mac
At IntelliJ IDEA 12 (13, 14 and 15 from comments), it is located at the gear icon into the "Project" Tool Window, called as our mate said, Autoscroll from source
check the image
File -> Settings -> Editor -> Code completion -> Case sensitive completion
Install plugins:IntelliJ IDEA > Preferences > Plugins
https://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/
Eclipse | IntelliJ IDEA | Description |
F4 | ctrl+h | show the type hierarchy |
ctrl+alt+g | ctrl+alt+F7 | find usages - mac: command+alt+F7 |
ctrl+shift+u | ctrl+f7 | finds the usages in the same file - alt+f7 |
alt+shift+r | shift+F6 | rename |
ctrl+shift+r | ctrl+shift+N | find file / open resource ??? |
ctrl+shift+x, j | ctrl+shift+F10 | run (java program) |
ctrl+shift+o | ctrl+alt+o | organize imports |
ctrl+o | ctrl+F12 | show current file structure / outline -> command+F12 |
ctrl+shift+m | ctrl+alt+V | create local variable refactoring |
syso ctrl+space | sout ctrj+j | System.out.println(“”) |
alt + up/down | ctrl + shift + up/down | move lines |
ctrl + d | ctrl + y | delete current line ==> command+delete |
??? | alt + h | show subversion history |
ctrl + h | ctrl + shift + f | search (find in path) -> command+shift+f |
“semi” set in window-> preferences | ctrl + shift + enter | if I want to add the semi-colon at the end of a statement |
ctrl + 1 or ctrl + shift + l | ctrl + alt + v | introduce local variable |
alt + shift + s | alt + insert | generate getters / setters |
ctrl + shift + f | ctrl + alt + l | format code-> command+alt+l |
ctrl + y | ctrl + shift + z | redo |
ctrl + shift + c | ctrl + / | comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y) |
ctrl + alt + h | ctrl + alt + h (same!) | show call hierarchy |
none ? | ctrl + alt + f7 | to jump to one of the callers of a method |
ctrl + shift + i | alt + f8 | evaluate expression (in debugger) |
F3 | ctrl + b | go to declaration (e.g. go to method) |
ctrl + l | ctrl + g | go to line -> command+l |
Preferences > code style > import new format xml
https://www.jetbrains.com/help/idea/2016.2/keyboard-shortcuts-you-cannot-miss.html
Press SHIFT TWO times and you can search anything, both class and method in the whole project.
I know that Ctrl /Command in mac+ N is to find classes and it is very useful. But what about methods?
Alt+Enter
Eclipse's Ctrl+1 in IntelliJ and Android Studio
Personally I don't think AltEnter is particularly correct. Ctrl1 does lots of code generation like generating local variables given a method call etc.
CtrlAltV ... generates a local variable
CtrlAltF ... generate a field
AltInsert ... generate (drop down menu to generate all sorts)
Now, unrelated to the question but maybe helpful and in the same ball park is that the "foreach" short cut in IntelliJ is iter rather than for.
http://stackoverflow.com/questions/30500263/optimal-keymap-while-using-intelij-idea-on-linux-and-mac
This might be a litle bit subjective topic, but here is some information which might help you decide:
There are two main different predefined keymaps for OS X in IntelliJ (you can find them in Settings/Keymap).
- Mac OS X
- Mac OS X 10.5+
The Mac OS X keymap is similar to Linux/Windows keyboard. So if you need to switch between multiple systems this one is probably better for you.
The Mac OS X 10.5+ keyboard is designed to fit it into the OS X ecosystem so if you are used to general OS X shortcuts, this one will feel more natural and you will easily guess a lot of shortcuts.
Here is a reference for the Mac OS X 10.5+ keymap.
Oh yes, I have successfully done this on IntelliJ (free Community Edition).
Menu > Analyze > Inspect Code...
In the result, select "Java language level migration aids > Explicity type can be replaced with <>"
Right click, run "Apply Fix 'Replace with <>'" And you got diamonds.
There was a bug about diamond on anomymous classes, so some code may not compile after the fix. You'll have to revert them back then.
// anonymous class, <> doesn't work.
new Factory<Pig>(){ ... }
// however IntelliJ may wrongly "fix" it to
new Factory<>(){ ... } // does not compile.
Other useful features:
spelling
Shortcuts:
https://resources.jetbrains.com/assets/products/intellij-idea/IntelliJIDEA_ReferenceCard_mac.pdf
http://stackoverflow.com/questions/746109/intellij-idea-equivalent-of-eclipse-link-with-editor
IntelliJ IDEA equivalent of Eclipse “Link with Editor”
That would be : Autoscroll from Source.
Tomcat integration is available only in IntelliJ IDEA Ultimate Edition, while you are running the Community Edition. Here is the page that describes the difference between the editions.
You need to setup a SDK for Java projects, like @rizzletang said, but you don't need to create a new project, you can do it from the
Welcome
screen.
On the bottom right, select
Configure > Project Defaults > Project Structure
:
If you’re defining Kotlin APIs you don’t need non-null annotations. The entire language is non-null by default and only types suffixed with
https://www.jetbrains.com/help/idea/annotating-source-code.html?
can be null.https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111
code distracts from the real problems we’re solving. Thankfully, there’s a solution: JSR 305’s
@ParametersAreNonnullByDefault
indicates that everything in an entire package is non-null unless otherwise specified. Apply it by creating a package-info.java
file in each package.https://www.jetbrains.com/help/idea/parametersarenonnullbydefault-annotation.html
Annotation @ParametersAreNonnullByDefault gives the developer an option to define that for a given class or package all the elements (methods, parameters, fields and variables) have
@NotNull
semantic, unless they are explicitly annotated with the @Nullable
annotation.
This is done by adding annotation
https://blog.csdn.net/linsongbin1/article/details/80211919
@javax.annotation.ParametersAreNonnullByDefault
to the entire package, class, or method.https://blog.csdn.net/linsongbin1/article/details/80211919
2) Use Navigate|Next/Prev error (F2) to quickly scan the file
3) Try to make it 'green' after you make it work as expected and keep it that way
4) Use Code|Analyse to review the current changelist/other scope