Skip to content

Latest commit

 

History

History
104 lines (93 loc) · 3.46 KB

File metadata and controls

104 lines (93 loc) · 3.46 KB

Excel Vim Keys

Too cool to use Excel, too amateur to escape it

Excel shortcuts can be used in conjunction w/ Vim keys
Nearly all Excel {CTRL} & {SHIFT} shortcuts are unaffected
Excel {ALT} shortcuts are unaffected

Movements to leftmost & rightmost populated cells in a row is most enjoyable advantage

Quick Setup

  1. Download vim_keys.xlam
  2. Skip to step 4 below in DIY Setup

DIY Setup

  1. If Excel Developer tab isn't enabled yet, enable it in Excel Options
  2. In a new Excel file, from Developer tab, in Visual Basic editor, create 2 modules vim_emulation & vim_shortcuts and paste in corresponding contents of sub procedures from vim_emulation.bas & vim_shortcuts.bas
  3. Save-As the Excel file as Excel Add-in (*.xlam)
    • Default location on Windows is ~\AppData\Roaming\Microsoft\AddIns\<file-name>.xlam
  4. In an Excel file, from Developer tab, in Excel Add-ins, browse for & add the Excel Add-in
  5. In Excel Options File > Options, in dialog box section Quick Access Toolbar, Choose commands from Macros, add setup_shortcuts & teardown_shortcuts
    • Modify names & icons to preferrence; I use vim_mode with checkmark icon & stop_vim with cancel icon

Excel's cut is fake

Keys

Normal Mode

key action
h move left
j move down
k move up
l move right
{BKSP} move left
{SPACE} move right
i edit cell
a edit cell
A edit cell right of rightmost value in row
I edit cell left of leftmost value in row
o insert row below
O insert row above
x delete
D clear row's cell contents from selected to right
r replace cell contents
R replace cell contents
b move contiguous left
w move contiguous right
e move contiguous right
H move top of viewport
{CTRL}+u move page-up
L move bottom of viewport
{CTRL}+d move page-down
$ move to rightmost value in row
0 move to column A in row
_ move to leftmost value in row
^ move to leftmost value in row
v start visual mode
V start visual mode
p paste
P paste values
u undo
{CTRL}+r redo
/ search
n next search result
N previous search result

Visual Mode

key action
h move left
j move down
k move up
l move right
{BKSP} move left
{SPACE} move right
b move contiguous left
w move contiguous right
e move contiguous right
$ move to rightmost value in row
0 move to column A in row
_ move to leftmost value in row
^ move to leftmost value in row
x delete
d delete
y copy
p paste
P paste values
{CTRL}+u move page-up
{CTRL}+d move page-down
v exit visual mode to normal mode
{ESC} exit visual mode to normal mode

Reference Projects

VBA API Docs