Sublime Text 3(windows) 中的边界敏感 Ctrl+D [英] Boundary sensitive Ctrl+D in Sublime Text 3(windows)

查看:17
本文介绍了Sublime Text 3(windows) 中的边界敏感 Ctrl+D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 ) 在 Windows 7 上.该行为在 OS X 和 Linux 以及其他版本上完全相同.

首先,我们输入文本并将光标放在字符串中第一个单词的任意位置,es:

test 'es cookie set on .test' do# ^^^ 任何地方

它可以在 e 之前,es 之间,或者 s 之后 -没关系.

接下来,无需双击,点击 CtrlD,这将选择 es 并突出显示单词的其他实例.

现在,再按两次 CtrlD,只会选择 esindividual 实例,不是包含在其他词中的那些,例如 test:

<小时>

现在,如果您要双击或以其他方式选择 es 的第一个实例并多次点击 CtrlD,这将结果:

es 的每个 实例都会被选中,即使在另一个词中,例如 testcookies.

我所描述的是 Sublime Text 在所有平台(包括 Windows)上的默认行为.如果您将光标放在一个单词上并按 CtrlD,则应选择整个单词.如果没有发生这种情况,则说明按键绑定已被某个插件或您的用户按键绑定文件以某种方式更改了.

I have same requirement with maček

I borrow maček's example here:

my code pic1:

I select the first instance of es and see this (using cursor select)

pic2:

Perfect! However, when I tap ctrl + D a couple times, it will end up selecting this

pic3:

The answer from Taylan says

If you put your cursor (caret) on the word but not select it and then press Cmd + d it is going to select like in 2nd image.

Quite confusing. In windows, there is always a input cursor(a flashing vertical line, maybe call as caret) in sublime, Without selecting any thing type ctrl + D would select the char nearby the input cursor. Can't not get the result as pic2

解决方案

The following is from Sublime Text 3 (Build 3095) on Windows 7. The behavior is exactly the same on OS X and Linux, and on other builds.

First, we enter the text and place the cursor anywhere by the first word in the string, es:

test 'es cookie set on .test' do
#    ^^^ anywhere here

It can be before the e, between the e and the s, or after the s - it doesn't matter.

Next, without double-clicking, hit CtrlD, which selects es and highlights the other instances of the word.

Now, hit CtrlD twice more, and only the individual instances of es will be selected, not those that are contained within other words, such as test:


Now, if you were to double-click or otherwise select the first instance of es and hit CtrlD several times, this would be the result:

Every instance of es will be selected, even when within another word such as test or cookies.

What I've described is the default behavior of Sublime Text on all platforms, including Windows. If you put your cursor in a word and hit CtrlD, the whole word should be selected. If that does not happen, then somehow the key binding has been changed, either by a plugin or in your user keybindings file.

这篇关于Sublime Text 3(windows) 中的边界敏感 Ctrl+D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆