Skip to content

oseifrimpongg/dockeys

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocsKeys

A browser extension that brings Vim-style keyboard shortcuts to Google Docs, allowing you to edit documents with familiar Vim motions and commands.

While this extension currently implements core Vim functionality including basic motions, text manipulation, and visual selections, there's room for expansion. Contributions are welcome to add more Vim features as per your need.

If you are using DocsKeys with Vimium, disable Vimium on Google Docs.

This project is heavily inspired by and uses much of code from SheetKeys

Available Motions

Basic Movement

  • h - Move cursor left
  • j - Move cursor down
  • k - Move cursor up
  • l - Move cursor right
  • w - Move to start of next word
  • b - Move to start of previous word

Line Navigation

  • 0 or ^ or _ - Go to start of line
  • $ - Go to end of line
  • I - Go to start of line and enter insert mode
  • A - Go to end of line and enter insert mode

Document Navigation

  • g - Go to document start
  • G - Go to document end
  • { - Go to start of paragraph
  • } - Go to end of paragraph

Editing Commands

Mode Switching

  • i - Enter insert mode
  • a - Enter insert mode (after cursor)
  • v - Enter visual mode
  • V - Enter visual line mode
  • Esc - Return to normal mode
  • Ctrl + o - Temporary normal mode from insert mode

Text Manipulation

  • d + motion - Delete (supports dw, diw, dp, dip, dd)
  • c + motion - Change (supports cw, ciw, cp, cip, cc)
  • y + motion - Yank/copy (supports yw, yiw, yp, yip, yy)
  • p - Paste
  • u - Undo
  • r - Redo

Line Operations

  • o - Add new line below and enter insert mode
  • O - Add new line above and enter insert mode

Visual Mode Commands

When in visual mode (v or V):

  • All movement keys (h, j, k, l, w, b, etc.) extend the selection
  • d - Delete selected text
  • c - Change selected text
  • y - Yank selected text
  • p - Paste over selected text

Installation

Chrome Web Store | Firefox Add-ons

Install from source

  • Check out this repository
  • Navigate to chrome://extensions in Chrome
  • Toggle into Developer Mode
  • Click on "Load Unpacked Extension..."
  • Select the docskeys folder

Usage

  1. Open a Google Doc
  2. Extension will automatically activate
  3. Start using Vim commands in normal mode
  4. Press i or a to enter insert mode for regular typing
  5. Press Esc to return to normal mode

Known Limitations

  • Most advanced Vim features like marks, macros, and registers are not supported
  • Custom key mappings are not supported
  • PR's are welcome to add these features

License

See MIT-LICENSE.txt for details.

About

Vim navigation in Google Docs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.5%
  • HTML 29.5%