fox0430 / moe

A command line based editor inspired by Vim. Written in Nim.
https://editor.moe
GNU General Public License v3.0
655 stars 34 forks source link

Clipboard edit mode #761

Open tobimensch opened 4 years ago

tobimensch commented 4 years ago

I've not seen something like it in other editors, so this would be unique to moe, if implemented.

This mode could be activated with: :clipboard or :clip

And then you'd get the current contents of the clipboard in the normal moe editing mode, with the only difference being that you're editing the clipboard text instead of a file.

When writing with: :w

The system clipboard should be overwritten with the edited content of this clipboard buffer.

The idea is that you can copy text in your browser, open that text in moe with the clip command, then make some edits using normal moe operations, and then insert that changed clipboard content for example into an email application or whereever.

So with this mode moe could be used as an intermediary between other applications and the clipboard.

It could also be used for moe internally, so when you want to insert something from a clipboard, you can first edit it, then go back to your normal buffer and insert the edited clipboard content as many times as you like.

Note that there's a difference between clipboard contents and the current selection on X11 systems, so I'm not currently sure if there should be two modes like :clip and :selection. If both exist maybe clip could open a split window with clipboard contents being on top and selection contents being on the bottom. Not sure how to do that best.

fox0430 commented 4 years ago

@tobimensch

It's an interesting idea. I will implement in the future.