macos 有哪些有用的 TextMate 快捷键?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/99807/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 05:54:38  来源:igfitidea点击:

What are some useful TextMate shortcuts?

macoskeyboard-shortcutstextmatetextmatebundles

提问by Tony Pitale

Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in TextMateand its bundles.

Mac 以拥有大量快捷方式而闻名(或哀叹)。然而,与TextMate及其软件包中的快捷方式列表相比,OS X 本身就显得苍白无力

What are some useful keyboard shortcuts you use?

您使用了哪些有用的键盘快捷键?

采纳答案by Magnar

These are my favorite shortcuts:

这些是我最喜欢的快捷方式:

  • cmd+tStart typing name of a file to open it
  • ctrl+wSelect word
  • cmd+rRun the ruby or php-script that is open
  • cmd+opt+mDefine a new macro
  • cmd+shift+mRun the macro
  • optSwitch to vertical selection mode
  • cmd+opt+aEdit ends of selected lines
  • cmd+t开始输入文件名来打开它
  • ctrl+w选择单词
  • cmd+r运行打开的 ruby​​ 或 php 脚本
  • cmd+ opt+m定义一个新的宏
  • cmd+ shift+m运行宏
  • opt切换到垂直选择模式
  • cmd+ opt+a编辑选定行的结尾

回答by melfar

  • ctrl+shift+Kdeletes current line
  • ctrl+shift+Jmerges current line with the next line
  • ctrl+ shift+K删除当前行
  • ctrl+ shift+J合并当前行与下一行

回答by Eric Van Joshnon

Escauto completes common words in the document you are working in.

Esc自动完成您正在处理的文档中的常用词。

For example if you are using a function alot called LongFuntionNameThatChecksStuff, you can type Lonand pressEscand it should auto complete.

例如,如果您正在使用一个名为 的函数LongFuntionNameThatChecksStuff,您可以输入Lon并按下Esc它,它应该会自动完成。

回答by alamodey

My favourites are:

我最喜欢的是:

  • option+command+[to clean up your indentation
  • "lorem", TABto insert placeholder text
  • option+ command+[清理你的缩进
  • “lorem”,TAB插入占位符文本

回答by Matt

Personally two of my favourite shortcuts are:

我个人最喜欢的两个快捷方式是:

  • ??L (that's ctrl+shift+L): Which wraps the currently selected text with a link to whatever's in the clipboard, and works for every text language I've tried it in.
  • ???L (that's ctrl+shift+cmd+L): Which googles for the selected text and links to the top result.
  • ??L(即ctrl+ shift+ L):它用指向剪贴板中任何内容的链接包装当前选定的文本,并且适用于我尝试过的每种文本语言。
  • ???L(即ctrl+ shift+ cmd+ L):哪个谷歌搜索所选文本并链接到顶部结果。

The are both super useful for writing text and blogging, (and stackoverflow).

它们对于编写文本和博客(以及 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.

Codewise,我认为我更喜欢代码片段而不是快捷键。能够if?用几乎任何语言打字等等都是非常有用的,而且一致的界面是让我使用 TextMate 的原因。

I also found thisquite amusing. But I prefer to learn my shortcuts in small steps, and often find that just looking in the gear menu (??) works.

我也觉得很有趣。但我更喜欢小步学习我的快捷方式,并且经常发现仅查看齿轮菜单(??)就可以了。

回答by drukepple

Control-T(ControlT): Transpose(works in most Cocoa-native text fields and areas, but TextMate enhances the behavior).

Control-T( ControlT):转置(适用于大多数 Cocoa 原生文本字段和区域,但 TextMate 增强了行为)。

  • 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).

  • 将插入符号放在两个字符之间, hit ControlT,然后字符切换位置(这是标准的 Mac 行为)。很棒的错别字。

  • 在单行上选择一个单词或一系列字符,点击ControlT,然后选择中的字符现在将被反转(不太有用,但这是一个 TextMate 增强)

  • 选择一系列跨越多行的字符,点击ControlT,这些行将反转。行内的字符仍然是有序的。在选择整行时最有用,但仍然可以选择部分行,只要至少选择一个换行符(TextMate 增强)。

回答by svnlto

shift+ctrl+alt+v sends selected text to pastie.org

shift+ctrl+alt+v 将选定的文本发送到 Pastie.org

also, using the PHP Bundle, try to start writing a function name and do the following:

此外,使用 PHP Bundle,尝试开始编写函数名称并执行以下操作:

str + alt + F3 = list of available functions

str + alt + F3 = 可用函数列表

str + alt + F1 = short description of the function you've just completed.

str + alt + F1 = 您刚刚完成的功能的简短描述。

回答by Cory Schires

Look word up in dictionary, in any Cocoa app (not just Textmate): ctrl + cmd + D

在字典中查找单词,在任何 Cocoa 应用程序(不仅仅是 Textmate)中: ctrl + cmd + D

alt text

alt text

回答by Cory Schires

Wrap each selected line in markup tags: SHIFT+ CONTROL+ COMMAND+ W

将每个选定的行包裹在标记标签中:SHIFT+ CONTROL+ COMMAND+W

For example, if you have:

例如,如果您有:

  This is a 
  few sample
  list items 

Highlight all three lines and presss SHIFT+ CONTROL+ COMMAND+ Wto create:

突出显示所有三行并按SHIFT+ CONTROL+ COMMAND+W创建:

  <li>This is a </li>
  <li>few sample</li>
  <li>list items</li>

回答by Cory Schires

Generate Lorem ipsum: lorem+ TAB

生成 Lorem ipsum:lorem+TAB

Will generate:

会产生:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sat amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut Labore et dolore magna aliqua。Ut enim ad minim veniam, quis nostrud exeritation ullamco Laboris nisi ut aliquip ex ea commodo consequat。Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。例外 sint occaecat cupidatat non proident, 在 culpa qui offcia deserunt mollit anim id est labourum 中被禁止。