8
8

More than 5 years have passed since last update.

MS Word で C-l

Last updated at Posted at 2014-02-19

Microsoft Word でも Emacs キーバインドを使いたい

普段から Emacs と Microsoft Word を ALT + TAB で切り替えて使っています。
Emacs のキーバインドに慣れ親しんでしまっているため、Microsoft Word では
C-nSelection.MoveDown Unit:=wdLine, Count:=1 と、
C-pSelection.MoveUp Unit:=wdLine, Count:=1 と、
簡素な VBA を割り当てています。
本格的には XKeymacs などをインストールすべきでしょうけれども、Microsoft Word 内だけで完結したいこともあって、この程度で済ませています。

recenter

長らく Emacs の C-l (recenter) を再現する VBA が作れずにいましたが、
ふと Shift + PageDown left right の順に打鍵することで recenter に近い動作となるのではと思い立ち、下記の VBA を C-l に割り当てました。

Sub recenter()
    Selection.MoveDown  Unit:=wdScreen,    Count:=1, Extend:=wdExtend
    Selection.MoveLeft  Unit:=wdCharacter, Count:=1
    Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub

これで Microsoft Word においても ctrl 押しっぱなしの nl で文書を眺めることができるようになり、個人的にはずいぶん快適になりました。

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8