M-x all-things-emacs

Emacs Key Bindings in MS Word

February 18th, 2007 by Ryan McGeary · 7 Comments

Macosxhints.com points us to a way to enable emacs key bindings in Microsoft Word. Just assign new shortcut keys to each of these Word commands (instructions below):

StartOfLine : C-a
EndOfLine   : C-e
LineUp      : C-p
LineDown    : C-n
CharLeft    : C-b
CharRight   : C-f

Please feel free to suggest other emacs equivalent Word commands and shortcuts in the comments.

Word 2004 for Mac

  1. Tools > Customize > Customize Keyboard …
  2. Select “All Commands” in the Categories box.
  1. Add new shortcut keys for each of the commands above.

Word 2002 (XP) for Windows

  1. Tools > Customize …
  2. Click the “Keyboard …” button.
  3. Select “All Commands” in the Categories box.
  1. Add new shortcut keys for each of the commands above.

Note: On Windows, C-p, C-n, and C-f will probably conflict with FilePrint, FileNew, and EditFind, so you may want to remove those existing shortcut keys first.

Tags: misc · osx · windows

7 responses so far ↓

  • 1 piyo // Feb 19, 2007 at 1:48 pm

    It’s funny how I am a keyboard-rebinding Emacs freak, but when it comes to using Word, I don’t bother. Perhaps its because Word’s cursor movement behavior is weird (not-Emacs like) or that comment fields in browsers use Windows default movement keys and Word reinforces that. I must be disappointed by the poor Emacs emulation.

    I was checking out other commands to bind and these are necessary IMHO for closer Emacs emulation. Here I list the similar (but not always equal) Emacs command.

    Word (org. keystroke) == Emacs (keystroke)
    WordLeft (Ctrl+Left) == backwards-word (Meta-B)
    WordRight (Ctrl+Right) == forward-word (Meta-F)
    DeleteBackWord (Ctrl+Backspace) == backward-kill-word (Ctrl+Backspace or Meta+Backspace)
    DeleteWord (Ctrl+Del) == kill-word (Meta-D)
    PageDown (Page Down) == scroll-up? (Ctrl+V)
    * That one really gets me irritated if I want to rebind it.
    PageUp (Page Up) == scroll-down? (Meta+V)

    Perhaps a combination of built-in commands as Word macros can get us closer to Emacs-like movement.

    Also, Microsoft Word (verified on 2000) supports multi-sequence key bindings. I have a macro which changes the screen from black-on-white to white-on-black (like my Emacs), and I bind it with Ctrl+L,B. (This macro simple sets Options.BlueScreen to false or true. “Blue Screen”, eh?)

    If you will permit me to get off topic just a bit more. I have two items, which are not Emacs emulation tips:

    If you hate the formatting also being copied over when doing regular copying and pasting, may I suggest using the freeware PureText. I bind it to Windows+V and it works very well when C&P between different documents with different styles and fonts.

    I find that I like Word to change the view just like Adobe Acrobat Reader, so I rebind Word keystrokes again:

    Word (org. keystroke) == Acrobat Reader
    ViewZoomWholePage (none) == Actual Size (Ctrl+1)
    ViewPageWidth (none) == Fit Page (Ctrl+2)
    a macro I made (none) == Fit Width (Ctrl+3)

    The macro contains this:

      With ActiveWindow.ActivePane.View.Zoom
        .PageColumns = 1 ' need to reset these
        .PageRows = 1    ' properties as well
        .PageFit = wdPageFitTextFit
      End With

    It works, but it is not robust when in View/Normal mode.

  • 2 piyo // Feb 19, 2007 at 1:51 pm

    woops, my equal equal characters seperating the two fields in my tables got killed. Oh well.

  • 3 Ryan McGeary // Feb 19, 2007 at 1:58 pm

    Piyo, Thanks for the follow-up. I fixed some of the formatting issues where your original characters were gobbled.

  • 4 Emacs Key Bindings in Windows | M-x all-things-emacs // May 10, 2007 at 5:25 pm

    [...] This may very well void the need for Emacs Keybindings in MS Word. [...]

  • 5 VBA on PPT HomeKey EndKey | Technology & Programming Answers // Nov 1, 2013 at 2:42 pm

    […] in the spirit of this old post. […]

  • 6 Nick Merrill // Dec 19, 2013 at 5:21 am

    I also added a shortcut for Ctrl+D by creating the macro
    Selection.Delete Unit:=wdCharacter, Count:=1
    in case anyone wants to add that as well.

  • 7 Emacs key bindings in MS Word | The stupidest thing... // Feb 12, 2014 at 1:31 pm

    […] google search on the title of this post got me to this post. I should have looked […]