Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some useful TextMate shortcuts? [closed]

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

  • ctrl+shift+K deletes current line
  • ctrl+shift+J merges current line with the next line

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 type Lon and pressEsc and it should auto complete.


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


My favourites are:

  • option+command+[ to clean up your indentation
  • "lorem", TAB to insert placeholder text

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.

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.


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.