I have a snippet of code I copied into my clipboard. Pasting it out looks like this. Where[tab] is an actual tab indent
[tab]<header id="masthead" class="site-header">
[tab][tab]<h1>
[tab][tab][tab]<h2>
[tab][tab][tab][tab]<h3>
[tab][tab][tab][tab][tab]<h4>;
I want to press an autohotkey to automatically normalize the code snippet. So if there's a [tab] on every line, remove it. Then convert each [tab] into 2 spaces [**]
<header id="masthead" class="site-header">
**<h1>
****<h2>
******<h3>
********<h4>;
So the general workflow is:
- Copy code to clipboard
- Press an autohotkey
- Paste the newly formatted contents
Pseudocode for autohotkey would look like this
- Dig through every clipboard content line by line
- If every item shares an equal number of [tab] spaces, remove them entirely
- Line by line, convert [tab] to [**] 2 spaces
https://autohotkey.com/docs/commands/StringReplace.htm
okay problem solved I have everything I want now. I took the other source code snippet here on autohotkey forum
As a reference, need to highlight the full line on code snippet like so
So all I have to do now is: