In case anyone wasn’t able to git the attachment, here is the
DefaultKeyBinding.dict.
{
"^y" = "yankAndSelect:"; //control-y
"^\@" = "setMark:"; //control-@
"^w" = "deleteToMark:"; //control-w
"^x" = { //control-x control-x
"^x" = "selectToMark:";
};
"^ " = "setMark:"; //control-space
"~f" = "moveWordForward:"; //option-f
"~b" = "moveWordBackward:"; //option-b
}
On Feb 16, 2015, at 12:07 AM, Barry Hadder <[email protected]> wrote:
For anyone who may be interested and familiar with emacs, I’ve found out how to
enable much of readline and emacs functionality in edit fields through out the
system including pages. This includes features like the kill ring and regions.
Of course control-k and control-y are already there, but this will add much
more.
To enable this, do the following:
1. Turn on the kill ring by typing the following in terminal.
defaults write -g NSTextKillRingSize -string 4
You can set that to a larger size. I believe emacs defaults to 16. With this
set greater than 1 and control-y set to yankAndSelect: you can cut text with on
of the kill commands i.e. control-k, and cycle thru the cut text with control-y.
2. Optionally, you can set the control-u repeat count binding by typing:
defaults write -g NSRepeatCountBinding -string “^u”
3. In ~/Library, create a folder called KeyBindings. If one is allready
there, than skip this step.
4. copy the attached DefaultKeyBinding.dict file to the folder.
Note that I only put a few emacs key bindings in this file. It is very easy
for anyone to add much more. The two documentation sources I used are the
Cocoa event handling guide
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html#//apple_ref/doc/uid/20000468-611005
<https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html#//apple_ref/doc/uid/20000468-611005>
and the NSResponder class reference
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/index.html
<https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/index.html>.
Another good source for selectors to bind to that may be used is the NSText
class reference.
I remember a thread on this list regarding a problem copying text broken by a
page boundary. I believe that there may be something hear that can be helpful.
I have successfully copied text across pages by setting a mark on the first
page, then moving the cursor to an area on the second page and using control-x
control-x select text from the mark to the point and use normal copy and paste.
I have allso tried using the kill ring by killing a line of text on page 1 with
control-k, moving to the second page killing another line of text, then pasting
the first line with control-u 2 control-y and the second line with control-u 4
control-y.
Enjoy.
Barry Hadder
[email protected] <mailto:[email protected]>
<DefaultKeyBinding.dict>
Barry Hadder
[email protected]
--
You received this message because you are subscribed to the Google Groups
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/d/optout.