標籤:des style blog http color java 使用 os
官網: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.
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項,如:
接下來看:http://www.cnblogs.com/dc10101/archive/2013/01/02/2841900.html
http://cssha.com/webstorm/?replytocom=