有哪些有用的 TextMate 快捷键?
Mac 因拥有大量快捷方式而闻名(或令人遗憾)。 然而,与 TextMate 及其捆绑包中的快捷方式列表相比,OS X 本身就相形见绌了。
您使用哪些有用的键盘快捷键?
Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in TextMate and its bundles.
What are some useful keyboard shortcuts you use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(30)
大写所选文本: CONTROL + SHIFT + U
将变为:
进入:
Upcase selected text: CONTROL + SHIFT + U
Will turn:
Into:
您可以在此处获得非常棒的桌面背景。 它有大量非常有用的键盘快捷键。 我用了几天才记住最有用的。
You can get a really great desktop background here. It has a ton of really useful keyboard shortcuts. I used it for a couple of days before memorizing the most useful ones.
将所选文本包含在标记标签中: SHIFT + CONTROL + W
例如,如果您:
突出显示文本并按 SHIFT< /kbd> + CONTROL + W 创建:
Wrap selected text in markup tags: SHIFT + CONTROL + W
For example, if you have:
Highlight the text and press SHIFT + CONTROL + W to create:
转到文件:⌘ + T
在项目中查找:⌘ + SHIFT + F
Go to File: ⌘ + T
Find in Project: ⌘ + SHIFT + F
消除插入符号位置和下一段内容开头之间的所有空格/回车符: SHIFT + CONTROL + J
例如, 如果你有:
将插入符号放在第一段的末尾,然后按 SHIFT + CONTROL + J 删除段落之间的空格:
Eliminate all whitespace / carriage returns between the location of your caret and the start of the next piece of content: SHIFT + CONTROL + J
For example, if you have:
Place your caret at the end of the first paragraph and press SHIFT + CONTROL + J to remove the space in between the paragraphs:
(这些大多与html相关)
\n
或
,具体取决于场合。(these are mostly html-related)
\n
or<br>
depending on the occasion.复制并粘贴剪贴板:⌘ + SHIFT + V
Copy and Paste Clipboard: ⌘ + SHIFT + V
为所选文本添加标题: CONTROL + OPTION + U
将变为:
进入:
Titleize selected text: CONTROL + OPTION + U
Will turn:
Into:
小写所选文本:CONTROL + SHIFT + U
将变为:
进入:
Downcase selected text: CONTROL + SHIFT + U
Will turn:
Into:
关闭最近的打开 html/xml 标记: OPTION + COMMAND + PERIOD
例如,如果您有:
CONTROL + COMMAND + D 将自动添加结束
标签来创建:
Close the nearest open html/xml tag: OPTION + COMMAND + PERIOD
For example, if you have:
CONTROL + COMMAND + D will automatically add the closing
</div>
tag to create:在选项卡之间切换:
Switch between tabs:
在 cftextmate 包中,您可以键入任何 cfml 标签,而无需打开“<” 或关闭“>” 并按 Tab 键即可完成整个标签,然后您可以按 Tab 键切换到每个标签属性。 我不确定这种类型的快捷方式是否适用于其他语言。
in the cftextmate bundle you can type any cfml tag without the opening "<" or closing ">" and press tab and it completes the entire tag and you can then tab to each of the tag attributes. i'm not sure if this type of shortcut works for other languages.
我刚刚在 Bundles > 下找到了带有定义的快捷键符号列表。 HTML > 实体 - 有助于我弄清楚 TextMate 的整个捷径财富。
I just found a list of shortcut key symbols w/ definitions under Bundles > HTML > Entities - helpful for me in figuring out the whole short-cut bonanza going on with TextMate.
查找 W3C 中的属性规范: CONTROL + H
这适用于 HTML 和 CSS。 将胡萝卜放在您想要查找的任何属性上,然后按 CONTROL + h。 这将打开一个新窗口,列出 W3C 信息。
例如,将胡萝卜放在背景上:
点击 command + h,您将看到类似以下内容的内容:
Look up property specifications in W3C: CONTROL + H
This works for both HTML and CSS. Place your carrot over whatever property you'd like to look up and press CONTROL + h. This will open a new window listing the W3C info.
For example, place your carrot over background:
Hit command + h and you'll see something like:
CMD + / 注释掉一行,它足够智能,可以根据语言进行格式化。 我用它所有的时间。
CMD + / comments out a line and it's smart enough to format based on language. I use it all the time.
在
{}
和do
end
块之间切换。 将光标放在块参数上(即两个管道之间关键字do
后面的单词),然后按 Shift + Control + {例如,将:转换
为:
Toggle between
{}
anddo
end
blocks. Place your cursor on the block arugument (i.e. the word after the keyworddo
between the two pipes) and press Shift + Control + {For example, converts:
to:
同时编辑多个选定行的末尾:COMMAND + OPTION + A
Edit the end of multiple selected lines simultaneously : COMMAND + OPTION + A
使用 alt 选择文本(通过单击并拖动),
然后使用 ⌘ + ] 缩进(或 [ 缩进) )
Selecting text using alt (via click and drag)
then use ⌘ + ] to indent (or [ to dedent)
删除当前行:CONTROL + SHIFT + K
Delete the current line: CONTROL + SHIFT + K
设置 CSS 格式: CONTROL + Q
选择一些 CSS,然后按 CONTROL + Q 将其变为
:
Format CSS: CONTROL + Q
Select some CSS and press CONTROL + Q to turn this:
Into this:
就我个人而言,我最喜欢的两个快捷键是:
它们对于编写文本和博客(以及 stackoverflow)都非常有用。
从代码角度来看,我认为我更喜欢片段而不是快捷键。 能够用几乎任何语言输入
if⇥
等都非常有用,并且一致的界面是我继续使用 TextMate 的原因。我还发现这非常有趣。 但我更喜欢小步学习快捷键,并且经常发现只需查看齿轮菜单 (⌃⎋) 就可以了。
Personally two of my favourite shortcuts are:
The are both super useful for writing text and blogging, (and stackoverflow).
Codewise, I think that I prefer snippets to key shortcuts. Being able to type
if⇥
etc., in almost any language is ridiculously useful, and the consistent interface is what keeps me using TextMate.I also found this quite amusing. But I prefer to learn my shortcuts in small steps, and often find that just looking in the gear menu (⌃⎋) works.
我最喜欢的是:
My favourites are:
Control-T(ControlT):转置(适用于大多数 Cocoa 原生文本字段和区域,但TextMate 增强了行为)。
将插入符号放在两个字符之间,按 ControlT,字符会交换位置(这是标准的 Mac 行为)。 非常适合拼写错误。
在一行上选择一个单词或一系列字符,点击ControlT,选择的字符现在将被反转(不太有用,但这是 TextMate 增强功能)
选择一系列跨越多行的字符,点击 ControlT,行将反转。 行内的字符仍将按顺序排列。 在选择整行时最有用,但仍然适用于选定的部分行,只要至少选择一个换行符(TextMate 增强功能)即可。
Control-T(ControlT): Transpose (works in most Cocoa-native text fields and areas, but TextMate enhances the behavior).
Place your caret between two characters, hit ControlT, and the characters switch places (this is standard Mac behavior). Awesome for typos.
Select a word or series of characters on a single line, hit ControlT, and the characters in the selection will now be reversed (not too useful, but this is a TextMate enhancement)
Select a series of characters that spans more than one line, hit ControlT, and the lines will reverse. Characters within the line will still be in order. Most useful when selecting whole lines, but still works with partial lines selected, just so long as there is at least one newline character selected (TextMate enhancement).
这些是我最喜欢的快捷键:
These are my favorite shortcuts:
Esc 自动完成您正在处理的文档中的常用单词。
例如,如果您正在使用一个名为
LongFuntionNameThatChecksStuff
的函数,您可以键入Lon
然后按Esc,它应该会自动完成。Esc auto completes common words in the document you are working in.
For example if you are using a function alot called
LongFuntionNameThatChecksStuff
, you can typeLon
and pressEsc and it should auto complete.shift+ctrl+alt+v 也将选定的文本发送到 Pastie.org
,使用 PHP Bundle,尝试开始编写函数名称并执行以下操作:
str + alt + F3 = 可用函数列表
str + alt + F1 = Short您刚刚完成的功能的描述。
shift+ctrl+alt+v sends selected text to pastie.org
also, using the PHP Bundle, try to start writing a function name and do the following:
str + alt + F3 = list of available functions
str + alt + F1 = short description of the function you've just completed.
在任何 Cocoa 应用程序(不仅仅是 Textmate)中的字典中查找单词: ctrl + cmd + D
Look word up in dictionary, in any Cocoa app (not just Textmate): ctrl + cmd + D
将每个选定的行包含在标记标签中: SHIFT + CONTROL + COMMAND + W
例如,如果您有:
突出显示所有三行并按 SHIFT + CONTROL + COMMAND + W 创建:
Wrap each selected line in markup tags: SHIFT + CONTROL + COMMAND + W
For example, if you have:
Highlight all three lines and presss SHIFT + CONTROL + COMMAND + W to create:
生成 Lorem ipsum:
lorem
+ TAB将生成:
Generate Lorem ipsum:
lorem
+ TABWill generate: