windows 搜索和替换:正确的快捷方式是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1420288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Search and replace: What's the proper shortcut?
提问by Wim ten Brink
Very simple dilemma. A user needs to be able to do a search-and-replace in a large piece of text. Code to do this is a piece of cake. No problems there. Works like a charm! Don't break your head over that. That's solved! It's a non-issue...
很简单的困境。用户需要能够在一大段文本中进行搜索和替换。执行此操作的代码是小菜一碟。没有问题。奇迹般有效!不要为此伤脑筋。这就解决了!这不是问题...
No, problem is defining a good shortcut for this function. While I would prefer to use CTRL+Ras shortcut for this functionality (and CTRL-Ffor finding text) I noticed that Microsoft is using CTRL-Has shortcut! (And F3to find text, although CTRL+Fmostly works too.)
不,问题是为这个函数定义一个好的快捷方式。虽然我更喜欢使用CTRL+R作为此功能的快捷方式(以及CTRL-F用于查找文本),但我注意到 Microsoft 正在使用CTRL-H作为快捷方式!(并F3查找文本,虽然CTRL+ 也F大多有效。)
So, what should be the preferred shortcut for this simple function? CTRL-Ror CTRL-H
那么,这个简单功能的首选快捷方式应该是什么?CTRL-R或CTRL-H
And second Q for additional points: Where does CTRL-Hcome from? What does the H mean? At least, the R stands for Replace but the H???
第二个 Q 附加点:从哪里CTRL-H来自?H是什么意思?至少,R 代表 Replace 而 H???
This relates to the GUI design of a Windows application. While it's a trivial matter, it's just good to be consistent with the generally accepted norm! While GUI's aren't always popular amongst programmers, keeping your GUI consistent with the norm is definitely programming-related!
这与 Windows 应用程序的 GUI 设计有关。虽然这是小事,但与普遍接受的规范保持一致就很好!虽然 GUI 并不总是在程序员中流行,但让您的 GUI 与规范保持一致绝对是与编程相关的!
采纳答案by Christian
While I also think that Ctrl+Ris the more "obvious" and "natural" choice for replace, I'd go for Ctrl+Hbecause of consistency reasons. If users are used to replace text by using Ctrl+H(e.g. because they use MS Word) then they'll be happy if it works in your app as well... however, if it won't work it will be a little pain because they have to change their habits.
虽然我也认为Ctrl+R是更“明显”和“自然”的替换选择,但出于一致性原因,我会选择Ctrl+ H。如果用户习惯于使用Ctrl+来替换文本H(例如因为他们使用 MS Word),那么如果它也适用于您的应用程序,他们会很高兴……但是,如果它不起作用,则会有点痛苦,因为他们必须改变习惯。
For searching I always use Ctrl+F. And if you don't need F3for any other purpose, just use that for searching as well. You're covered for both cases then :)
对于搜索,我总是使用Ctrl+ F。如果您不需要F3任何其他目的,也只需将其用于搜索。那么这两种情况都适用于您:)
Also see thisblog post by Joel.
另请参阅Joel 的这篇博文。
回答by SailorMD
I don't know when or who used Ctrl+Hfirst, but the reason is very simple: Ctrl+Ffind, Ctrl+G(the next key on QWERTY) for find next, and Ctrl+H(the next one) for replace.
我不知道何时或谁首先使用Ctrl+ H,但原因很简单: Ctrl+ Ffind,Ctrl+ G(QWERTY 上的下一个键)用于查找下一个,Ctrl+ H(下一个)用于替换。
The same happends with copy-paste, Ctrl+Chas a logical meaning, but Xfor cut and Vfor paste are the adjacent keys.
复制粘贴也会发生同样的情况,Ctrl+C具有逻辑含义,但X对于剪切和V粘贴是相邻的键。
I would rather use Hthan Rfor consistency. Ris also used to run scripts in some programs. And I have notice that most of the people don't use these shortcuts and won't try, Ctrl+Rbut the ones who are used to them may use Ctrl+Hor check it.
我宁愿使用而H不是R为了一致性。R也用于在某些程序中运行脚本。而且我注意到大多数人不使用这些快捷方式,并不会尝试,Ctrl+R但谁是用来他们可以使用那些Ctrl+H或检查。
回答by blowdart
CTRL+Ris part of the formatting shortcut keys in office, it right justifies the selected text or current paragraph. As this function is probably used more than search and replace it makes sense to give it CTRL+R
CTRL+R是office中格式化快捷键的一部分,它右对齐所选文本或当前段落。由于此功能可能不仅仅用于搜索和替换,因此给它CTRL+R
The MS UX guidelines(not that they stick to it themselves) has a keyboard sectionwhere they indicate that you should use the Windows OS shortcut keysto map to similar functions - so CTRL+Hit is.
在MS UX准则(不,他们坚持下去自己)有一个键盘部分,他们表明你应该使用Windows操作系统的快捷键映射到类似的功能-使CTRL+H它。
回答by AMissico
I think Ctrl+Hcame from WordPerfect. Or, maybe H for repHace :O) (I am serious.)
我认为Ctrl+H来自 WordPerfect。或者,也许 H 代表 repHace :O)(我是认真的。)
Stick with Ctrl+H. Most applications use Ctrl+H. Don't confuse your users. Don't force your users to remember one-off shortcut keys. Don't annoy your users. They will not remember or bother to remember or think it is a bug.
坚持Ctrl+ H。大多数应用程序使用Ctrl+ H。不要混淆你的用户。不要强迫您的用户记住一次性快捷键。不要惹恼你的用户。他们不会记住或费心去记住或认为这是一个错误。
回答by Mark Seemann
We not simply map the action to both shortcuts so that both Ctrl+Rand Ctrl+Hwill do the same?
我们不是简单地将动作映射到两个快捷方式,这样Ctrl+R和Ctrl+H都会做同样的事情吗?
Alternatively, you could make it a configurable option so that the user can decide which one they want to use.
或者,您可以将其设为可配置选项,以便用户可以决定要使用哪个选项。