我正在使用具有以下自定义设置的超棒KeyRemap4MacBook。
它可以在大多数应用程序中修复Home / End,并且不会破坏iTerm2。
从https://gist.github.com/lhotari/6134223181439b9ed0a1
<?xml version="1.0"?>
<!-- ~/Library/Application Support/KeyRemap4MacBook/private.xml -->
<!-- Custom keyboard mappings for MBP using https://pqrs.org/macosx/keyremap4macbook/ -->
<root>
<item>
<name>Lari's PC Style Home/End</name>
<appendix>(Change Home to Command+Left)</appendix>
<appendix>(Change End to Command+Right)</appendix>
<appendix></appendix>
<appendix>{{ PC_STYLE_BINDINGS_IGNORE_APPS_DESCRIPTION }}</appendix>
<identifier>lari.remap.pclikehomeend</identifier>
<block>
<only>DREAMWEAVER</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::END, ModifierFlag::SHIFT_L</autogen>
</block>
<block>
<only>BLUEFISH,WORD,EXCEL,POWERPOINT</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::HOME</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::END</autogen>
</block>
<!--
<block>
<only>EMACS, TERMINAL, X11, ECLIPSE</only>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::A, ModifierFlag::CONTROL_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::E, ModifierFlag::CONTROL_L</autogen>
</block>
-->
<block>
<not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>
</block>
</item>
</root>