Blogger Information
Blog 33
fans 0
comment 2
visits 41901
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PhpStorm自定义代码自动完成
hanyufeng的博客
Original
1808 people have browsed it

PhpStorm 可以自定义代码补全,我们可以利用这个功能简化常用代码的书写。

例如,经常写JS循环代码:

for(var i = 1; i < obj.length; i++)
{
	//循环体内容

};

在2017.2中可以这样自定义自动完成:

File --> Settings --> Editor --> Live Templates,点击JavaScript,点击右上的"Add",类型选“Live Template”

补齐.png

Abbreviation(缩写)填“for”,Template Text 粘贴要自动完成的代码,然后点击OK 按钮左上的Define

补齐2.png

选中JavaScript

补齐4.png

点击OK保存后,效果如下(写for,按一下Tab键):

自定义代码完成.gif

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
1 comments
PHP中文网 2017-12-19 18:56:47
内容写的非常好
1 floor
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!