webstorm使用技巧

在Webstorm中使用正则进行查找或替换

使用正则来查找
http://stackoverflow.com/ques…

想该行数据替换为下行数据。@include border-radius($big-radius);
border-radius: $big-radius;

Search for: 在搜素框中日填写下行。
@include(.*)\((.*)\);
Replace with: 在替换框中填写下行。
$1: $2;
The (.*) parts creates groups. the $< number > reference those groups.

完全是按照正则的规则来书写的。

注意勾选 搜素或替换框中的 Regexp, 否则不生效。

禁止索引node_modules

从setting – directory – 设置node_modules为excluded
删除 .ignore插件来避免卡死
If you need it being excluded from all your projects by default, just add node_modules to ‘Ignore files and folders’ list in

Settings -> Editor -> File types。添加 node_modules到ignore文件和文件夹列表

webpack无法在保存后自动重新编译

关闭Safe write选项
seems Webpack watch doesn’t work if the file is not saved directly. Please try turning ‘Safe write’ option
( Settings | Appearance & Behavior | System Settings | Use “safe write” (save changes to temporary file first)) off

左侧不显示project视图

webstorm不显示project视图,删除.idea/目录,重新打开即可

不同库或框架的代码提示

Language & Framewors -> Javascript -> Libraries 安装不同语言或框架的代码片段,用于编写代码时的智能提示。

如何快速比较两个文件的不同

在左侧project视图选中两个文件,按CTRL+D 即唤起比较弹窗

live templates

https://www.jetbrains.com/hel…

live templates 配置文件路径 C:\Users\80920\.WebStorm2017.2\config\templates
可以去github上自己找一些 live templates的 xml文件,或是自己随意添加

license server

如何搭建license server, 传送门
webstorm 2017.3.3版本很多网上可用的license server被封掉了,可用反代工具,使用反向代理的方式搭建本地的license server,将其跑在服务器即可,就不用每次在本地打开 反代教程

直接在commit message中打开issue或bug链接

version control -> issue navigation, 它是使用正则做模式匹配, regExp -> replacement expression

会在git commit message 中搜索指定的模式,把他们链接到issue tracker中的按指定模式配置后的链接地址

《webstorm使用技巧》

alt + enter 弹出 quick-fix

  • converting function to arrow function,
  • var declarations to let and const,
  • require calls to import statements,
  • strings to template strings.
    原文作者:littlelightss
    原文地址: https://segmentfault.com/a/1190000009113454
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞