ExpandRegion for Sublime Text:快速选择文本
2016-07-30 15:56
267 查看
有没有特别羡慕WebStorm上的CTRL+W快捷键,通过它可以迅速的选择光标下的文本,多按几次可以逐渐扩大选择的区域,这在编辑文本的时候简直太方便了。Vim也有类似的概念,在Vim中叫文本对象(text object),可以快速选择不同大小的文本对象。
在Sublime Text中虽然也有选择文本的快捷键,但是不够好用,直到有一天遇到这个插件:sublime-expand-region,一切的烦恼都消失了。
Like "Expand Selection to Scope". But better!
ExpandRegion works a bit like the build in "Expand Selection to Scope", however it does not depend on Scopes (Scopes are used by ST to "understand" code, i.e. for syntax highlighting). Therefore selection expansion can be more granular and customizable.
It works similar to ExpandRegion for Emacs and "Structural Selection" (Control-W) in the JetBrains IDE's (i.e. IntelliJ IDEA).
安装方法就不说了,一是上面的链接说到怎么安装了,另外用SublimeText的人大概也都知道怎么安装插件。所以这里就不罗嗦了。
这里只说一下我配置的快捷键。光安装还不能使用,得自定义两个快捷键,一个用于扩大选区,一个用于减小选区。
以上快捷键定义适用于Windows、Linux、macOS
下面是几个效果图:
在Sublime Text中虽然也有选择文本的快捷键,但是不够好用,直到有一天遇到这个插件:sublime-expand-region,一切的烦恼都消失了。
Like "Expand Selection to Scope". But better!
ExpandRegion works a bit like the build in "Expand Selection to Scope", however it does not depend on Scopes (Scopes are used by ST to "understand" code, i.e. for syntax highlighting). Therefore selection expansion can be more granular and customizable.
It works similar to ExpandRegion for Emacs and "Structural Selection" (Control-W) in the JetBrains IDE's (i.e. IntelliJ IDEA).
安装方法就不说了,一是上面的链接说到怎么安装了,另外用SublimeText的人大概也都知道怎么安装插件。所以这里就不罗嗦了。
这里只说一下我配置的快捷键。光安装还不能使用,得自定义两个快捷键,一个用于扩大选区,一个用于减小选区。
{ "keys": ["alt+up"], "command": "expand_region" }, { "keys": ["alt+down"], "command": "expand_region", "args": {"undo": true}, "context": [{ "key": "expand_region_soft_undo" }] },
以上快捷键定义适用于Windows、Linux、macOS
下面是几个效果图:
JavaScript (should also work for other c'ish languages like Java).
Python
HTML
相关文章推荐
- ICSharpCode.TextEditor设置选择的文本
- OS X LION开启Quicklook(空格快速预览)选择文本功能
- A Set of HTML Snippets for Sublime Text 2
- 【转】3 Essential Sublime Text Plugins for Node & JavaScript Developers
- 【android】TextView文本的 “选择文字”“复制” “粘贴” 功能的实现
- JFormattedTextField组件的文本选择问题
- 源码(2.2):Coretext文本选择简易阅读器,类似twitter的导航栏
- Custom Sublime Text Build Systems For Popular Tools And Languages
- Using the AngularJS Package for Sublime Text
- Provides PHP completions for Sublime Text
- ICSharpCode.TextEditor设置选择的文本
- SmartMarkdown for Sublime Text 2
- Create a Sidebar launcher for Sublime Text 2 in...
- Custom & Eclipse shortcuts key bindings for Sublime Text 2
- 文档管理,文本编辑控件,网页Word控件,TX Text Control .NET for WPF
- ArcGIS For JavaScript API Show loading ico/text(加载时显示图标/文本)————(十一)
- How to install Zen Coding for Sublime Text 2?
- android] TextView文本的 “选择文字”“复制” “
- Plugins for Sublime Text 2
- 批量去掉或替换文本中的换行符(notepad++、sublime text2)