mess up indent when paste clipboard content in Putty

Finally I found a good solution. It was really frustrating when we copy xml file content from Notepad or Notepad++ and paste it into Putty. You will see each and every line is messed up you have paste in putty. Till the time I got the solution, I used to indent it manually. See below screenshot, the lines are not indent when I paste content of xml file into remote terminal in Putty.


Now I followed below steps to make it indent properly.

Step1 : Paste content in putty wherever you want. You will see content is not indented.


Step2: Now press Esc to go out of "Insert" mode in Putty. Now press "gg" to go to beginning of file in Putty.
Step3: Now press "=".
Step4: Now press Shift+g.

Done.

It should indent all lines as shown in below screen.



No comments:

Post a Comment