Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
655 views
in Technique[技术] by (71.8m points)

sublimetext3 - Sublime - duplicate multiple whole lines, not just selection

The duplicate_line shortcut in sublime, only duplicate the selections, when select across multiple lines.

How to duplicate the whole lines?

For example, I select last 3 chars of line 1, and whole line 2, then first 2 chars of line 3.
Aka. 3 lines selected, how to duplicate the whole 3 lines, not just the chars selected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

"Duplicate lines" only duplicates what is selected (unless nothing is selected, in which case it duplicates the whole line). If you have lines partially selected, first do Selection → Expand Selection to Line (CtrlL on Windows/Linux, ?L on Mac) to make sure the entire lines are selected, then do "Duplicate Lines".

Please note that if the last line is already fully selected and the cursor is on the beginning of the next line, that next line will also get selected. I advise you to play around with different kinds of selections to get a feel for how "Expand Selection to Line" works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...