DocsKeys (Vim for Google Docs)

Vim-style keyboard shortcuts for Google Docs. Ported from the DocsKeys extension.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
icemoss
今日安裝
0
安裝總數
3
評價
0 0 0
版本
1.3.4
建立日期
2026-01-09
更新日期
2026-01-11
尺寸
17.0 KB
授權條款
MIT
腳本執行於

Vim for Google Docs - DocsKeys Port

This script brings Vim-style navigation and editing to Google Docs. It is a port of the DocsKeys extension, designed to run as a lightweight UserScript via ViolentMonkey or TamperMonkey.

It simulates keypresses directly into the Google Docs editor, allowing for familiar Vim motions without needing a heavy browser extension.

Features & Key Mappings

Modes

  • Normal Mode: Default state. Navigate and manipulate text.
  • Insert Mode: Type normally. (Press Esc to return to Normal Mode).
  • Visual Mode: Select text character-by-character (v).
  • Visual Line Mode: Select text by line (V).

Navigation (Normal Mode)

  • h, j, k, l: Left, Down, Up, Right
  • w / b: Next word / Previous word
  • e: End of word
  • 0 / ^: Start of line
  • $: End of line
  • gg: Top of document
  • G: Bottom of document
  • { / }: Paragraph Up / Down
  • Ctrl+u / Ctrl+d: Page Up / Page Down

Editing

  • x: Delete character
  • u: Undo
  • r: Redo
  • dd: Delete (Cut) current line
  • yy: Yank (Copy) current line
  • Ctrl+v: Paste (due to browser security, p to paste is unsupported)
  • dw: Delete word
  • cw: Change word (delete word and enter insert mode)
  • D / C: (Not fully implemented, use d$ or c$)

Insert Mode Entry

  • i: Insert before cursor
  • I: Insert at start of line
  • a: Append after cursor
  • A: Append at end of line
  • o: Open new line below
  • O: Open new line above

Visual Mode

  • v: Start character selection
  • V: Start line selection
  • Standard movement keys (h, j, k, l, w, $, etc.) extend the selection.
  • y: Yank selection
  • d: Delete (Cut) selection

Search

  • /: Open Google Docs Find tool

Count Support

Most motions support numbers.

  • 10j: Move down 10 lines
  • 5w: Move forward 5 words