Sublime Text 2是否允许用户执行查找和替换(仅限于当前选择)?
我应该认为这是必须的,只有经过多次搜索才能找到执行该方法的方法。
Sublime Text 2是否允许用户执行查找和替换(仅限于当前选择)?
我应该认为这是必须的,只有经过多次搜索才能找到执行该方法的方法。
Answers:
ST2中有一个用于此的按钮。
如果您选择的内容包含换行符,则“在选择范围内”按钮将自动激活-在ST2上
不幸的是,智能激活已在ST3上丢失。您可以在此处进行后续操作http://www.sublimetext.com/forum/viewtopic.php?f=3&t=11679
这是您需要添加到用户键绑定中的内容:
{ "keys": ["alt+y"], "command": "toggle_in_selection", "context":
[
{ "key": "setting.is_widget", "operator": "equal", "operand": true }
]
},
是的,没有默认的键盘绑定设置是愚蠢的。
命令名称“ toggle_in_selection
”也没有记录,但我猜很幸运。
编辑添加:
/*
btw, the way i want to use find by default
(actually, i use replace by default, but same dif),
is for "in_selection" to be true by default,
*unless* the selection is empty.
(
the default is that "in_selection" is *false* by default,
unless the selection contains a newline.
)
i finally got around to digging up how to get that,
which is apparently by changing the *keybindings* you use to pop open the find(/replace) panel?
*/
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "replace", "in_selection": true}},
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "replace", "in_selection": false},
"context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true}
]
},
toggle_side_bar toggle_full_screen toggle_distraction_free toggle_overwrite toggle_record_macro toggle_setting toggle_comment toggle_case_sensitive toggle_regex toggle_whole_word toggle_preserve_case