Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sample analysis using IDEA

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you the "sample analysis of using IDEA", which is easy to understand and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn the article "sample analysis of using IDEA".

1. Set up maven

In File- > settings- > search for mavenMavan home directory-- settings maven installation package bin folder location User settings file-- settings setting files location Local repository-- settings local warehouse

2.IDEA sets the line width of code in File- > settings- > Editor- > Code Style some people will ask, if you enter code beyond the width line, how to let IDE automatically wrap the code? There are two ways! First, under the above "Right margin (columns)", there is a "Wrap when typing reaches right margin" option. What is the effect of selecting it? As the number of characters entered increases, IDEA automatically wraps the code when the width of the contemporary code reaches the line. The first way is to trigger when you enter the code, and there is a second way. In File- > settings- > Code Style- > Java, select the "Wrapping and Braces" tab, and there is a "Ensure rigth margin is not exceeded" in the "Keep when reformatting". What is the effect of selecting it? From the literal meaning of the configuration item, it is easy to understand that when formatting Java code, make sure that the code does not exceed the width line. That is, after the code entered exceeds the line,

3.IDEA prompt is case-insensitive first open File- > setting and then type: sensitive to change the case sensitive completion on the right to NONE

4.IntelliJ force update Maven DependenciesIntellj automatic loading Mave dependency function is very useful, but sometimes encounter problems, resulting in pom file modification does not trigger automatic reload action, at this time you need to manually force update dependencies. Manually delete the Libraries content in Project Settings; in the Maven Project attempt, clean, delete the previously compiled file; right-click on the project-"Maven-" ReimportOk, and find that the dependency has been established!

5.idea environment configuration default save location idea environment configuration default save location: C:\ Users\ xxxxxxxxx\ .IntelliJIdea14, xxxxxx represents the user directory, you can back up this directory and restore this configuration if there is something wrong with the environment. The configuration path can be modified in% IDEA_HOME%/bin/idea.properties.

6. Hide unwanted files or folders (similar to eclipse's filter function) intellij idea hide unwanted files or folders (similar to eclipse's filter function) Open intellij-- >: > File-- > Settings-- > > search File Types

7. Change to Eclipse shortcut key File-> Settings-> Keymap = > Keymaps to Eclipse copy

8. Modify default setting-- default setting modify default setting-- default setting

9. Modify the smart prompt shortcut key File-> Settings-> Keymap-> Main menu-> Code-> Completion-> Basic= > change it to Ctrl+Alt+Enter and drop the conflicting Remove when saving. File-> Settings-> Keymap-> Editor Actions-> Complete Current Statement= > modify to Ctrl+

10. Find shortcut key conflicts deal with File-> Settings-> Keymap-> Main menu-> Edit-> Find = > modify Find... And Replace... Changed to Ctrl+F and Ctrl+R respectively

11. Show line number File-> Settings-> Editor-> General-> Appearance = > Show line numbers selected

twelve。 Code Smart Tip, ignore case File-> Settings-> Editor-> Code Completion and set Case sensitive completion to None.

13. Editor- > General-> Editor Tabs edited with * Mark in IDEA, you need to make the following settings so that the modified file will be marked with a * sign, and you can save the relevant file in time. "Mark modifyied tabs with asterisk"

14. Turn off the automatic code hint Preferences = > IDE Settings = > Editor = > Code Completion = > Autopopup documentation in (ms)

15. Common shortcuts to cut back and forth: Ctrl+Tab angular Top # 9 choose what you want [select context-related code]: Ctrl+W angular Top # 8 Code Generation: Template/Postfix + Tab Top # 7 give orders: Ctrl+Shift+A ®Top # 6 nowhere to hide: Shift+Shift «Top # 5 automatic completion: Ctrl+Shift+Enter Top # 4 create everything: Alt+Insert

Use the top three!

+ of "Alt+Enter" to Top # 1 +

With these magic keys and some auxiliary shortcuts, you can get your hands off the mouse more than 90% of the time, and focus on the keyboard as if you were performing on the piano. These humble but crucial last pieces of the puzzle are: the Zero command: Ctrl+Shift+A can find all Intellij commands, and each command is followed by its shortcut key. So it is not only a magic key, but also a tool to find and learn shortcuts. New: Alt+Insert can create classes, methods, and so on. Format code: format import list Ctrl+Alt+O, format code Ctrl+Alt+L. Dialog switch window: Alt+Num, commonly used are 1-project structure, 3-search results, 4 hand 5-run debugging. Ctrl+Tab toggles tabs, and Ctrl+E/Ctrl+Shift+E opens a recently opened or edited file. Unit test: Ctrl+Alt+T creates a unit test case. Run: Alt+Shift+F10 runs the program, Shift+F9 starts debugging, Ctrl+F2 stops. Debugging: F7/F8/F9 corresponds to Step into,Step over,Continue respectively. In addition, there are some customized ones, such as horizontal split screen Ctrl+ |, and some magical small functions such as Ctrl+Shift+V paste that were copied a long time ago. Alt+Shift+Insert (block selection) enters column mode to select by column.

16.svn cannot synchronize code problem fixed File-> Settings-> Subversion-> General = > Use command line client selected

To use command line, you need to specify the path to svn.exe, for example: d:\ tools\ TortoiseSVN\ bin\ svn.exe Note: do not include spaces in the path when installing TortoiseSVN, for example: C:\ Program Files\ TortoiseSVN\ bin\ svn.exe will report an error. Install TortoiseSVN choose to install all components, otherwise there may be no svn.exe

17. Set the SVN of idea to ignore the * .iml file Editor- > File Types= > Ignore files and folders add * .iml; enter .idea in lgnore files and folesrs; pay attention to the end of ";". You can hide the .idea folder.

18. Change the font size of edited text File-> settings-> EDITOR COLORS & FONTS-> FONT-> SIZE

19.IDEA encoding setting FILE-> SETTINGS-> FILE ENCODINGS = > IDE ENCODINGFILE-> SETTINGS-> FILE ENCODINGS = > Project EncodingFILE-> SETTINGS-> FILE ENCODINGS = > Default encoding for properties filesFILE-> SETTINGS-> FILE ENCODINGS = > Transparent native-to-ascii conversion

20.Live TemplatesSystem.out.println Quick output

"abc" .sout = > System.out.println ("abc")

How to use it in eclipse: sysout= > System.out.println ()

For cycle

List list = new ArrayList ()

Input: list.for can be output

For (String s:list) {}

21. Configure the tomcat parameter vm options:-Xms256m-Xmx512m-XX:PermSize=128m-XX:MaxPermSize=256m

The method of installing plug-ins in 22.idea

Take IntelliJ IDEA 14.0.1 to install the findbugs plug-in as an example:

(1) online method: go to File- > setting- > plugins- > browse repositorits to search for the name of the plug-in you want to download. You can find the download address on the right, and then restart it according to the prompt.

(2) offline installation: download the findbugs plug-in address: http://plugins.jetbrains.com/plugin/3847,

Download the FindBugs-IDEA-0.9.994.zip and install the plug-in: go to File- > setting- > plugins= > Install plugin from disk...

Navigate to the jar you just downloaded, click ok, and press the prompt to restart.

The plug-in is installed in C:\ Users\ xxxxxxxxx\ .IntelliJIdea 14\ config\ plugins\ plug-in.

Install the iBATIS/MyBatis min-plugin plug-in

23. Adjust the memory configuration parameters when idea starts

% IDEA_HOME%/bin/idea.exe.vmoptions

24. Import eclipse web project publish to Tomcat if you can't find import eclipse web project publish to Tomcat if you can't find it, you can add web support in the Facets of the environment configuration, and add the project deployment module name in Artifacts

25. Every time you open a new jsp or java file, the cpu takes up a lot of time. Without inspection, every time you open a new jsp or java file, the cpu takes up a lot of time, so you can remove the inspection:

File- > settings- > editor- > inspections

26.idea adds spring/struts associated file support project Settings- > Modules- > right click on the selected item to add

27.IDEA enables automatic compilation after class modification File- > setting- > Buil,Execution,Deployment- > compiler= > Make project automatically compilation error problem to solve the problem of Java complier setting in Error:java: Compilation failed: internal java compiler errorset. This error occurs when someone uses jdk1.6 and someone uses jdk1.7 version in the project.

twenty-eight。 Students who use Eclipse or MyEclipse to implement the Serializable interface may know that if you use the implements Serializable interface, you will be prompted to generate serialVersionUID. However, Intellij IDEA does not enable this feature by default. Preferences- > IEditor- > nspections- > Serialization issues- > Serializable class without 'serialVersionUID', selected above, in your class: the cursor is positioned before the class name, press Alt+Enter and you will be prompted to create the serialVersionUID automatically.

twenty-nine。 Performance mode

We can use [Presentation Mode] to maximize IDEA, allowing you to focus only on the code in a class and coding without interference.

You can use the Alt+V shortcut, talk about the View view, and then select Enter Presentation Mode. The effect is as follows:

The advantage of this model is that it makes you more focused, because you can only see the code for a particular class. The reader may ask, what if I want to see other classes of code after entering this mode? At this time, it is time to test your proficiency in keyboard shortcuts. You can use CTRL+E to pop up the most recently used files. Or use CTRL+N and CTRL+SHIFT+N to locate the file.

How to exit this mode? Simply use ALT+V to pop up the view view and select Exit Presentation Mode.

But I strongly advise you not to do this, because you can do anything in IDEA in Enter Presentation Mode mode. The premise, of course, is that you are proficient in IDEA.

thirty。 Magical Inject language

If you use IDEA to write JSON strings and then ask for a\ to escape double quotes, it's really inappropriate, annoying and error-prone.

In IDEA, you can use Inject language to help us escape double quotes automatically.

First position the focus inside the double quotes, use the alt+enter shortcut to pop up the inject language view, and select Inject language or reference.

After selecting, remember to press the enter enter key directly to pop up the inject language list. Select the json component in the list.

After the selection. The mouse focus is automatically positioned in double quotation marks, and you can see it when you use alt+enter again.

Select Edit JSON Fragment and enter, and you can see the view of editing the JSON file.

You can see that IDEA does help us escape double quotes automatically. If you want to exit the view of editing JSON information, simply use the ctrl+F4 shortcut key. Inject language can support more languages and operations than you can imagine, and readers can study it on their own.

thirty-one。 Powerful symbol

What can you do if you vaguely remember a few letters in the name of a method and want to find it in IDEA?

Use ctrl+shift+alt+n directly and use symbol to find it.

Conflict resolution between 32.idea shortcuts and Windows default shortcuts (such as Ctrl+Alt+ ↑ or Ctrl+Alt+F12): right-click on the desktop-graphics options-shortcuts-disable

thirty-three。 When formatting code, comments are formatted to solve the problem

Cancel enable javadoc formating

The above is all the content of the article "sample Analysis using IDEA". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 285

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report