WebStorm is an Integrated Development Environment by JetBrains focused on JavaScript development.
- It comes with different web project templates out of the box
- It allows us to preview the current file in the browser. The list of available browsers is at the top right corner.
- Project Panel
- Editor Panel
- Navigation Bar
- Status: It allows to change encoding, read only, got line, git branch
- Tool Buttons:
- Project (Alt+1)
- Favorites (Alt+2): Shows the saved breakpoints or bookmarked code
- Find (Alt+3)
- Run (Alt+4): Shows the running processes (gulp, grunt, debug)
- Debug (Alt+5)
- TODO (Alt+6): Shows the lines marked with a TODO comment.
- Structure (Alt+7)
- Version Control (Alt+9)
- Event Log
- Grunt (Alt+F11)
- Gulp(Alt+F11)
- Terminal (Alt+F12)
- Window mode: it is separated to a new Window, useful for multiple monitors
- Floating mode: looks like a new window but in fact is still inside the main editor Window
- Docked: It sticks the panel to a position. It hides the panel once it loses focus if it's not pinned.
- Pinned: It pins the panel and prevents to hide it. It should be docked first.
The panels can be splitted to show more than one panel in the space.
- It shows the default terminal of the OS. It can be customized, go to: Settings/Tool/Terminal
- It supports tabs
- WebStorm allows to define the code style by language. Things like indentation, tab size, etc.
- Go to: Settings/Editor/Code Style
- It also allows to change the font scheme. Go to and save a custom scheme: Settings/Editor/Colors & Fonts
- To change the appearance go to: Settings/Editor/Appearance & Behavior
- WebStorm supports emmet which is a language for rapid html scaffolding
ctrl + alt + tto surround an element with a tag
Input the short name and hit tab
- Go to Settings/Editor/Live Templates to check the available templates
- Use
$variable_name$to create placeholders for variables in your Live Template $END$to stablish the cursor after finishing the inputs$SELECTION$wrap some piece of selected code with the template- Click on edit variables to define expressions or default values for the variables
- It allows what files to include in the project list.
- It allows to use conditions like expressions
- Go to Settings/Appearance & Behavior/Scopes to define the scope and add files to your list
- Mark directories as test, root, etc
Allows to have a debug session in a browser (Chrome) to edit the code and see the changes in real time
- First install the Chrome Extension: https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji
- Configure the debugger: Go to Run/Edit Configuration... and add a debugger
- Surround with
ctrl + shift + t - Refactor: select the snippet and hit
ctrl + shift + alt + t ctrl + bto go to a function declarationalt + F7to do the reverse and find usages of a function
- Type
/**above a function to document it- Hold
ctrlwhile hovering over a function
- Hold
- Then you can hit
ctrl + qto show the documentation
WebStorm allows to work with preprocessors like Stylus and Sass and MetaLanguages like TypeScript
- Using preprocessors:
- Install the preprocessor globally with npm
npm install stylus -g - Add a watcher: Settings/Tools/File Watchers
- Install the preprocessor globally with npm
alt + enterselect edit fragment to edit the injected code- It will also allow to check regular expressions. First insert regex and then
alt + enteragain and select check regex. A small popup will appear to help us to check it.
- Set the server port: go to Settings/Build, Execution, Deployment/Debugger
- Go to Run/Edit Configurations to add a javascript debugging session
- Hit
shift + F9to start the debugging - Set a breakpoint on the left of the line
- Right click on it to set a condition
- Debugging TypeScript works the same as normal JavaScript
- Debugger
- Frames: A list of the functions that got us to this point
- Variables: A tree view of the variables in the scope. We can even change the values here in real time.
- Watches: to interrogate variables. It also allows to evaluate expressions.
- hover over a variable and click on "+"
- right click on the variable and "Add to the watches"
- simply click on the "+" button on the Watches tab
- It has several steppers for easy debugging
- Console
- Structure
- When there is no local store of a library we can download it.
ctrl + enteron the src to get it. - To add Node to an existing project just add a debug configuration to the project.
- To add code completion right click anywhere on the editor and click "Use JavaScript Library". Select the library.
- To add intellisense go to Settings/Languages & Frameworks/Node and NPM, click "Configure..."
- The packages section can be used to replace NPM
WebStorm allow to test REST services directly : Go to Tools/Test RESTful service
Webstorm can deploy projects directly: Go to Tools/Deployment
- It is like a local repo of the project
- It allows to put a tag in order to revert to a previous state
Gulps integrates deeply with gulp. It even allows debugging gulp tasks.
- If no git repo is initialized, you can go to VCS/Import Version Control/Create Git Repo
- Git has a git manager integrated. It allows to view the branching history directly. (
alt+9) ctrl + tto update the projectctrl + kto commit and push changes
Webstorm allows to create gists directly. Select your snippet, right click on it and select "Create Gist"
- gitignore
- material ui
- markdown
You can define your own shortcuts. Go to Settings/KeyMap.
ctrl + shift + ato find an action or a shortcutctrl + alt + sto open the settingsctrl + alt + Lto reformat the codectrl + spaceto pop up instellisense and look for the files in the current root.- Paths:
ctrl + spaceIf we do it twice it looks for the files in the entire project. - Multi Selection: place the cursor somewhere, hold
altand drag the cursor- or hold
altand click on multiple places - or
ctrl + jto select the next occurrence
- or hold
F6to refactor/rename an elementctrl + shift + nto open a filealt + enterto create a file that doesn't existshift ~ shiftto show recent files