Switching from WebStorm to Cursor (VS Code)
I think many people are aware that JetBrains stopped selling their products in Russia, but it is worth paying tribute to them that they retained perpetual licenses for the version of the product that was in use at that time. Not cool, of course, but for a long time I didn’t care about this moment. Yes, it’s not the latest software, but you don’t have to pay either. However, recently on one of the projects I needed to switch to Vite and Vitest. And at that moment I realized how important it is for me to run tests from the IDE. It turned out that my version of WebStorm does not support Vitest.
And then a question arose before me. Is it time to get yourself a foreign bank card for this or come up with something else? And in general, we should have a tool to bypass such problems a long time ago, but I really don’t like the idea of paying someone who creates problems for me, provided that there are affordable and good alternatives.
As you probably understand, today there will be a story about how I changed religion IDE, making the transition from WebStorm to Cursor (VS Code).
To be honest, I was very embarrassed about this transition because I knew it could be hard and it was hard. But Cursor's main feature made this transition more enjoyable. When you register, you are given a two-week trial period of the Pro version, which includes an AI assistant, which, by the way, works without a VPN, which I really like. Overall, it helped me compensate for the time it took me to get used to the new IDE. Also support and tips from my participants channel in telegram was also extremely useful, so subscribe if you haven’t already.
I will build my story as a listing of the features that I used in WebStorm, and a corresponding listing of how to implement it in Cursor. Let's go!
Content
Keyboard & short cuts
When installing Cursor, you are asked to choose which key binding is convenient for you, in my case, of course, JetBrains:
![Selecting a key binding when installing Cursor Selecting a key binding when installing Cursor](https://habrastorage.org/getpro/habr/upload_files/3ea/4a9/8b6/3ea4a98b61d2b3e2e80c661b3e7b192b.png)
But this, unfortunately, was not enough and I also installed the extension IntelliJ IDEA Keybindnigs. To install any extension, go to the “Extensions” section using the View: Extensions menu, the ⇧⌘X key combination, or simply click on the corresponding icon on the menu:
![Selecting a window to work with extensions Selecting a window to work with extensions](https://habrastorage.org/getpro/habr/upload_files/d8a/b5e/323/d8ab5e32335a912b60d268025806a5d1.png)
Next, use the search field and install the extension you find. I hope no one will have any problems with this. After installing any extension, I recommend restarting Cursor, and to do this:
Open the IDE command line using the command ⌘⇧P;
Find “Reload Window” in the search field and select it.
EditorConfig
In WebStorm you can simply specify a configuration file and everything will work out of the box. You need to add an extension to Cursor EditorConfig for Visual Studio Code. No additional configuration is required, just restart the IDE.
Prettier
Just like in WebStorm, for code auto-correction to work, you need to install the extension Prettier and configure it:
Open the IDE command line using the command ⌘⇧P;
Type “open settings” and select “Open User Settings (JSON)”;
Next, in the open JSON file, add the following:
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"workbench.settings.applyToAllProfiles": ["prettier.useEditorConfig"]
It’s convenient for me when auto-correction occurs when saving, but if this does not suit you, then delete the first line. Also, if you do not use editorConfig, then remove the third line.
Don't forget to restart the IDE.
By the way, you can see what settings Prettier uses and the work log by clicking on the link in the lower right corner of Cursor:
![Conclusion of Prettier's work Conclusion of Prettier's work](https://habrastorage.org/getpro/habr/upload_files/007/179/db6/007179db6dfe1ecc17504b136d8276b9.png)
Eslint
In WebStorm, as far as I remember, Eslint came out of the box, and in Cursor you also need to install the appropriate extension. The installation and configuration process is already familiar to you, so I will only indicate the fields that need to be entered into the User Settings (JSON):
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
]
Jest
Just like Eslint, Jest in WebStorm works out of the box, and in Cursor everything also needs to be installed accordingly extension. Here, no additional setup was required at the beginning. However, this extension was running all the tests for every sneeze, so I added the following to the User Settings (JSON):
"jest.runMode": "deferred"
After installing this extension, it becomes possible to run tests directly from a file, just like in WebStorm:
![Running tests from a file in Cursor Running tests from a file in Cursor](https://habrastorage.org/getpro/habr/upload_files/154/d01/c31/154d01c316501d61eac5f23019aec89b.png)
Vitest
My entire move to Cursor and this article is motivated by this testing framework. In newer versions of WebStorm it also comes from boxes. And in Cursor, as usual, we already install the extension Vitest. The process is the same and no additional configuration was required.
NPM Scripts
In WebStorm it is very convenient to run scripts from the corresponding section:
![NPM section in WebStorm NPM section in WebStorm](https://habrastorage.org/getpro/habr/upload_files/ec3/352/19a/ec335219a187d617dfcef0154a4282f4.png)
If you suddenly closed the npm section in WebStorm, then open package.json, right-click and select “Show npm Scripts”.
I spent a long time looking for a similar window in Cursor, but by default it wasn’t there either. I had to try a number of extensions and I settled on this. It is as similar as possible and is located almost in the same place in the lower left corner:
![NPM section in Cursor NPM section in Cursor](https://habrastorage.org/getpro/habr/upload_files/8ac/860/3e8/8ac8603e8bed118e2261484bfc6083aa.png)
In fact, it turned out to be even more convenient. In WebStorm, all these scripts were launched in the appropriate environment and some of them conflicted. For example, when I ran a script with tests, and some of them crashed, then after editing one, I ran the test from a file as usual, which destroyed the results of the previous running process, that is, running tests according to the script. When running a script from an extension in Cursor, a separate process always opens.
Go to package
Over the past couple of years, I've often worked with npm dependencies. If you open package.json in WebStorm, you can place the cursor on the package of interest and use “go to” short cut (⌘P), which will take you to the package directory in node_modules.
![Go to npm package in Webstorm Go to npm package in Webstorm](https://habrastorage.org/getpro/habr/upload_files/fcc/29d/efc/fcc29defc58ea180b5d4be85d29040c6.gif)
As it turns out, this functionality is not in demand among VS Code (Cursor) users. I couldn't google any solution, but my colleague found an extension Goto Package.
This extension does not move you to the appropriate directory in node_modules, but it can immediately open the package.json of the package, which is generally what I always needed.
![Go to npm package in Cursor Go to npm package in Cursor](https://habrastorage.org/getpro/habr/upload_files/1ee/2df/463/1ee2df463b8503a37602eba21816c4ad.gif)
Code snippets
With the spread of AI, IDE snippets will most likely gradually fade into secondary roles, but for now I use them often. Therefore, it was important for me to understand how to create and use them in Cursor. In general, the process is similar to WebStorm:
Open the IDE command line using the command ⌘⇧P;
Find and select “Configure User Snippets” and then select “New Global Snippets file”;
Write snippets like this:
"Create React Functional Component With Interface": {
"scope": "typescriptreact",
"prefix": "rfcw",
"body": [
"import * as React from 'react';",
"",
"export interface IComponent {}",
"",
"export const Component: React.FC<IComponent> = (props) => {"
" const {} = props;"
"",
" return <></>;",
"};"
],
"description": "Create React Functional Component With Interface"
}
Next, just type the prefix in any file, and the IDE will prompt you to expand the corresponding snippet.
Git
It was painful to get used to working with Git. In general, this topic is worth a separate article and in-depth study, so today I’ll go over the top:
Annotations
WebStorm has excellent annotation functionality that allows you to quickly determine who made the changes and within what task:
![Annotations in Webstorm Annotations in Webstorm](https://habrastorage.org/getpro/habr/upload_files/4d1/96d/5a6/4d196d5a61aab706ae5cce1dc118a820.png)
There is no such thing in Cursor. Everything can be solved by expansion GitLens is a very powerful tool that provides many possibilities. It also has paid functionality, but I didn’t use it. To be honest, I would like to get used to free stuff first.
After installation, annotations appeared that can be obtained by hovering, which is convenient:
![Annotations in Cursor Annotations in Cursor](https://habrastorage.org/getpro/habr/upload_files/bc6/064/5f8/bc60645f82f9f0159e16de5b8fdc0284.png)
Conflict resolution
It is worth noting that it will take a long time to get used to resolving conflicts. I don’t know if it’s just a matter of habit, but it seems like working with Git in WebStorm is implemented better and more convenient. Let's see what it looks like in WebStorm:
![Resolving conflicts in WebStorm Resolving conflicts in WebStorm](https://habrastorage.org/getpro/habr/upload_files/d05/d95/c2f/d05d95c2feff0af2dccb3d66c17e52e2.png)
And now in Cursor:
![Resolving Conflicts in Cursor Resolving Conflicts in Cursor](https://habrastorage.org/getpro/habr/upload_files/826/c88/849/826c888490b2ff61e0192bc892270bfc.png)
In this case, this more or less familiar view must be enabled separately in the user settings:
"git.mergeEditor": true
I also added the following setting to quickly navigate through conflicts:
"merge-conflict.autoNavigateNextConflict.enabled": true
If you generally look at the two screenshots above, you can see that in the Cursor Merge Editor it takes on a lot and immediately merges non-conflicting lines, which at certain moments can shoot you in the foot if we are talking about a complex rebase.
View history
Viewing the commit history is also, in my opinion, more convenient in WebStorm. Just right-click inside the file, find Git and open the history:
![Viewing commit history in WebStorm Viewing commit history in WebStorm](https://habrastorage.org/getpro/habr/upload_files/848/13b/7e7/84813b7e7be4a2b4f91975fa159421e9.png)
In Cursor the procedure is similar, you also click inside the file and find the file history:
![View commit history in Cursor View commit history in Cursor](https://habrastorage.org/getpro/habr/upload_files/a41/072/3a2/a410723a201b47d4cacafeccc810973f.png)
However, the interface, in my opinion, is overloaded. But maybe it's a matter of habit.
Sorting
I like things to be sorted alphabetically, so I used the String Manipulation plugin in WebStorm. There is a similar extension for Cursor Alphabetical Sorter. There's not much to add here. Both work great. The main thing is to tie the same key combinations. This can be done by opening the IDE command line using the command ⌘⇧P, where you will need to search for “Keyboard Shortcuts”.
Tabs
I also love how tabs in the editor open in multiple lines. It’s inconvenient for me when I have to scroll through tabs in one line. To do this, you need to add the following to the user settings:
"workbench.editor.wrapTabs": true
Results
After looking through the article, I got the impression that Cursor needs to be constantly improved in order to get the functionality of WebStorm. Yes it is. However, Cursor works much faster, probably because it is lighter, or maybe because I have a 21-year-old version of WebStorm. I cannot say objectively.
There are also a number of disadvantages that seem to take some getting used to:
There is no way to set multiple cursors by holding RMB + alt. You have to set one for each click. Although perhaps I just haven't figured out how to do it yet;
Does not import dependencies when copying;
Does not offer to rename the file when copying;
It is not convenient to work with changes; there is no way to copy the old version from the window with changes, you can only roll back.
And here are my full custom settings:
{
"editor.codeActionsOnSave": { "source.fixAll": "explicit" },
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"files.autoSave": "onFocusChange",
"git.mergeEditor": true,
"jest.runMode": "deferred",
"merge-conflict.autoNavigateNextConflict.enabled": true,
"npm.scriptExplorerAction": "run",
"window.commandCenter": true,
"workbench.editor.wrapTabs": true,
"workbench.settings.applyToAllProfiles": ["prettier.useEditorConfig"]
}
Thank you everyone for your time!