The base meta-key on OSX is ^ (Control) rather than ⌥ (Option).
Some commands are ⌃ and some are ⌥. For example ⌃f is forward-char and ⌥.f is forward-word.
Sorry, I should have given ⌃key examples.
Where do you get your modifier images? I think in some places I would prefer using those to the standard glyphs. Maybe we could have a palette of those similar to the Menu Glyphs.group from the Library.
Hey Mitchell,
That's just markdown:
<kbd>⌘</kbd><kbd>⌥</kbd><kbd>F</kbd>
Gives:
⌘⌥F
-Chris
Well that’s cool! Didn’t know about that one.
I am going to provide a guide to the most commonly used built-in Cocoa text keybindings, but for now I want to point out a particular use of the built-in keybindings
The keystrokes that delete text — ⌃K, ⌥D, and ⌥⌫ in particular — accumulate that text on a clipboard separate from the OS X clipboard and, ⌃Y inserts that clipboard’s text.
There are four big advantages for using these keys (and for the first advantage, the same holds true for others of the keystrokes buiilt-in to Cocoa text editors):
-
Cocoa text key bindings are much quicker to use than the mouse, or even arrow key combinations.
-
Many of the Cocoa keybindings don’t have regular OS X equivalents.
-
The secondary clipboard accumulates text deletions; pasting that text back can then be done with a single keystroke, rather than a series of keystrokes or mouse clicks with the KM Maestro clipboard history.
-
It is very convenient to have a second clipboard that is used with these short-term commands — it doesn’t disturb the current clipboard (although that is far more important without KM’s clipboard history).
⌥d is not a normal Cocoa keybinding.
It normally produces the character: ∂
⌥D produces the character: Î
-Chris
Testing in TextEdit and TextWrangler, none of those keystrokes worked as you indicated, except for ⌥⌫
In particular, ⌃Y just pastes the current clipboard, not the "deleted text" clipboard you refer to.
Personally, I wouldn’t expect a programming editor to conform to those things - they need as many hotkeys as possible. Just my opinion, though.
TextEdit works with ^K and ^Y. So does Mail.
FWIW. YMMV.
Strange, just tested TextEdit again, and these don't work for me.
It is possible that I have those keys set as hotkeys somewhere, but I don't recognize them for TextEdit.
EDIT: Yep, I have hot keys for both of those. My apologies for the confusion.
User error. g,d&r
⌃K works fine in both TextEdit and TextWrangler.
However TextWrangler (and BBEdit) do not support the secondary pasteboard.
⌃Y Yank (paste from secondary pasteboard)
⌃A Go to beginning of paragraph.
⌃E Go to end of paragraph.
⌃K Kill (delete) to end of paragraph and add to Yank buffer.
⌃F Forward one character.
⌃B Backward one character.
⌃⌥F Forward one word.
⌃⌥B Backward one word.
There are a bunch of them that work in Cocoa applications and in OSX text fields.
-Chris
You can't run fast enough to avoid the Texas lasso. LOL
LOL. That reminds me of my friend who was a CHP officer. He would say “You can’t outrun the Motorola Overdrive” (radio).
Chris,
Don’t all of these, except ⌃K, have standard Mac OSX shortcuts:
⌃A Go to beginning of paragraph. ⌥↑
⌃E Go to end of paragraph.⌥↓
⌃F Forward one character. →
⌃B Backward one character. ←
⌃⌥F Forward one word. ⌥→
⌃⌥B Backward one word. ⌥←
And with all of the movements, just add ⇧ to select the text.
I make heavy use of the ⌃ key in my KM macro triggers, so using it for movements is pretty much out for me.
Try ⌥D in TextEdit and see what you get. If you are getting a MacRoman character it means I did something a great many years ago to activate the traditional Emacs/terminal/Cocoa text editor ⌃ and ⌥ bindings and there is no way I would remember how. Would have to search the web. I know I made a few changes to my DefaultKeyBinding.dict
but I don’t think anything so radical as to enable those keystrokes.
These bindings are built in to the Cocoa Text Editor component.
Hey Mitchell,
I have.
You've made changes to your system.
-Chris
It may come down to whether ⌥ is enabled as meta, since yes, in a default user, most of the ⌥ keybindings I claimed work don’t. I don’t know of a way to enable meta as a single action, though.
The default Cocoa bindings are in /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict
, but I can’t figure out to read or convert that. It used to be readable by Xcode I think. Text System Defaults and Key Bindings
User keybindings, if any, go in ~/Library/KeyBindings/DefaultKeyBindings.dict
/. It is not necessary to repeat the bindings assigned by the system — you can just add your own to add to or override the system bindings.
See Text System Defaults and Key Bindings and many examples of full /DefaultKeyBindings.dict
files on the web.
The following should work out of the box — again, this is only in Cocoa Text Editor components — applications like BBEdit do whatever they feel like. Browser Text Boxes are not Cocoa Text Boxes, although control-commands generally work in them. (I think text boxes in some web pages support the option commands too, but I’m not sure.)
- ⌃A beginning of line/paragraph (depending)
- ⌃B back one character
- ⌃D delete one character forward
- ⌃E end of line/paragraph (depending)
- ⌃F forward one character
- ⌃H delete one character backward
- ⌃K kill to end of line/paragraph (depending)
- ⌃N next line
- ⌃O open line (i.e., insert RETURN at cursor and stay before RETURN)
- ⌃P previous line
- ⌃Q “quote” — i.e., take literally — the next character, rather than treating it as keybinding
- ⌃T transpose characters around cursor
- ⌃V down one page (with a little bit skewed idea of “page”)
- ⌃W “delete to mark” — complicated to explain
- ⌃Y paste the most recent sequence of keystrokes that delete
No, not all the ⌃ bindings have OS X equivalents, and for the ones that do, some people find it more convenient to use letter-key commands rather than special-key commands, since they involve less finger/hand movement. Depends a lot on how much you’ve used these bindings in the past — terminal, Emacs, whatever.
Cocoa Text System is a 10-year old but still useful reference that includes basic information on changing Cocoa keybindings.
See osx - Emacs-like Meta (Option/Alt) key functionality in OS X Lion? - Super User to see how to enable the very most basic ⌥ commands.
Something is strange. This reply contains <kbd>⌃</kbd>
. Here it looks like yours — ⌃ — but the same ```kbd`` construction at the end of the first paragraph of this post yields different shading.