Problem
If you copy and paste folded code in vscode or jetbrain IDEs, the code will expand automaticly. What you see is not what you get.
But sometimes we’d like to keep the code folded, we just need the skeleton. So how to do it?
Solution
Step1: Open your file by vscode
Step2: cmd + shift + p (mac) or ctrl+shift+p (windows) to open Command Palette, search and select Fold All
Step3: Toolbar -> Selection -> Column Selection Mode
Step4: Column select all the code, copy and paste, done!
check the gif https://cdn.liushiming.cn/img/2022-04-14_21-18-44.gif




Your article helped me a lot, is there any more related content? Thanks!
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://www.astrobotic.com/astrobotic-selects-spacex-falcon-heavy-rocket-for-griffin-viper-moon-mission/?unapproved=2421&moderation-hash=43b03f5901b9068341cfe99cf1a54b38#comment-2421