Intellij IDEA

Intellij IDEA use summary

Blog classification: Intellij IDEA
IntelliJ IDEA
1. IDEA memory optimization
First look at the configuration of your machine itself and configure it.
\IntelliJ IDEA 8\bin\idea.exe.vmoptions
----------- ------------------------------
-Xms256m
-Xmx384m
-XX:MaxPermSize=128m
-XX:NewRatio=4
-Xss128k
-Dsun .awt.keepWorkingSetOnMinimize=true
-server

-Xms256m Set the initial memory number, you need to set a reasonable value, increasing the value can improve the startup speed of Java programs. If your memory is large enough, such as 2G, you can set it to 400m.
-Xmx384m sets the maximum number of memory, increasing this value can reduce the frequency of memory Garage collection and improve program performance.
-Dsun.awt.keepWorkingSetOnMinimize=true allows IDEA to keep the occupied memory when it is minimized to the taskbar. When you return to IDEA, it can be displayed quickly instead of gradually showing the entire interface from the gray and white interface, speeding up the recovery. The speed of the original interface.
-server controls the way the memory garage is collected so that you don't have to spend a minute or two waiting for the memory garage to be collected.

Query shortcut
CTRL+N Find class
CTRL+SHIFT+N Find files
CTRL+SHIFT+ALT+N Find methods or variables in
classes CIRL+B Find sources of variables
CTRL+ALT+B Find all subclasses
CTRL+SHIFT+B Find classes of variables
CTRL+G Position Line
CTRL+F Find Text in Current Window
CTRL+SHIFT+F Find Text in Specified Window
CTRL+R Replace Text in Current Window
CTRL+SHIFT+R Replace Text in Specified Window
ALT+SHIFT+C Find Modified Files
CTRL+E The most recently opened file
F3 Search down the position where the keyword appears
SHIFT+F3 Go up the position where the previous keyword occurs
F4 Search for the source of the variable
CTRL+ALT+F7 The selected character searches the place where the project occurs
CTRL+SHIFT+O Pop up to display the search content


SVN management
Put Add the SVN library to IDEA SETTING -> VERSION CONTROL -> VCS = SVBVERSION to

initialize the import:
  1. Create a project
  2. Click to open the svn function in intellij IDEA [Menu Bar Version Control--->Enable Version Control Integration]
  3. Configure the svn access path of intellij as: svn://10.1.128.164/prvs
  4. Import the project to the svn warehouse [use tortoise import, do not use the one provided by intellij itself]
  5. Recheck out the warehouse in intellij IDEA Uploaded project

Automatic code
ALT+Enter Import package, automatic correction
CTRL+ALT+L Format code
CTRL+ALT+I Automatic indent
CTRL+ALT+O Optimize imported classes and packages
ALT+INSERT Generate code (such as GET, SET method, constructor, etc.)
CTRL+E or ALT+SHIFT+C Recently changed code
CTRL+SHIFT+SPACE Auto-completion code
CTRL+space Code prompt
CTRL+ALT+SPACE class name or interface name prompt
CTRL+P method parameter prompt
CTRL +J Auto code
CTRL+ALT+T Put selected code in TRY{} IF{} ELSE{}


Copy shortcut
F5 Copy file shortcut
CTRL+D Copy line
CTRL+X Cut, delete line
CTRL+SHIFT+ V can copy multiple texts


Highlight
CTRL+F Selected text, highlight up and down to jump to the next or previous
F2 or SHIFT+F2 Highlight errors or warnings Quickly locate
CTRL+SHIFT+F7 Highlight multiple keywords.


Other shortcuts
CIRL+Shift+U Change case
CTRL+Z Backward
CTRL+SHIFT+Z Forward
CTRL+F12 View class structure/all methods
CTRL+ALT+F12 Explorer open folder
ALT+F1 Find the directory location where the file is located
SHIFT+ALT+INSERT Vertical editing mode
CTRL+/Comment // 
CTRL+SHIFT+/Comment/*...*/ CTRL + W Select the
code, press continuously to have other effects Move Position SHIFT+F6 Refactor-Rename CTRL+H Show Class Diagram CTRL+Q Show Comment Documentation ALT+1 Quickly Open or Hide Project Panel CTRL+SHIFT+UP/DOWN Code Move Up/Down. CTRL+UP/DOWN The cursor jumps to the first line or the last line and the ESC cursor returns to the edit box











SHIFT+ESC The cursor returns to the edit box, and the useless window is closed.
F1 Please don't press help, it is very stuck! CTRL+ F4
is very


important


.
> COMPILER -> EXCLUDES ->

do not compile a module and do not display it on the view
MODULES SETTINGS -> (select your module) -> SOURCES -> EXCLUDED -> the entire project folder


IDEA encoding settings 3 steps
FILE -> SETTINGS -> FILE ENCODINGS -> IDE ENCODING
FILE -> SETTINGS -> FILE ENCODINGS -> DEFAULT ENCODING FOR PROPERTIES FILES
FILE -> SETTINGS -> COMPILER -> JAVA COMPILER -> ADDITIONAL COMMAND LINE PARAMETERS
plus parameter -ENCODING UTF-8 Compile If you do not add the GROOVY file, STRING S = "Chinese"; such a GROOVY file cannot be


compiled. Add other types of files such as *.TXT *.INI
FILE -> SETTINGS -> RESOURCE PATTERNS


to change the editing text font size during compilation
FILE -> SETTINGS -> EDITOR COLORS & FONTS -> FONT -> SIZE


Modify smart prompt shortcuts
FILE -> SETTINGS -> KEYMAP -> MAIN MENU -> CODE -> COMPLETE CODE -> BASIC


display file filter
FILE -> SETTINGS - > FILE TYPES -> IGNORE FILES...
Below is the type I filter, case sensitive
CVS;SCCS;RCS;rcs;.DS_Store;.svn;.pyc;.pyo;*.pyc;*.pyo;. git;*.hprof;_svn;.sbas;.IJI.*;vssver.scc;vssver2.scc;.*;*.iml;*.ipr;*.iws;*.ids

Quickly locate and edit in the PROJECT window FILE IN WINDOW Press ALT+F1
while editing the selected file, then select PROJECT VIEW
------------------------------- -------------------------------------------------- ---------------------------

2. Optimize file saving and project loading

Cancel "Synchronize file on frame activation" (synchronize file function, consider as appropriate Can not cancel)
cancel the selection of "Save files on framedeactivation"
At the same time, we select "Save files automatically", and set it to 30 seconds, so that IDEA can still keep the file automatically, so you need to press Ctrl+S to save the file every time you switch.

How to make IntelliJ IDEA not open when it moves Project file: Settings->General remove Reopen last project on startup

3. Use * to mark the edited file

Editor –> Editor Tabs
——————————————
In IDEA, you need to do the following settings , The modified files will be marked with *, and you can save the related files in time. "Mark modifiedied tabs with asterisk"


4. Display line numbers

How to display line numbers: Settings->Editor->Appearance tab item, check Show line numbers


5. Customize keyboard shortcuts

If the default code prompts and completion shortcuts follow the input Method conflict, how to solve: Settings->Keymap


6. How to make the cursor not position at will

in Settings->Editor to remove Allow placement of caret after end of line.


7. Chinese garbled problem
Settings-> File Encondings Select IDE Encoding as GBK.

When it contains Chinese file names or folders, there will be garbled characters of ??. The solutions are as follows:

File menu->Settings->Colors & Fonts->Editor Font=宋体, size=12, line spacing =1.0

In Settings->Appearance, check Override default fonts by (not recommended), set Name:NSimSun, Size:12

8 .DataBase Console retrieves data Chinese garbled settings
Settings-> IDE Settings-> Editor-> Colors & Fonts-> Font Change Selected fonts to DialogInput. If the development environment is different, you can select the corresponding font according to the actual situation
------------------------------------- -------------------------------------------------- -------------------------------------------------- --

General
-----------------------------------------
Cancel "Synchronize file on frame Activation" and "Save files on framedeactivation"
and we select "Save files automatically", and set it to 30 seconds, so IDEA can still keep the files automatically, so you need to press Ctrl+S every time you switch save document.

How to make IntelliJ IDEA not open the project file when moving: Settings->General remove Reopen last project on startup

Editor --> Editor Tabs
---------------------- -------------------
In IDEA, you need to do the following settings, so that the modified files will be marked with *, and you can save the related files in time.
How to display line numbers in "Mark modified tabs with asterisk"

: Settings->Editor->Appearance tab, check Show line numbers
default code hints and completion shortcuts conflict with the input method, how to solve: Settings->Keymap
how to make the cursor Do not position randomly: Remove Allow placement of caret after end of line in Settings->Editor

-------------------------------- ---------
IntelliJ IDEA does not support hot publishing, it is a waste of time and troublesome to restart the container just because we change a page. We solved this problem by changing the directory. Right-click on "AJAX", select "Module settings"



to go here, you will find a Web Facet Exploede Directory, and then we change this directory to point to the Web and node of the current project


*: Note that Exclude from module content is unchecked , otherwise the webroot will disappear

Then we start the container, edit the page casually, then click refresh, and find that the page can be displayed immediately

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326153891&siteId=291194637