![]() If you don't like automatic code updates, it can be done manually with a keyboard shortcut. When the code gets messy, or we find duplicate parts, we tend to do refactoring. If the refactored code is used in many places, it can be an error-prone task. Webstorm helps us in this situation with its built-in refactoring capabilities. If the target is a variable, we can rename, extract, inline, or move it elsewhere with a single mouse click. Most of the time, we used to edit the code in one place where the cursor is waiting. There are occasions when we have to do the same editing in different places. The straightforward solution is to edit it in one place, copy it, and paste it to all the locations. The quicker way is to place the cursor to multiple locations by pressing the Alt key (⌥) and clicking the locations. The cursor appears at all the locations where we clicked, and typing happens where the cursors are.Ī particular case is when the places we want to edit are in the same column. ![]() #WEBSTORM MULTIPLE CURSORS CODE#Īt this point, we can switch to column selection mode: instead of lines, we can select columns and edit the code inside these columns.Ī third multiple-cursor use-case is when we select all the occurrences of the selected text (Edit > Find > Select All Accourences) and the typing/deletion happens everywhere. If you use a library and you want to know how that class/function behaves, you have to search and open that file. Webstorm makes this navigation a lot easier. Holding down the Command button (⌘) turns the cursor into definition revealing mode. ![]() If you hover an imported class/function, it shows its interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |