What are some useful TextMate shortcuts? [closed]

2019-03-07 10:38发布

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?

30条回答
趁早两清
2楼-- · 2019-03-07 11:09

Format CSS: CONTROL + Q

Select some CSS and press CONTROL + Q to turn this:

body { background: red; font-size: 10px; color: black; }

Into this:

body {
  background: red;
  font-size: 10px;
  color: black;
}
查看更多
该账号已被封号
3楼-- · 2019-03-07 11:10

CMD + / comments out a line and it's smart enough to format based on language. I use it all the time.

查看更多
Root(大扎)
4楼-- · 2019-03-07 11:10

(these are mostly html-related)

  • cmd + option + closes current open html tag
  • shift + cmd + w wrap selection in tags
  • ctrl + return insert escaped line end, i.e. \n or <br> depending on the occasion.
查看更多
不美不萌又怎样
5楼-- · 2019-03-07 11:11

These are my favorite shortcuts:

  • cmd+t Start typing name of a file to open it
  • ctrl+w Select word
  • cmd+r Run the ruby or php-script that is open
  • cmd+opt+m Define a new macro
  • cmd+shift+m Run the macro
  • opt Switch to vertical selection mode
  • cmd+opt+a Edit ends of selected lines
查看更多
放荡不羁爱自由
6楼-- · 2019-03-07 11:12

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

查看更多
我只想做你的唯一
7楼-- · 2019-03-07 11:13

Downcase selected text: CONTROL + SHIFT + U

Will turn:

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Into:

lorem ipsum dolor sit amet, consectetur adipisicing elit.

查看更多
登录 后发表回答