Archive for the ‘tutorial’ Category

TextMate tips

Monday, March 5th, 2007

I use TextMate for most of my working day. The TextMate Basics Tutorial is a good place to start to increase your proficiency with it. Here are a few of the more useful keyboard-shortcuts:

  • Another rather hidden feature is the incremental search. ⌃S or ⌃⇧S incrementally searches forward/backward as you type (the status bar will turn into an input field in that case).
  • ⌃G (Text → Convert → To Opposite Case) with no selection will toggle the case of the character next to the caret and advance the caret. with a selection it will toggle the case of all the characters in the selection (and leave the selection in place).
  • Subversion Support is provided via this Bundle. Just checkout a directory or file from a Subversion repository, open it in TextMate and you can use this Bundle. All Subversion Commands use the same shortcut ⌃⇧A
  • Bookmarks are marked places in your document. ⌥⌘B (View → Gutter → Bookmarks) will show them in the gutter (the gray panel to the left of the editable area, containing line numbers etc.) You can create a bookmark with ⌘F2 (Navigation → Add Bookmark). This will put a star (★) in the bookmark column of the gutter for that line. You can then always cycle through your bookmarks with F2 (Navigation → Next Bookmark) and ⇧F2 (Navigation → Previous Bookmark).
  • So, F1 View → Fold Current Block

There are many more but it is best to add a few every week to your knowledge so they become automatic.

Functions as arguements

Friday, July 28th, 2006

Slash7 has posted the slides from their brilliant Javascript Boot Camp Tutorial talk at OSCON. 108 pages of pure JavaScript love. One thing I just learnt, on page 36, is that you can pass a function as an arguement into another function. That function can then call the arguement function. Sounds weird but that is pretty amazing if you ask me.