I have ~150 files that I need to remove the jQuery import from, as we have Webpack importing it automatically.
How can I achieve this with find and replace in vscode? I would like to remove a single line from each file and have the rest of the code shift up a line. I have the below regex, however, I'm not sure what I need to put in the replace field to remove the line.
In order to quickly delete a line in VSCode, you can simply press Ctrl+Shift+K keyboard combination while the cursor is being placed in the desired line. The hotkey can be changed by modifying editor.
Ctrl + L on Windows or Command + L on Mac to select the whole line in VS Code.
Ctrl + Shift + K for delete line. You can also fire the replace with an empty field, instead of using a keyboard combination. It works fine also.
Try add \n
to your search regex and replace with empty string.
In your case:
^import \$ from 'jquery';$\n
Update: November 2018 (version 1.30)
Multiline search input
Last month, we added support for multiline search. This month we improved the search UX to make it easier to use. Now, you can search with multiline text without having to write a regular expression. Type Shift+Enter in the search box to insert a newline, and the search box will grow to show your full multiline query. You can also copy and paste a multiline selection from the editor into the search box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With