vs code实现sublime text的同时多行选中和编辑

vs code也有类似sublime text的多行同时编辑的功能,通常按住鼠标中键即可进行多行选择,还可以结合home和end键进行更加灵活的调整。(键盘命令ctrl+alt,再按上下方向键,或者shift+alt结合鼠标选择)

此外,sublime text有一个非常好用的功能就是在查找时,同时选中(find all)所有匹配的字符串对象,然后可以对这个字符串本身,或者是它们所在的行的其它对象进行同时编辑。vs code的查找默认看不到这个选项,ctrl+f时一次只能选中一个对象,即使replace all也不会同时把光标添加到每个对象位置。但实际上vs code具有这样的能力,有两种方式:选中需要查找的对象,1,ctrl+shift+L;2,ctrl+f,然后按alt+enter。

参考:

https://github.com/Microsoft/vscode/issues/14030

 

sublime代码行统计

 

Menu > Find > Find in files…

Then turn on regular expression search (regex) and use the following values:
Find: ^(.*)$
Where: /Your/Project/Directory,*.less,*.js,*.php

Remember to NOT click on the Replace button, as it removes all lines. 

Then press search. If you scroll to the bottom, you get something like “30036 matches across 282 files” That means, 30036 lines in 282 code files.

https://forum.sublimetext.com/t/count-lines-in-a-project/6554

 

sublime ubuntu鼠标中键多行选择,类似windows:

https://superuser.com/questions/923857/change-middle-mouse-button-in-sublime-text

You need to create a custom mouse map in Linux and add the relevant bindings that define the Windows behavior. In Sublime, create a new file with JSON syntax and the following contents:

[
    // Mouse 3 column select
    {
        "button": "button3",
        "press_command": "drag_select",
        "press_args": {"by": "columns"}
    },
]

Then, save the file as ~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-mousemap, You should now be able to mimic the Windows middle mouse functionality in Linux.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Luchang-Li

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值