I have an HTML file that has around 700 of my bookmarks. Each line has link and a tag like the following:
<li><a href="https://www.bartleby.com/141/" time_added="1547558810" tags="paper_writing">Strunk, William, Jr. 1918. The Elements of Style</a></li>
The file has multiple lines with the same tags. I want to group the lines with the same tag next to each other. I was trying to do it in vscode. I can select multiple occurrences of the same phrase with Ctrl+Shift+L
, but I could not select the lines. Is there a way for doing this?
Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.
Use Ctrl + D to use multi word edit of same words in Windows and Linux. Use CMD + D for Mac.
Ctrl + Shift + L to select all occurrences of current selection. Save this answer.
After your comment below that clarified what you are trying to do I think you will find this easier than your solution.
Select All Occurrences of Find Match
- if that is bound to something else on your OS, use that.Expand Line Selection
- again find that command in your Keyboard Shortcuts
and use the same command.There is also an extension vscode-dup-checker that will find and delete duplicate lines. I don't know if you actually want to delete the duplicates though.
I added a gif to show it in action - it only uses steps 1-4 above:
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