DefaultKeyBinding.dict
Buat ~/Library/KeyBindings/
dan simpan daftar properti seperti ini sebagai ~/Library/KeyBindings/DefaultKeyBinding.dict
:
{
"^ " = setMark:;
"^/" = undo:;
"^l" = selectParagraph:;
"^u" = deleteToBeginningOfParagraph:;
"^w" = deleteToMark:;
"^x" = {
"^x" = swapWithMark:;
"^m" = selectToMark:;
};
"^V" = pageDownAndModifySelection:;
"~@" = selectWord:;
"~b" = moveWordBackward:;
"~c" = (capitalizeWord:, moveForward:, moveForward:);
"~d" = deleteWordForward:;
"~f" = moveWordForward:;
"~l" = (lowercaseWord:, moveForward:, moveForward:);
"~r" = centerSelectionInVisibleArea:;
"~u" = (uppercaseWord:, moveForward:, moveForward:);
"~v" = pageUp:;
"~w" = (deleteToMark:, setMark:, yank:, swapWithMark:);
"~B" = moveWordForwardAndModifySelection:;
"~F" = moveWordForwardAndModifySelection:;
"~V" = pageUpAndModifySelection:;
}
DefaultKeyBinding.dict
tidak berfungsi di beberapa aplikasi seperti Xcode atau Firefox. Metode yang menggunakan kill ring hapus pemformatan dari teks kaya. Kombinasi tombol yang memasukkan status kunci mati (seperti opsi-u di tata letak keyboard AS) tidak dapat ditetapkan ulang.
Lihat juga http://www.hcs.harvard.edu/~jrus/site/KeyBindings/Emacs%20Opt%20Bindings.dict . transposeWords:
tidak berfungsi di sebagian besar aplikasi. openDocument:
dan saveDocument:
tidak bekerja di aplikasi yang menggunakan penyimpanan otomatis, dan performClose:
juga tidak berfungsi di mana-mana.
Lihat http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html atau http://osxnotes.net/keybindings.html untuk informasi lebih lanjut.
KeyRemap4MacBook
Salah satu opsi adalah mengaktifkan pengaturan di grup mode Emacs yang telah ditentukan :
Pilihan lain adalah menyimpan file seperti ini sebagai ~/Library/Application Support/KeyRemap4MacBook/private.xml
:
<?xml version="1.0"?>
<root>
<appdef>
<appname>EMACSMODEIGNORE</appname>
<equal>com.gnu.Emacs</equal>
<equal>com.apple.Terminal</equal>
<equal>com.googlecode.iterm2</equal>
<equal>com.vmware.fusion</equal>
<prefix>com.vmware.proxyApp.</prefix>
</appdef>
<item>
<name>emacs</name>
<identifier>private.emacs</identifier>
<not>EMACSMODEIGNORE</not>
<autogen>__KeyToKey__ KeyCode::P, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_UP</autogen>
<autogen>__KeyToKey__ KeyCode::N, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::B, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::F, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT</autogen>
<autogen>__KeyToKey__ KeyCode::P, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_UP, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::N, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_DOWN, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::B, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::F, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::B, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_OPTION</autogen>
<autogen>__KeyToKey__ KeyCode::F, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_OPTION</autogen>
<autogen>__KeyToKey__ KeyCode::B, VK_OPTION | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_OPTION | VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::F, VK_OPTION | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_OPTION | VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::D, VK_OPTION | ModifierFlag::NONE, KeyCode::FORWARD_DELETE, VK_OPTION</autogen>
<autogen>__KeyToKey__ KeyCode::V, VK_OPTION | ModifierFlag::NONE, KeyCode::PAGEUP</autogen>
<autogen>__KeyToKey__ KeyCode::V, VK_OPTION | VK_SHIFT | ModifierFlag::NONE, KeyCode::PAGEUP, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::V, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::PAGEDOWN, VK_SHIFT</autogen>
<autogen>__KeyToKey__ KeyCode::U, VK_CONTROL | ModifierFlag::NONE, KeyCode::DELETE, VK_COMMAND</autogen>
</item>
</root>
Kemudian buka aplikasi KeyRemap4MacBook, tekan tombol ReloadXML, dan aktifkan pengaturan.
Ubah kode kunci jika Anda menggunakan tata letak keyboard seperti Dvorak atau Colemak.
Lihat https://pqrs.org/macosx/keyremap4macbook/xml.html.en atau http://osxnotes.net/keyremap4macbook.html untuk informasi lebih lanjut.