Contents
As I have just started to use a MacBook, I need to learn many new shortcuts, tricks, and find the right software. Here I'll collect my findings.
Dan Rodney offers a list of keyboard shortcuts, as does Apple itself.
Moving and Resizing Windows
Obviously, I am not the only one who's annoyed by how much work it is to resize or even move windows on OS X. Coming from Linux/KDE, I have learned to love how easy it is to move Windows by just Alt-Dragging them with the mouse pointer anywhere in the Window, or even resizing them (using the right mouse button, again anywhere inside the window).
Fortunately, there are several 3rd party tools which seem to add this behaviour to OS X, too:
- Zooom/2 ($20) offers moving/resizing as desired, but resizing any corner and snapping to other windows/screen borders ("Magnetics") are not activated by default. Also I found it strange that unresizable windows jump to the upper left corner when you try to resize them, in particular the Zooom/2 (settings) window itself!
- MondoMouse ($15) does not support any window snapping and always resizes from the lower right corner.
- jitouch² ($6) allows moving/resizing with two finger gestures (hold down one, stroke down/upwards right of it, tap second to toggle mode), but it does not snap to the screen borders or other windows, and it always resizes the lower right window corner.
- BetterTouchTool (free) has the same limitations. Compared with the commercial solutions, one also notes a more complex and less intuitive setup system (no predefined gestures at all!). On the other hand, it offers really many gestures and is free (as in beer).
- GeekBind (free, OSS, unmaintained?)
To summarize, all solutions I tried feel unnatural, since they're not really integrated into the system. For instance,
- there is a lag which some programs try to overcome by drawing additional frames around the windows,
- X11 windows are obviously immutable (don't move/resize at all), and
- window snapping only works (if it exists at all) when you use the program-specifiy activation keys, and not when you move/resize via the normal ways.
Oh, and by the way, I am missing "focus follows mouse" a lot. Some of the above software offers a similar, but totally useless "auto raise" feature - Steve Yegge has written a lenghty blog post on this topic. Despite the useful pointers in that document (and the comments therein), I did not yet find a useful implementation.
Other tools concerned with window resizing / positioning:
- Collection of AppleScripts (free, OSS, probably unmaintained, on macosxhints)
- MercuryMover (for keyboard navigation)
- Cinch ($7)
- SizeUp ($13)
Syncing with other Platforms (UTF-8 peculiarities)
When I first tried to rsync data from another machine (running Linux) with UTF-8 filenames, I was surprised to see my files being transferred again and again on multiple runs (actually, I could see rsync deleting them, then immediately re-transmitting, since I used --delete). Then I I recalled discussions on the unison-hackers mailing list about "Mac UTF-8", which is different than other UTF-8.
The full truth is that UTF-8 allows different encodings for some characters, in particular the German umlauts I am dealing with can be represented in decomposed form, e.g. u+" or just as the composed letter ü. Mac defaults to the decomposed form ("NFD" normalized form), Linux (and others) default to the composed form (termed "NFC" variant). More details can be found on unicode.org's page on normalization schemes and on Apples' site.
The main problem is that the HFS+ filesystem implementation changes the 8-bit filename behind one's back! In particular, the filename is converted to and saved as UTF-16, and will be converted back to UTF-8 with decomposed characters when reading from the filesystem. That means that you will not get your exact filenames back that you specified earlier!
Thus, if you (like me) don't want the encoding to be changed on the Linux side, you need to convert the filenames during transfer. rsync has the --iconv switch for this purpose (see their FAQ entry on this issue, and unison also has built-in unicode filename support (which is activated by default in 2.40.x if an OS X system is detected). Also, convmv can be used to fix filenames of existing files; it provides the --nfc / --nfd switches.
My impression is that we need more of this "unicode normalization" in many programs, e.g. ideally a search for "Blätter" should match that word irrespective of the corresponding encoding. Similarly, tab-completion of filenames should be independent of it (note that it is possible - though highly undesirable - on Linux to have two files in the same directory which differ only in the normalization scheme!), and so on.
Mac Keyboard
There are many pitfalls w.r.t. the keyboard:
Several characters are difficult to find, since they're not written on the keyboard and not assigned to the same keys as known from PCs. (One may activate an on-screen keyboard via the keyboard-section of the system settings, which helps in finding the keys.)
- The tilde ('~') is available via Alt-N + Space (i.e. it's a "dead key").
- On my German keyboard, the brackets ('[]') and the pipe symbol ('|') are available via Alt-5/6/7, respectively. This is easier to remember if you realize that Shift-8/9 gives you '()', Alt-8/9 gives you '{}', and Alt-/Cmd-7 rotate the '/' (Shift-7) into '|' and ''. Unfortunately, the next free keys for the brackets were then 5/6, which are quite far off from the Alt key(s).
- The '@' sign is available via Alt-L (at least this one's written on the key nowadays)
I could not get function keys to work in the terminal. For instance, F10 normally quits the Midnight Commander, but under OS X it activates the Exposé animation. (A workaround is to use alternative keybindings, e.g. ESC-0 for mc/quit.)
Some keys are missing, e.g. Delete and Insert. While Delete is available via the Fn-Backspace combination, Insert (which is bound to important functionality in some programs, e.g. the Midnight Commander) seems to be completely missing.
I could not get keyboard accelerators (e.g. underlined characters in menus and other controls) to work in X11 programs (like Gimp). For instance, I would expect Alt-F to open the "File"-menu, but the menu seems to be plain inaccessible via the keyboard. (On the other hand, the whole concept of keyboard accelerators seems to be more or less unknown on OS X.)
Some key bindings seem to be inconsistent - for instance, full-screen mode is activated with Cmd-F in iTunes, but with Shift-Cmd-F in Preview. (Safari does not have a full-screen mode at all...)
Or switching through tabs: that's Ctrl-(Shift-)Tab in Safari, but Cmd-Ö/Ä in Terminal. In both cases, the other shortcut is not bound, so there would not have been a clash or any other obvious reason not to use the same shortcut binding.
By the way, I also find it inconsistent that the three-finger swipe gesture for forward/back does not work in the hypertext help windows, which are as similar to Safari as it gets (from a user's perspective).
Jumping to New Mail in Apple Mail
One thing which really annoyed me is that I did not find a keyboard shortcut to jump to my unread messages in Apple Mail. You see - it nicely tells me that there are - let's say 13 - unread messages in folder "Foo", but entering that folder, I am left alone with finding them?!
Fortunately, it is possible to solve this with AppleScript - a quick internet search turns up dozens of AppleScript solutions. As a start, I picked the following:
try tell application "Mail" activate tell the front message viewer set unreadMessages to (the messages whose ¬ read status is false) as list if (count of unreadMessages) is not 0 then set selected messages to {the first item of unreadMessages} else beep end if end tell end tell on error error_message beep display dialog "Error looking for next unread message: " & ¬ return & return & error_message buttons {"OK"} default button 1 end try
An appealingly short version is this:
tell application "Mail" to try tell message viewer 1 to set selected messages to ¬ {first message of beginning of (get selected mailboxes) whose read status is false} activate on error beep end try
Dynamic Libraries
(This is mostly only relevant to programmers.) Dynamic libraries often come as "frameworks", which are not linked using -l, but using -framework; the corresponding path flag is -F (instead of -L).
otool -L foo.so is similar to ldd foo.so, and the dynamic linker is named dyld, which is important since the environment variable LD_LIBRARY_PATH is named DYLD_LIBRARY_PATH on OS X, accordingly. See the manpages for otool and dyld (and maybe ld and install_name_tool).
Reading ext2 volumes
Coming from Linux, I have a lot of stuff stored on external HDDs in ext2 partitions, so I am interested in how to read/mount them. There are at least three relevant projects:
- fuse-ext2 (actively maintained, works with Snow Leopard)
- ext2fsx (SF.net, dead)
- ext2fuse (SF.net, dead)
An unsolved problem however is that there is no support for filename encoding translation. If you still have partitions using iso-8859-1 (or similar), you will have problems.
Emacs
One of the first things I learned is that X11 apps feel foreign - as you can see above, one has problems with keyboard shortcuts not working, the window being immutable to 3rd party resizing/moving extensions, and the fact that the apps are "wrapped" by an "X11" app is not hidden from the user at all.
So, it is clearly the goal to have pure Cocoa alternatives for all apps you're using. In my case, I was using XEmacs on Unix, and here the situation seems to be that there are only ports of GNU/Emacs for Cocoa (or Carbon), but no maintained XEmacs port. The situation is described on numerous websites, e.g. the EmacsWiki.
Unfortunately, it is non-trivial to port a .emacs from XEmacs to GNU/Emacs. Here are some changes I did:
; XEmacs has a convenient add-path (which supports an 'append option), the closest and shortest ; equivalent that also works on GNU/Emacs seems to be add-to-list: (add-path 'foo') (add-to-list 'load-path 'foo') ; Key bindings are specified differently. In XEmacs, I liked to use (global-set-key '(meta Y) 'some-func) ; but in GNU/Emacs this nice syntax is not valid.
Some packages are missing; for now I commented them out:
- un-define (XEmacs MULE Unicode support)
Finally, I have the problem that Alt-5/6 does not give me brackets in Emacs, but "M-5/6" prefixes in the minibuffer. I wonder how other people use Emacs on OS X - that would be unusable, no?!
Other Software I plan to look at
- QuickSilver
- Jumpcut
- http://unsanity.com/products
- SmartScroll ?
- FastScripts
- MenuMeters