≡ Menu

Emacs keyboard navigation shortcuts for Microsoft Word using AutoHotKey

[If you’re not familiar with the Emacs text editor, you might as well skip this post.]

I’ve greatly improved my typing speed in Microsoft Word by using the free AutoHotKey utility to implement a subset of Emacs keyboard shortcuts. Once you know the basic Emacs keystrokes, you can do most of the basic editing operations without having to move your hands much, if at all, from the home row.

Here’s the AutoHotKey code for the specific Emacs shortcuts that I use in Word:

#IfWinActive, ahk_class OpusApp ; Check whether Microsoft Word is the active window
^a::Send, {Home} ; beginning of line
^!b::Send, ^b ; Use Control-Shift-b for bold instead of plain Control-b
^b::Send, {Left} ; Cursor left by one char
!b::Send, ^{Left} ; Cursor left by one word
^d:: Send,{Del} ; Delete char
!d:: Send, ^+{Right}{Delete} ; Delete word to the right
^e:: Send,{End} ; End of line
^f:: Send,{Right} ; Cursor right by one char
!f:: Send,^{Right} ; Cursor right by one word
^+k:: Send, ^k ; Use Control-Shift-k for inserting a link, instead of plain Control-K
^k:: Send, +{End}+{Left}^x ; Delete to end of line
!k:: Send, {F8}!ef!n{NumPadDot}!f{Esc}^x ; Delete to end of sentence (actually, to next period character).
^n:: Send, {Down} ; Cursor down one line
^+p:: Send, ^p ; Use Control-Shift-p to print, instead of plain Control-p
^p:: Send, {Up} ; Cursor up one line
^w:: Send,^x ; Cut
!w:: Send, ^c ; Copy
^+y:: Send, ^y ; Use Control-Shift-y for redo, instead of plain Control-y
^y:: Send, +{Insert} ; Paste
#IfWinActive

{ 1 comment… add one }
  • Luis 2021-08-13, 13:17

    ha! There’s at least one other person out there stuck using Word but wishing they were using emacs.

    I did a search out of a lark, not expecting that I would find a solution.

    Thanks for posting this. You got me up and running in 10 minutes, saving me hours to get this up and running on my PC.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.