Automatically and non-intrusively add a vi editing mode to all textareas/inputs. Behaviour is unchanged until you hit Escape.

Latest Version

Version
0.0.10
Update
November 24, 2024
Size
32.85KiB
Developer
Category
Users
6
Rating
0 ★
Manifest Version
3
Web Store Status
Languages Support
English
See more
Permissions
See more

Vi Editing Mode Extension

Automatically and non-intrusively add a vi editing mode to all textarea/input
elements on pages, so you can use vim keys/shortcuts to edit and navigate text.
Inputs/textareas keep working as they normally do (like insert mode, handled by
the browser), hitting \"escape\" enables command mode on the focused element,
indicated with a box-shadow.

Features:
- Simple, automatic, non-intrusive vi editing.
- Command, visual and visual-line modes.
- Plenty of commands/keys (but please contribute more!)
- Multi-level undo and redo.
- Repeat.
- The tab key inserts literal tabs after having been in command mode, until the
element loses focus.
- Only basic addon permissions needed. (clipboard read/write permission
requested on first use).

Non-goals:
- vi-like keys for other browser behaviour, like navigating on a page or the
internet.
- Full-blown vi/vim editor (not all commands are needed, it doesn't have to
look like a standalone vi/vim, it would be too much for an input element).
- Marks, tags, macros, registers, custom key mappings and other advanced features.

# Limitations

Since vi.js uses basic textarea/input elements, it inherits some
limitations/behaviour:

Textareas don't expose whether text (e.g. the selection) is visible in the
viewport. This limits how vi.js can implement some commands/motions.

Insert mode is handled by the browser (with the exeception of Tab, which can
insert a literal tab), including undo/redo while typing. JS doesn't have access
to textarea undo/redo history. vi.js tracks history for changes it makes (based
on commands), and tracks changes during insert by comparing contents between
going into insert mode. The edits a user makes in insert mode are turned into a
single history change to undo/redo.

In vi/vim, the cursor is typically \"on\" a character. With a textarea, it is
shown between characters. The position at the end of the line, after the last
character, before the newline, is not normally a separate position in vi. vi.js
lets you navigate to these positions, which changes how some motion keys work.

Access to the clipboard is only explicitly with the \"y\" and \"p\" keys. Commands
that remove/replace text don't change the clipboard.

Not all input types are supported, browsers only allow editing selections on
some types: text, search, url, tel, password. Others don't work: email, time,
etc.

Popular messaging web applications have custom UI elements for sending messages,
for their rich text. They often don't use standard textarea/input elements, so
this plugin won't help with those apps.

Some applications use \"Escape\" as a shortcut to cancel. Use \"ctrl-{\" as
alternative. Unfortunately, the obvious alternative \"ctrl-[\" is interpreted by
firefox as \"back\" and can't be intercepted.

Plenty of vi/vim keys haven't been implemented yet. People typically use a
subset of all the many vi/vim key bindings. Please submit a PR for commands
you're missing and want. Keep the code maintainable.

The source code is Open Source, MIT-licensed, see https://github.com/mjl-/vijs.
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx",\t"manifest_version": 3,\t"name": "Vi Editing Mode",\t"version": "0.0.10",\t"description": "Automatically and non-intrusively add a vi editing mode to all textareas/inputs. Behaviour is unchanged until you hit Escape.",\t"icons": {\t\t"16": "icons/icon-16.png",\t\t"32": "icons/icon-32.png",\t\t"48": "icons/icon-48.png",\t\t"96": "icons/icon-96.png",\t\t"128": "icons/icon-128.png"\t},\t"content_scripts": [\t\t{\t\t\t"matches": [""],\t\t\t"js": ["vi.js"]\t\t}\t],\t"optional_permissions": [\t\t"clipboardRead",\t\t"clipboardWrite"\t]}
Read more

Similar Extensions

icon

Print Edit WE Extension · Productivity 6 313 ★ 104KiB

icon

Live editor for CSS, Less & Sass - Magic CSS Extension · Developer Tools 6 266 ★ 2.15MiB

icon

Vimium Extension · Productivity 6 4468 ★ 272KiB

icon

Copy Text Easily Extension · Productivity 6 55 ★ 66.36KiB

icon

Shortkeys (Custom Keyboard Shortcuts) Extension · Productivity 6 739 ★ 255KiB

icon

Ui.Vision Extension · Developer Tools 6 217 ★ 8.08MiB

icon

AI Chrome Extension powered by ChatGPT - Magictool AI Extension · Social & Communication 6 141 ★ 339KiB

icon

Vimium C - All by Keyboard Extension · Productivity 6 176 ★ 399KiB

icon

tabVertikal - vertical tabs Extension · Productivity 6 21 ★ 157KiB

icon

Surfingkeys Extension · Productivity 6 279 ★ 1.2MiB

icon

ProKeys Extension · Productivity 6 220 ★ 417KiB

icon

Web Text Expander: Text Shortcuts & Snippets Extension · Productivity 6 68 ★ 326KiB

icon

Free Auto Text Expander for Google Chrome™ Extension · Productivity 6 262 ★ 287KiB

icon

Text Blaze: Templates and Snippets Extension · Productivity 6 1335 ★ 730KiB

icon

Speak! - Speech-To-Text Smart Dictation Extension · Social & Communication 6 45 ★ 2.67MiB

icon

QuicKey – The quick tab switcher Extension · Productivity 6 117 ★ 441KiB

icon

Page Manipulator Extension · Developer Tools 6 35 ★ 2.17MiB

icon

Text Expander Extension · Productivity 6 7 ★ 539KiB

icon

Voice Master: Voice Recognition and Speech-to-Text Converter Extension · Productivity 6 4 ★ 66.4KiB

icon

AI Speakeasy Microphone for ChatGPT, Perplexity and Claude Extension · Productivity 6 11 ★ 2.64MiB

icon

Force Paster Extension · Accessibility 6 17 ★ 51.22KiB

icon

No-Tabs-Auto-Discard Extension · Developer Tools 6 6 ★ 35.28KiB

icon

Copy as Plain Text Extension · Productivity 6 24 ★ 39.63KiB

icon

Smart Paste Extension · Productivity 6 12 ★ 13.76MiB