Skip to content

talha131/wasavi

 
 

Repository files navigation

wasavi (VI editor for any web page)

wasavi is an extension for Chrome, Opera and Firefox. wasavi transforms TEXTAREA element of any page into a VI editor, so you can edit the text in VI. wasavi supports almost all VI commands and some ex commands.

wasavi is underdevelopment. Any bug report or feature request is welcomed.

A Quick Walkthrough

  • Here is a native TEXTAREA

    native textarea

  • Focus the TEXTAREA, and press Ctrl+Enter to launch wasavi

    wasavi running

Salient Features

  • wasavi supports some ex commands. This is the output of :set all

    set all

  • Vim's incremental search

    incremental search

  • wasavi online app. Open this link on a browser that has wasavi extension. wasavi will launch automatically. Then you can read and write files at your Dropbox account.

    stand alone

How to install

Currently, wasavi is available for following browsers only. Select your browser and click the link. Standard extension installation procedure of your browser will follow. These extensions are hosted at the addons store of their respective browser.

Latest development releases can be downloaded from this link.

Source code is hosted at Github.

A note for Opera users

Opera does not support DOM3 Composition Event therefore input via IME is not available.

Frequently Asked Questions

How to launch wasavi

Focus TEXTAREA and press Ctrl+Enter.

How to quit wasavi

To quit wasavi press ZZ or :q or :wq or any other VI quit command.

How to use wasavi with Vimperator on Firefox

Put wasavi_mediator.js in your Vimperator plugin directory, for example, ~/.vimperator/plugin or %HOME%\vimperator\plugin.

This plugin will control the pass-through mode of Vimperator according to the state of wasavi.

On wasavi online app, enter :ignorekeys add ^http://wasavi\\.appsweets\\.net/ in Vimperator. Then Vimperator will always use pass-through mode for the online app. ignorekeys settings is stored automatically therefore you will not have to reenter it.

How to use wasavi as an independent text editor

Install wasavi extension and open the link to wasavi online app. wasavi will start automatically. You can use ex commands :read, :write, :edit or :file to access your Dropbox files. You will have to authorize wasavi via OAuth to access Dropbox.

I Have noticed a bug

Please create an issue on wasavi issue tracker

Tips and Tricks

  • to maximize the wasavi: :set fullscreen or :set fs
  • to restore the wasavi: :set nofullscreen or :set nofs
  • to change a color theme: :set theme=blight or :set theme=charcoal
  • to modify initial settings: open preference wasavi extension (or enter :options on wasavi), and edit "exrc" textbox.
  • abbreviate syntax is
    • :abbreviate displays all the abbreviations currently registered.
    • :abbreviate [clear] clears all the abbreviations.
    • :abbreviate lhs displays the abbreviation corresponding to lhs.
    • :abbreviate lhs rhs registers a abbreviation which expands lhs to rhs.
  • map syntax is
    • :map displays all the mappings currently registered.
    • :map [clear] clears all the mappings.
    • :map lhs rhs registers a rule which translates lhs to rhs. Its translation is recursive.
    • :map [noremap] lhs rhs also registers, but it is non-recursive.
    • :map targets the normal mode mappings. On the other hand, :map! targets the insert mode.
  • j k ^ $ moves cursor by physical row, on the other hand, gj gk g^ g$ moves by wrapped row. To swap the behavior: :set jkdenotative
  • f/F/t/T extension for Japanese: these commands recognizes reading (ro-ma ji expression) of hiragana, katakana, and kanji. For example, fk will place a cursor on '漢'.

Commands implemented

  • [count] operation [count] motion
  • [count] operation [count] range-symbol
  • [count] operation-alias
  • [count] motion
  • [count] scroll-command
  • [count] edit-command
  • : ex-command

Operations

c y d > < gq

Operations Aliases

cc yy dd >> << C Y D gqq

Motion

- + ^ <home> $ <end> % | comma(,) ; _ / ? ' ` ( ) { } [[ ]] <enter> 0 j k h l ^N ^P ^H <down> <up> <left> <right> <space> w W b B e E gg gj gk g^ g$ gi G H M L f F t T n N

Vim text objects (range symbol)

  • a" a' a` a[ a] a{ a} aB a< a> a( a) ab aw aW ap as
  • i" i' i` i[ i] i{ i} iB i< i> i( i) ib iw iW ip is

Scroll commands

^U ^D ^Y ^E ^B ^F <pageup> <pagedown> z<enter> z. zz z-

Edit commands

x X <delete> p P J period( . ) u ^R ~ ^L ^G m @ q r R a A i I o O & s S ZZ

ex commands

abbreviate copy delete edit file global join k map mark marks move options print put quit read redo s & ~ set registers to unabbreviate undo unmap version v write wq xit yank > < @ *

ex commands to specify address are fully supported.

absolute line number, relative line number, regal expression.

wasavi also accepts offset.

Input mode commands

^@ ^D ^H ^T ^U ^V ^W

^@ is actually ctrl+space.

^D accepts the last ^ and 0.

Line input mode commands

  • ^A: move cursor to top of line
  • ^B: back
  • ^E: move cursor to end of line
  • ^F: forward
  • ^H: delete a character
  • ^N: next history
  • ^P: previous history
  • ^U: delete whole line
  • ^V: literal input
  • ^W: delete a word

Vim features in wasavi

  • multiple level undo/redo
  • incremental search
  • range symbols (aka, Vim text objects)
  • register ", :, *, / (* is used to access system clipboard)
  • auto-reformat in input mode, and reformat operator (gq command) on the state of textwidth > 0
  • options: iskeyword, incsearch, smartcase, undolevels, quoteescape, relativenumber, textwidth

About

wasavi is an extension for Chrome, Firefox, and Opera. wasavi changes a textarea element to virtual vi editor which supports almost all the vi/ex commands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.6%
  • Java 33.0%
  • PHP 1.2%
  • Shell 0.2%