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

Categories

0 votes
728 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...