Sublime text 3. How to edit multiple lines? [duplicate]

非 Y 不嫁゛ 提交于 2019-12-03 03:30:55

问题


I was using Notepad++ and now I want to use the same cool features in Sublime but I don't know how. I want to edit multiple lines at the same time like this:

But I don't want to Ctrl+Click at each line for this. I want to click at first line and click at last line for one vertical line.

How I can do this?


回答1:


Select multiple lines by clicking first line then holding shift and clicking last line. Then press:

CTRL+SHIFT+L

or on MAC: CMD+SHIFT+L (as per comments)

Alternatively you can select lines and go to SELECTION MENU >> SPLIT INTO LINES.

Now you can edit multiple lines, move cursors etc. for all selected lines.




回答2:


Use CTRL+D at each line and it will find the matching words and select them then you can use multiple cursors.

You can also use find to find all the occurrences and then it would be multiple cursors too.




回答3:


Thank you for all answers! I found it! It calls "Column selection (for Sublime)" and "Column Mode Editing (for Notepad++)" https://www.sublimetext.com/docs/3/column_selection.html



来源:https://stackoverflow.com/questions/39556514/sublime-text-3-how-to-edit-multiple-lines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!