Home >Backend Development >PHP Tutorial >Take you to understand the functions of the artifact phpstorm in one minute (share)

Take you to understand the functions of the artifact phpstorm in one minute (share)

慕斯
慕斯forward
2021-06-15 09:37:075034browse

This article will share with you one minute to help you understand the function of the artifact phpstorm (share). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Take you to understand the functions of the artifact phpstorm in one minute (share)

phpstorm contains all the functions of webstorm and can also support php code. PhpStorm is a lightweight and convenient PHP IDE designed to provide user efficiency by deeply understanding the user's coding, providing intelligent code completion, fast navigation, and instant error checking.

1. Modify the appearance of the entire software

Open "File"-"Settings"-"Appearance" ( Pay attention to the path. There are two Appearances here, one is the appearance of the software and the other is the appearance of the editor), and then find the theme on the right. You can choose different themes for the appearance of the software. For example, if you want to choose a more intimidating black appearance, you can choose Darcula, and then click "Apply", a button will pop up for you to restart the software. After restarting, you will be able to see the modified changes (the same below) ). The following Override default fonts by (not recommended) means to override the default fonts (not recommended). Although it is not recommended, we prefer to go against the will. Check the box and select the font " "Microsoft Yahei", font size 14, of course this is whatever you like.

2. Modify the editor appearance

Open "File"-"Settings"-"Editor"-" Click "Colors & Fonts" in "Appearance", there will be some existing styles on the right, they are the overall style of the editor, as shown in the picture:

If you want to partially modify the editor For fonts, you can click on the small mark in front of "Colors & Fonts". There is "Font" below it. Click it and some options will appear on the right. Note: These parameters cannot be modified at this time, so the first step is to first Save As...Save it as your own style and give it a name like mydefault, and then we can do whatever we want, haha.

It is best to choose "Show only monosoaced fonts". This is a monosoaced font. Monosoaced fonts are convenient for us to perform column operations when writing code. Size is 14, and Line spacing is 1.1. Of course, it’s up to you. Choose a font you like from the fonts below. The left box is available fonts, and the right box is Selected fonts. Available fonts and selected fonts. Fonts can be swapped by clicking the left and right triangle buttons in the middle. The selected font can be moved by using the up and down triangle buttons on the right to adjust its upper and lower position.

3. Support z-coding function

z-coding is a tool that allows you to write HTML with twice the result with half the effort , for example, if you enter ul.nav>li*5>a in the html file and then press the Tab key, a large piece of code will come out immediately, as shown below:

##This is just z- The tip of the coding iceberg, friends who are interested in more details can find information in this area.

4.Live Templates code snippet

A) Let’s first introduce the most basic of a code snippet Function, what we want to achieve is to type the four characters "quan" into the html file or php file. How to achieve it?

1). Open "File"-"Settings", find and click on "Live Templates",

2) .Click the number on the right (version 7.0 has two options, choose Live Templates),

3).Abbreviation is the abbreviation of the code snippet you want to output in the future, now enter "quan" ,

4).Description is the description of the code snippet. This is to facilitate us to know what this code is. We enter the "Webmaster Circle URL",

5).Template text is the content of the code snippet, we enter "http://wwwquan.com".

6). There is a line of red text below that is very important. No applicable contexts yet. Define allows you to choose which type of file your code snippet will work in. This must be selected. When there is no selection, as shown in the green box below, it is classified under a user category. Now we want to make it work in html and php files, so put a check in front of html and php in the pop-up box (after selecting, the words below will no longer be red), as shown in the picture.
Tip: Expand with is to set the shortcut key to display the set code snippet. We use the default Tab key and do not change it.

After saving and restarting, open an html or php file to test it.

#B) The following is a more complex usage of a code snippet.

Assume that we are a master who knows many cms, such as phpcms v9, empire, dreamweaver, etc., but each cms has its own label. Unless you memorize them all, you can only open its default template or manual and copy and paste. Now we will use the phpstorm code snippet to set up a quick input method, giving an example of how to quickly enter the keyword tags of phpcms v9 and the keyword tags of the empire.

1). Open "File" - "Settings", find and click on "Live Templates",

2). Click on the right (version 7.0 has two options, choose Live Templates),

3). Abbreviation is the abbreviation of the code snippet you want to output in the future. Now enter "cmskeywords",

4).Description is the description of the code fragment. This is to facilitate us to know what this code is. We enter the "keyword of cms",

5).Template text is the content of the code snippet. This time it is different from the previous one. We have to enter a variable "$var$". After entering it, you will find that the originally gray button "Edit variables" on the right becomes The status can be clicked, as shown in the red box in the picture below. We will set this in a moment.
6). Don’t forget to click on the red word “Define” below and set the html and php check boxes. This is because some cms templates are html and some are php type. This understands cms. You know, my friend.

7) Then click on the button "Edit variables" that can be clicked just now
You can see that "Derfault value" is the default value, we Enter ""Page Keyword"". Note that this is a string type. English double quotes must be added outside. There are many functions in the previous "Expression". What we want to introduce is the "enum()" enumeration function. We Enter "enum("empire keyword","phpcms keyword")", the parameters are in brackets, the parameters are enclosed in English double quotes, and the parameters are separated by English commas.

8) Repeat steps 2-6 below, click the number on the right, select Live Templates, enter the "Empire Keyword" in Abbreviation (this is the same as in your enumeration function The input parameters are the same), you can write it in Description as you like or not, you can also write “empire keyword”, it doesn’t matter; enter the empire keyword tag “[!–pagekey–]” and “Define” in Template text Click to set the check mark for html and php
9) Repeat steps 2-6 and set the "phpcms keyword" to "{$SEO['keyword']}"

OK, it’s time to witness the miracle, let’s test our results. Open an html or php file, why? Because we just set that the code snippets we set can only be used in these two types of files. Then enter "cmskeywords" where needed and press the Tab key. Is there a drop-down menu? The content inside is the one just set in the enumeration function. Use the up and down keys to select any one and press Enter, then press Tab again. You're done. .

Every step you take, think about where you set it up to get such a result. Just imagine, if you know N types of cms, how much time can you save by setting it up like this? , and the code you want to output may be very long, you can output it all at once, you can also draw inferences from one example and create more miracles with this method.

5. Import and export of configuration

Open "File"-"Export Setting", we can configure the things we have worked so hard to configure Export it. Ah Q’s warm tip: You can modify the storage path of this configuration file and put it in a folder that can be synchronized with the network, such as Sina Microdisk. The file to modify the configuration path is in the JetBrains under the installation directory of your software. \PhpStorm 7.0\bin\idea.properties, open it with Notepad, copy line 8, remove the # in front, and put the path of your synchronization folder after it, such as

The plug-in address can also be placed in your synchronization folder,

so that you can synchronize and use this configuration file at work and at home more quickly.

6. Project favorites

“File”-“Add to Favorites”

7.Set file encoding

“File”-“File Encoding”

8. Create a new local project

Open "File"-"New Project"

"Project name" is the name of the project. Don't be scared by the word "project". It is actually the name of the folder where you want to put the files, and "Location" is the name of the folder where you want to put the files. Path, "Project type" is the type of project, which is also a special feature of phpstorm. If you want to build an empty project, you can choose the default "Empty project". There will be an .idea folder by default in the empty project. At the same time, phpstorm has also prepared some other projects for you. For example, we built a "Twitter Bootstrap", which is a front-end framework tool launched by Twitter, the pioneer of Weibo. The steps are as follows:

Then you will see that there are already many files in this framework, and you can use them effortlessly

9. Create a new remote project

1. Open "Tools" - "Deployment" - "Brower Remote Host",

2. You can see a "Remote Host" area on the right side of the window, click on it Use three little buttons to create a new service

3. Fill in your FTP information. After filling in, you can click "Test FTP Connection" to test whether the connection is successful.

4. Click the "Advanced options" button in the previous picture, the following dialog box will pop up, check the "Passive mode" passive mode:

5. Also click on "Mappings" and select the place where you cache the mapping when you download the server file:

6. Then you can see your connection on the right The remote server, click on the small plus sign, you can see the things in your space:

7. When you edit a file for the first time , you can right-click on the name of the file and select "Upload here" to download it locally. It will be downloaded to the location you mapped,

8. After you complete editing, you can Right-click the mouse in the file editing area and select "Upload to" to upload the edited file to the server. If you find this troublesome, you can also set a shortcut key, such as "ctrl s".

Some people are afraid that "ctrl s" will conflict with local saving. Don't be afraid, because the power of phpstorm is that it does not require you to save locally, it will save automatically, and it also has a local version library.

Let's take a look at what this local repository is. Open "VCS"-"Local History"-"Show History" on the menu bar, you will see, The local repository not only saves the last modifications for you, but also records every modification you make to the file. The left column shows the modification time, the middle shows the modified place, and the right side shows the current file appearance. , so that you are no longer afraid of making mistakes and not being able to go back to the previous steps, and you are no longer afraid of a sudden power outage and not saving the files you worked so hard to edit, etc. Wow, I really want to say long live.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Take you to understand the functions of the artifact phpstorm in one minute (share). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete