官网:http://www.jetbrains.com/webstorm/

webStorm,File=》setting=》JavaScript-Libraries

How WebStorm Works: Completion for JavaScript Libraries

One of the essential features of WebStorm’s editor is code completion. The way it is implemented in WebStorm is that it takes all JavaScript files in the project and goes through them, adding functions and methods to an internal index used for code completion suggestions. The index is automatically updated whenever existing files are changed or new files are added.

JSDoc , used for documenting code, also plays an important role in making your coding experience better. It powers WebStorm autocompletion with additional details about parameters and their types.

But what if you have only minified files included, or if all the libraries are loaded dynamically? In this case it would be impossible for the IDE to statically analyse them and provide the necessary level of code completion when you press Ctrl+Space, or to resolve functions and methods you use.

This is where we introduce the concept (or mechanism) of External libraries that we use in WebStorm.

External libraries

External libraries are files explicitly added to project’s index to be used only in enhancing coding assistance (i.e. code completion, syntax highlighting, navigation, and documentation lookup). They are not to be edited in the scope of this project.

To make this concept clearer, let’s see how it works on a real project. Here is a simple project using the Famous framework for UI (same as on the screenshots above).

As we can see, some framework-specific methods are not resolved. This happens because the file famous.js is in not in the project, but is hosted on CDN.

To make WebStorm aware of the functions and methods of the library without adding its source code to the project, we need to set it as an External JavaScript library.

There are several ways to do this:

  • Download the library from the CDN link

The quick-fix ‘Download library’ (call up with Alt+Enter) loads the file from the CDN link into the WebStorm cache (but not in your project).

You can go to Preferences | JavaScript | Libraries to load the list of all libraries that could power code completion for your project and enable specific aspects of code completion that you need.

  • Add file or folder

Another way to add libraries to this list is manually. This option is useful when the library is stored locally on your computer, but not in the project folder.

Select Preferences | JavaScript | Libraries and click Add . Enter the library name and the path to the library file or folder. If you select Global visibility level, you’ll be able to enable this library in your other projects.

Additionally, you can specify the path to library’s/framework’s documentation. This URL will be opened when you press Shift+F1 ( Show external documentation ) on methods from the library.

Important note: If your library files are in the project folder, it’s worth adding them to the list of JavaScript libraries as described above: as a result, code inspections will be disabled for these files, and project-wide Code quality analysis will become faster.

Consider node_modules folder as an example. We would like to have code completion for the modules and keep them in the project, but there is no need for us to run inspections against these files. That is why this folder should be marked as a library. In fact, WebStorm does that automatically.

Node.js Core modules as External library

Node.js core modules (like http or fs ) are another example where External libraries are used. WebStorm suggests downloading the sources and marks them as Global libraries.

Once you’ve downloaded the sources, you can enable coding assistance for functions and methods from Node.js core modules in any of your projects. To do that, go to Preferences | JavaScript | Libraries and select the checkbox:

Using TypeScript community stubs (TypeScript definition files)

WebStorm provides one more workaround for adding coding assistance for some popular libraries, frameworks and modules when you don’t have the source code available in your project. It allows you to download DefinitelyTyped stubs. These definition files for libraries and frameworks are added to the list of your project’s External libraries, thus enhancing code completion.

Develop with pleasure!

JetBrains WebStorm Team

文章转自:http://www.tuicool.com/articles/732ENnZ

新版本的默认支持zen coding。

问题:如何修改编辑器字体

 
Settings -> Editor -> Colors & Fonts -> Font。
默认是不可以的,后来网上查到首先保存主题另存为才能修改字体。改成了Courier new。字体大小14.
 

WebStorm live edit功能与浏览器实现同步实现步骤:

http://ju.outofmemory.cn/entry/70084

http://www.350351.com/bianchengyuyan/CSS/314781.html

更多:http://www.cnblogs.com/jikey/archive/2012/03/28/2420704.html

运行:

配置:ctrl+alt+s。

alt+F2.

常用快捷键:

http://www.36ria.com/5700

web storm入门指南:

http://www.36ria.com/5884

WebStorm安装Vim以及快捷键设置

WebStorm安装Vim以及快捷键设置

运气好,赶上了2012年12月21日“世界末日”的促销活动,便宜买到了这款号称The smartest JavaScript IDE的软件。

我一向对工具很挑剔,由于是从.NET转型成Web前端,在尝试了Sublime Text 2以后,还是觉得VS把Web Essential, VsVim之类的插件装全了,更好用也更好看一些。

同时,作为一个Vim的受益者,IDE对Vim支持得如何很大程度上影响了我的选择。在vim的支持方面,VS的VsVim和Sublime的Vintage都有一些缺陷。种种原因,令我对WebStorm充满了期待。

安装Vim插件

在主界面用快捷键ctrl+alt+s打开settings界面,左侧导航栏里选中plugin项,如下图:

选中plugins后,会在右侧列出所有已安装的插件,我们要新安装一个插件,因此要点击Browse repositories。

弹出的新窗口默认会列出所有的插件,我们在右上角的搜索框输入ideavim进行筛选,然后在ideaVim上右键选择Download and install,如下图:

下载进度会显示在WebStorm主窗口底部的状态栏,下载完毕后会有提示,需要重启Web Storm才能使插件生效

重启后,就已经是Vim的输入方式了。这时候打开Tools菜单,会看见多了两项。

VIM Emulator:切换是否使用Vim的输入方式。

Reconfigure VIM Keymap: 设置快捷键。下文中我们将会用它来设置快捷键。

设置快捷键

长期在Windows下工作,使用Vim不可避免要搭配一些Windows的快捷键,比如ctrl+c, ctrl+v,在gVim, VsVim, Vintage里都做出了妥协,采用了Windows的行为。但WebStorm默认并没有保持这些快捷键在Vim中原有的作用。没关系,下面就来详述一下如何解决这个问题。

具体做法是:新建一套键盘映射,然后让vim使用这套映射。

(我装了vim插件后,进入vim编辑模式,ctrl+z默认撤销, 用,ctrl+c不行)。

首先,在主界面用快捷键ctrl+alt+s打开settings界面,左侧导航栏里选中Keymap项,如下图:

在右侧的keymaps下拉列表中选择Default,我们将以此为基础进行修改,因此点击copy按钮,复制一份新的出来,接下来就可以放心在上面修改了。

给它起一个新的名字myVim。

现在要看看copy命令的快捷键,于是在右上的搜索框输入copy,会把与copy相关的都筛选出来,见下图:

我们看到,ctrl+V和ctrl+Insert都能达到copy的目的。同样,在Default模式下ctrl+V也可以实现paste操作了,这些快捷键都从Default那里继承了过来。

常使用Vim的人肯定知道Esc键有多常用。但现代键盘几乎都让Esc键偏居一隅,够起来不方便。其实在标准的Vim里,ctrl+[同样能达到Esc的效果。但是在WebStorm的Default模式下,ctrl+[已经被赋予了另外的作用,由于myVim从Default继承而来,因此ctrl+[也起不到Esc的作用。好在WebStorm的自定义快捷键可以覆盖系统的默认设置。

在上图中快捷键的位置上点击右键,会弹出用于删除和添加快捷键的菜单。修改的时候,如果和别的快捷键有冲突会看到红字提醒。例如下图所示,ctrl+[的原有功能是Move caret to code block start. 我们的本意就是给它赋予新的功能,果断点OK,接下来会再弹一个确认对话框,点remove删除原有的热键功能。

完成后点击下面的OK按钮退出Keymaps设置。如下图,打开主界面菜单栏中的Tools > Reconfigure VIM Keymap,下拉列表中选择刚才新建的myVim。重启WebStorm,大功告成。

这时候再试一试ctrl+[,是不是已经可以从Insert Mode返回到Normal Mode了?

避免按Esc键的其他方法

有人觉得ctrl+[按起来麻烦,习惯用CapsLock或者JJ来模拟Esc,可以看一下http://vim.wikia.com/wiki/VimTip285

针对Windows用户的配置,请参考 http://vim.wikia.com/wiki/VimTip75

参考:http://www.cnblogs.com/dc10101/archive/2013/01/02/2841900.html

我把ctrl+d变成了delete line。

http://cssha.com/webstorm/?replytocom=

web storm使用和配置的更多相关文章

  1. Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架

    SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...

  2. javaWeb项目中Web.xml的基本配置

    这个地址写的非常好 ,欢迎大家访问 Å:http://www.cnblogs.com/hxsyl/p/3435412.html 一.理论准备 先说下我记得xml规则,必须有且只有一个根节点,大小写敏感 ...

  3. web.xml常用元素配置

    tomcat服务器: tomcat是一个WEB服务器,所有的j2ee WEB程序可以在此处运行. tomcat服务器是一个符合j2ee标准的WEB服务器.则J2ee的EJB程序无法在此处运行. 如果要 ...

  4. [转载]部署Office Web Apps Server并配置其与SharePoint 2013的集成

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  5. 部署Office Web Apps Server并配置其与SharePoint 2013的集成

    部署Office Web Apps Server并配置其与SharePoint 2013的集成   Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.P ...

  6. 在web.config里面添加配置信息

    在web.config里面添加配置信息规范文字 代码如下 在<appSettings>中间添加 <add key="Director" value="处 ...

  7. zabbix web场景模拟监控配置

    一,zabbix2.2.3 VMware Vsphere exsi监控配置步骤, 1,添加监控主机 2,添加聚集macro;{$PASSWORD} = yoodo.com{$URL} = http:/ ...

  8. Tomcat 配置WEB虚拟映射 及 配置虚拟主机

    Tomcat  配置WEB虚拟映射 及 配置虚拟主机 配置WEB虚拟映射文件夹有三种方法例如以下: 第一(要重新启动server的): 打开路径 Tomcat 6.0\conf 下的 server.x ...

  9. web.config文件中配置数据库连接的两种方式

    web.config文件中配置数据库连接的两种方式 标签: 数据库webconfig 2015-04-28 18:18 31590人阅读 评论(1)收藏举报    分类: 数据库(74)  在网站开发 ...

随机推荐

  1. 在.net中设置debug模式预设代码

    #region DEBUG #if DEBUG this.WorkOrgID.Value = "4DC4507E-434D-4EEB-967E-1E5CC28AA0C1"; thi ...

  2. 12天学好C语言——记录我的C语言学习之路(Day 1)

    12天学好C语言--记录我的C语言学习之路 Day 1: 刚刚入门C语言,那么肯定要先把什么是C语言和大家讲清楚,那么大家看下面一段程序(program  1.1): /*//program 1.1 ...

  3. C#中常用修饰符

    1.存取修饰符 public:(公有的)存取不受限制 protected:(受保护的)只有包含该成员的类以及派生类可以存取  private:(私有的)只有包含该成员的类可以使用 2.类修饰符 abs ...

  4. 谱曲软件-MuseScore

    谱曲软件-MuseScore 参考: 1.MuseScore官网 2.免费乐谱制作软体MuseScore

  5. 九度OJ 1207 质因数的个数

    题目地址:http://ac.jobdu.com/problem.php?pid=1207 题目描述: 求正整数N(N>1)的质因数的个数. 相同的质因数需要重复计算.如120=2*2*2*3* ...

  6. Newtonsoft.Json随手记

    private static Newtonsoft.Json.JsonSerializerSettings CreateSettings(string dateFormat) { Newtonsoft ...

  7. print neatly 整齐打印 算法导论

    作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree/p/4098562.html 题目链接:print neatly 整齐打印 算法导论 考虑在一个打印 ...

  8. Oracle 关于事物的描述

    事物在Oracle中的4种状态: commit--提交 rollback--全部回滚 savepoint name;--定义一个回滚到这里的点:例如:savepoint a; rollback to ...

  9. Linux查看目录挂载点

    用命令 df 即可 # df /var/lib/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 135979984 669 ...

  10. 最完美解决Nginx部署ThinkPHP项目的办法

    网上通用解决方法的配置如下: server { ... location / { index index.htm index.html index.php; #访问路径的文件不存在则重写URL转交给T ...