| ** Nice to see, please , Form a habit ** > - You have an idea , I have an idea , After we exchange , One person has two thoughts > > - If you can NOT explain it simply, you do NOT understand it well enough Now we will Demo Code and technical articles are put together [Github Practice selection ](https://github.com/FraserYu/learnings) , It's convenient for you to read and inspect , This article is also included here , I think it's good , Please Star --- Most people are concerned with Intellij IDEA Maybe it started with 「 Beauty 」, In the end 「 Talent 」, Plus a variety of plug-ins buff The bonus for ,coding The rhythm of the rhythm of the minute to run  Put aside your own plug-in ,IDEA In fact, it's also very , stay [IntelliJ IDEA HTTP Client High level use details ](https://dayarch.top/p/http-client-advanced-usage.html) Give up in the development team in detail Postman The reason of , The used partner's backstage message is straightforward . But today I'm going to introduce another show with some subtle little features , She stands so conspicuously in front of you , You choose to ignore her  Sometimes we need to create temporary files or experimental code outside the project , It may be careless to create in a project Git Submitted by mistake , If you do not create a project, you need to switch to other applications to copy back and forth , For concentration coding Let's talk about , It doesn't seem smooth enough IDEA In fact, it has already solved this pain point for us , By means of Scratch files and Scratch buffers It can solve ## Scratch files | Scratch buffers IDEA The following directory structure is automatically generated in the project parallel directory , That's where the main character is today , Have you ever looked them in the face ?  Scratch files and Scratch buffers There is still a big difference between them : ### Scratch files Scratch files It's a fully functional 、 Executable and debug files , Support syntax highlighting 、 Code completion and all other features of the corresponding file type ( To put it bluntly, it's like Jupyter Notebooks) Scratch file The function of , Can satisfy us in Coding All kinds of ideas in , Used for quick recording . The created file is not stored in our project directory ( Avoid accidents git push The embarrassment of ), Even in IDEA You can also see the file you just created by switching to other projects , To be more specific , It's a global feature over the project , Here's the picture , Switch to another project ,Scratch files It's still there  Build a Scratch file It's simple , Use the shortcut key `⇧⌘N` , Support keyword search , You can directly create the corresponding type file , For example, set up a java Archives  The default will create a name called Scratch.java Files of , And write main Function , Like this :  Here and in your normal project write java The code doesn't make any difference , You can use `git status` Command to verify , The result is Git Not at all track Of , Don't worry about setting up temporary files In fact, what I often use is to create a scratch.sql Archives , Store some daily SQL Sentence , The same way to build it , Search for `sql` The default will create a scratch.sql Files of , After the file is created, the data source should be configured  After configuration , You can write what you use everyday SQL 了  Put the cursor on SQL Location , Use the shortcut key `⌘⏎` , Choose the appropriate Session ( Conversation ) Can run This one SQL It's a statement  After execution , You can see the picture you are familiar with , Because the picture here is IDEA Default database management tool , This article [IntelliJ IDEA The database management tool is so convenient ](https://mp.weixin.qq.com/s/SmjBdZAMynTndU_oTITd8Q) It has been explained in detail in the article  establish Scratch files There are so many types to choose from , There's always one that suits your needs ### Scratch buffers and Scratch files Similar , It's just Scratch buffers It's a simple text file , No coding AIDS ( To put it bluntly , Think of it as a notepad ), establish Scratch buffers There is no direct shortcut key , You need to use the universal shortcut key `⇧⌘A` , And enter the keyword ( such as buffer):  Hit enter , You'll create a new one called scratch.txt The text file of .** Build over and over again Scratch buffers, You will find , At most, you can only create 5 One **:  Because this operation is not frequent , So there's no default shortcut , If you're a keyboard shortcut obsessive-compulsive disorder , Then in KeyMap Add the corresponding shortcut key at  Here is an illustration of ** Precautions **: > If you are in the buffer1.txt There's something in the file , When you build the first 6 Time scratch buffer When filing ,buffer1.txt Will be emptied Don't look at Scratch files and Scratch buffers Will not be Git Tracking , But you can also right-click to see Local History To see all the changes in the past  Reduce application switching , Try to stay focused , You can use preview mode (ctrl+opt+v) and Shortcut key (cmd+e) Switch the most recently used files , Put on the headphones , Tell me , How many miles per hour ?  ## Summary This is a very small feature , But in the daily development can really bring a lot of help : - Access across projects - Don't be Git Followed by , Prevent MIS submission - You can temporarily test code in various languages Finally, with the use of preview mode , Reduce switching between applications , Everything seems to be flowing > Of course , keep Code Clean, Reduce guessing and recalling time , We'd better build it for us Scratch files and Scratch buffers More friendly file name [ Personal blog :https://dayarch.top](https://dayarch.top) [ Add my wechat friends ](https://mp.weixin.qq.com/s/G7BXuZh0Qh1-mE6ts4LJqQ), Group entertainment, learning and communication , Note 「 Into the group 」 > ### Welcome to the public account :「 Sun Gong is a soldier 」 > - the front Java Technology dry goods sharing > - Summary of efficient tools | Reply 「 Tools 」 > - Interview question analysis and answer > - Technical data collection | Reply 「 Information 」 > To read detective stories thinking relaxed interesting learning Java Knowledge of technology stack , This book simplifies complex problems , The principle of concretization and graphitization of abstract problems gradually decomposes technical problems , Technology continues to update , Please keep an eye on ...... --- ![](https://img2020.cnblogs.com/other/1583165/202011/1583165-20201105131151370-1912987