glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.78k stars 146 forks source link

Any way to use the run nvim to edit directly and exit nvim go back to the broswer? #722

Closed woshichuanqilz closed 4 years ago

woshichuanqilz commented 4 years ago

Seems it wil be great if I can run nvim to edit when active a textbox in broswer. And when I exit the nvim the text I edit just now will fill in the certain textbox anyway to do it ?

glacambre commented 4 years ago

I can run nvim to edit when active a textbox in broswer

I don't understand what you mean. Firenvim starts neovim as soon as a textbox is focused. If this doesn't happen for you, there is probably a configuration issue on your side.

when I exit the nvim the text I edit just now will fill in the certain textbox anyway to do it

If you use :wq, the text should be inserted in the textbox. If you want to do this when moving the focus away from Neovim, you could try this, but using FocusLost instead of TextChanged. Know that some sites react very badly to this and you might end up in loops where the websites tries to focus the textbox and Firenvim tries to focus neovim.

woshichuanqilz commented 4 years ago

I mean when I active a textbox, I want auto start a terminal and run a nvim to edit the text.

Because I feel a little lag in firenvim maybe I feel wrong Just a personally feeling. But edit in terminal make me feel better.

And since I use some color theme in the browser the nvim appearance is not that good as in terminal.

Though I set the textbox size when I trigger firenvim, but some textbox size cant be changed for example edit in the tiddlywiki page, I dont know if you use it.

These 3 reason make me think open a terminal with nvim to edit is better

glacambre commented 4 years ago

I mean when I active a textbox, I want auto start a terminal and run a nvim to edit the text.

There are lots of extensions that already do this (e.g. GhostText) so I don't see the point of implementing this in Firenvim.

Because I feel a little lag in firenvim maybe I feel wrong Just a personally feeling.

There is indeed lag in Firenvim. I'm working on fixing some of it (see https://github.com/glacambre/firenvim/issues/347 for more information) but it takes time and some of the lag can't be fixed (because Neovim's RPC mechanism is inherently laggy).

some textbox size cant be changed for example edit in the tiddlywiki page

Have you tried using :set lines=20 and :set columns=200 to change the size of the neovim frame?