IDEA小技巧-同时编辑多行

idea

如果要实现在多行前面添加一样的内容,比如已知id的列表拼接sql

1 => select * from table where id=1
2 => select * from table where id=2
3 => select * from table where id=3
4 => select * from table where id=4
5 => select * from table where id=5
6 => select * from table where id=6
7 => select * from table where id=7
8 => select * from table where id=8
9 => select * from table where id=9

只要选中第一行你要开始编辑的地方,按住alt,然后按住鼠标开始向下拖动,会发现光标变长了,然后就输入你想要添加的内容就行啦,同理可以批量垂直选择文本批量修改

本文使用OpenWrite进行编写

你可能感兴趣的:(IDEA小技巧-同时编辑多行)