[Atom] In a medium/large project, those useful and powerful atom functions, project atom Functions
As a student party, when using atom at the beginning, I was not aware of the huge role of some small functions of atom until I participated in the project as an intern, only then can we know that these functions are a great tool for development in a project that can greatly improve work efficiency. The following is a usage experience of Peng huwan, who does not want to reveal his name (in fact, it is me, let's call it W.1. Search for the target code file command + shift + F (mac) ctrl + shift + F (windows) through the full project of the keyword segment)[Scenario 1]: W receives a small task on tower (a team collaboration tool). He wants to go to the site module on a site operated by the company, the bug of a bulletin board is corrected, but this module is not written by him, and he is not familiar with it. W tried to open the file one by one and search for the file code of the website announcement, but the file was nested deeply, when W made [Open Directory A] consecutively -- "[Open Directory AA in directory A] --" [open file AAA in folder AA] -- "[the slot file is not in directory! Fuck !] -- "[Open Directory B ].... after many times, W realized that what he did was rather silly, as a result, the time for searching for the code accounts for 90% of the time for solving the problem. [solution] W found that there was a conspicuous field in the target code in the "site announcement" line, in addition, he thinks that only the target file in the project contains this field, so! His command + shift + F pop up a search box, enter the keyword segment-"intra-site announcement" and press enter, atom starts to search for the target file through the "intra-site announcement" field in projects with hundreds of thousands of files. Click this file! So after retrieving the hundreds of thousands of files, W found the SieNews file.2. Locate the target code in the target file using the keyword field: command + F (mac) ctrl + F (windows)[Scenario 2]: W found the target file through method 1, but now there is another problem, when modifying this file, he found that the problem lies in a function called submit, but the problem is that the code of this file exceeds 1000 lines, although there are not many lines, but if W wants to "steal a lazy", can he directly find the function? [Solution]: That's right. It's the same as scenario 1. This time we retried the technology and knocked command + F. the pop-up: Enter the keyword "Submit" and press Enter. The page has automatically located the position of the submit function! Hey, wait! The prompt "13 result found for Submit" is displayed at the top of the search box, which means that when you search for a Submit, not only the Submit function, SubmitForm function, SubmitText function, but also the result set will be included in the search, there are 13 in total, so what should I do if Submit is not the first search result? -- At this time, you only need to press enter, and every time you press the page, it will be located in the next submit search result, it looks like a "frame-by-frame jump"3. Search for the target file by using the file name command + T (mac) ctrl + T (windows)Scenario 3: W encountered the same problem as scenario 1 this time. He wanted to search for a target file, but this time he knew what the file name was, how can we search globally at this time? [Solution]: command + T. The input file name is displayed, and the file you are looking for is displayed. Click it to open the file.4. Code folding makes the Code look more concise alt + command + shift + {(mac) alt + ctrl + shift + {(windows)Scenario 4: W receives a task to write a responsive static page. Although there is no complicated logic in it, he still needs to write a large number of functions. This seems messy when making some detailed changes. So W tried to fold each code block and displayed the [solution] in the form of a function name to go to the target page, knocking alt + command + shift + {, (Note that you should press these four keys one by one, but you cannot press them at the same time.) on the page, all the code blocks are collapsed and only the function names are kept outside the header. [note ]: it is really hard to press the four keys alt + command + shift +} [vomit] to undo...5. collapse a single code block[Scenario 5] is the problem above. What if you only want to collapse a code block instead of all code blocks at this time? [Solution] for this function, it is like this before the cursor moves near the function name: After the cursor moves near the function name, the small arrow code block before clicking const is collapsed.6. open the files on the navigation tree in the directory tree and set the focus.Scenario 6: W encountered some annoying problems. He opened 20 + pages in the navigation and now he wants to find the file in the directory tree. Unfortunately, when these 20 pages are opened successively, the directory tree is folded multiple times, W can no longer directly find the file in the directory tree. [solution] Right-click the file in the navigation bar, click reveal in tree view in the pop-up box to view the directory tree. The target file has been opened.7. other atom shortcut operationsAtom related operations of the shortcut key there are a lot of interested students can look at the short book on this article http://www.jianshu.com/p/e33f864981bb for other shortcuts I personally prefer to use is one of the two fast: control + E move to the end of the row control + A move to the beginning of the line as to some other shortcut keys, it feels that the speed and efficiency are not greatly improved. Of course, how to operate is a hobby of everyone.