rhysd / vim.wasm

Vim editor ported to WebAssembly
http://rhysd.github.io/vim.wasm
5.51k stars 145 forks source link

Add support (or instruction) for pasting from clipboard #27

Closed benjaminoakes closed 5 years ago

benjaminoakes commented 5 years ago

Is your feature request related to a problem? Please describe.

I couldn't paste some code I wanted to reformat. Felt like vim.wasm could possibly do this, (mostly for convenience) on a Chromebook. 😄

In particular, I wanted a simple reformat, which I knew I could do quickly in Vim:

In:

#Array
#Complex
#Float
#Hash
#Integer
#Rational
#String

Out:

(`Array()`, `Complex()`, `Float()`, `Hash()`, `Integer()`, `Rational()`, `String()`)

Describe the solution you'd like

Add support for pasting via Ctrl-V/Cmd-V, "+p, or another solution. Add a short blurb somewhere on the page describing this.

Additional context (if any)

n/a

rhysd commented 5 years ago

Yeah, with tiny feature, Vim has its internal clipboard and it is not synchronized. I want to try this after enabling larger feature.

rhysd commented 5 years ago

After small investigation, synchronizing clipboard would not fit to this app because

Considering these points, I want to implement clipboard support only for "* clipboard register.

Note that we need to consider the case where user does not permit access to clipboard. In the case this feature is simply disabled.

rhysd commented 5 years ago

This was implemented at 7de8e98.

Clipboard register "* is supported. For example, paste system clipboard text to Vim with "*p or :put *, and copy text in Vim to system clipboard with "*y or :yank *. If you want to synchronize Vim's clipboard with system clipboard, :set clipboard=unnamed should work like normal Vim.

tmp