News for hackers. Stuff that matters.
Re:Oni: Modern Modal Editing – Powered by Neovim by justinmk on Sunday March 25, 2018 @03:05PM (#16673886)
The project README.md doesn't do justice to the improvements that Oni has been pumping out.

Some new stuff in the unreleased/development version (hidden behind feature-flags):

* Keyboard-driven navigation of embedded web browser: https://twitter.com/oni_vim/status/977280220234268673

* Live reload with embedded browser: https://twitter.com/oni_vim/status/976502172891299840

However personally I just love the scrollbar: it shows viewport-relative position _inside_ the file-relative scrollbar. (maybe this idea was borrowed from some other IDE, but I haven't seen it before.)

P.S.: Yes, it's electron, but if you're not using terminal Vim/Nvim then you already have given up "minimalism" in favor of ... whatever advantage you ascribe to gVim.

Re:Oni: Modern Modal Editing – Powered by Neovim by bla2 on Sunday March 25, 2018 @03:51PM (#16674164)
MacVim or gvim is still a regular native app without a js vm and a web enviroment. It's less minimal then terminal vim, but way more minimal than electron.

I don't mind electron myself, but that ps sounds fairly disingenuous to me.

Re:Oni: Modern Modal Editing – Powered by Neovim by bringtheaction on Sunday March 25, 2018 @03:18PM (#16673962)
The kinds of things in your comment are the kind of things that make me consider actually installing Oni rather than just going "oh neat, people are making Neovim frontends" like I did when I first saw this post.

The only thing that makes me hesitate is because I run FreeBSD on some of my computers and FreeBSD support wasn't quite there yet for Electron apps last I checked. It may have changed in the meantime.

If I were to begin using an Electron app, I need to be sure that I will be able to use it on my FreeBSD computers also. This is especially important for editors and IDEs given that writing software is rather central among the things that I do. Currently I use Neovim for a lot of things and I use PyCharm for bigger Python projects.

I am wondering though, would it be feasible for one person (me) to rewrite Oni so that one can use it from within their web browser instead of with Electron?

Re:Oni: Modern Modal Editing – Powered by Neovim by montyf on Sunday March 25, 2018 @03:27PM (#16674012)
I liked the irony in this post, considering that the main draw of Electron apps is that they are supposed to be cross-platform. (To be fair though, FreeBSD is pretty niche.)
Re:Oni: Modern Modal Editing – Powered by Neovim by 1k2ka on Sunday March 25, 2018 @04:28PM (#16674394)
I don't consider any framework cross-platform unless it also targets TempleOS.
Re:Oni: Modern Modal Editing – Powered by Neovim by bryphe on Sunday March 25, 2018 @05:30PM (#16674710)
Would be interesting to see if we could compile Neovim via WebAssembly... If that's the case, it would certainly be feasible to run Oni in the browser with a few (minor) tweaks. The UI layer is react-based and would be trivial to run in a browser.

Interesting project that did something similiar for Vim: https://github.com/coolwanglu/vim.js/

Re:Oni: Modern Modal Editing – Powered by Neovim by yoz-y on Monday March 26, 2018 @06:25AM (#16677874)
Electron does provide quite a lot of apis that do not exist (and hopefully never will) in browsers. Namely, complete access to the filesystem. It also does provide a way of creating native plugins.

I have not looked into the way neovim communication works but from their site it seems to be using named pipes which are again, not available from a browser.

Re:Oni: Modern Modal Editing – Powered by Neovim by pjmlp on Monday March 26, 2018 @06:38AM (#16677915)
Access to the file system can be done via HTML 5 File API.
Re:Oni: Modern Modal Editing – Powered by Neovim by yoz-y on Monday March 26, 2018 @06:46AM (#16677936)
The File API is very limited in comparison what can be done with the Electron fs API which has direct access to the file system.
Re:Oni: Modern Modal Editing – Powered by Neovim by pjmlp on Monday March 26, 2018 @07:21AM (#16678037)
Which is a lame excuse for using Electron disguised as native app, in a connected world, even native apps should be sandboxed by default.

I seriously doubt it would be impossible to use Electron as it really is, a Web App.

Re:Oni: Modern Modal Editing – Powered by Neovim by yoz-y on Monday March 26, 2018 @08:51AM (#16678437)
As much as I prefer real native applications and like hating on electron, I have to give it some credit. It is not just chromium, it is chromium+nodejs and all the stuff that comes with it.

The answer to "would it be feasible/easy to port an Electron app to a pure browser app" is no. Unless all of the communication between the frontend part and the native tooling is done via sockets.

I agree that native apps should be sandboxed, however sandboxing something like an IDE will be quite difficult. Even Apple does not sandbox Xcode.

Re:Oni: Modern Modal Editing – Powered by Neovim by bringtheaction on Monday March 26, 2018 @10:24AM (#16679110)
> Unless all of the communication between the frontend part and the native tooling is done via sockets.

Admittedly I have not developed any Electron apps, but I have developed serious web apps and worked a little bit with NodeJS also.

Why don’t people do exactly that when they write their code — make all communication happen over regular HTTP and websockets?

Re:Oni: Modern Modal Editing – Powered by Neovim by yoz-y on Monday March 26, 2018 @11:02AM (#16679404)
Some data is not suited to go through asynchronous streams with a lot of parsing. At some point I needed to pass real-time eeg data to an application and we were exploring Cordova as an option. The jitter and absurd latency (over 15ms) was a non-starter. Things might have gone better but not everything can be solved by immutable data structures.

For comparison, the same data transfer using Electron native plugin took well under 1ms.

Re:Oni: Modern Modal Editing – Powered by Neovim by fwgwgwgch on Sunday March 25, 2018 @10:51PM (#16676246)
Can you tell us the benefits of running freebsd on a development machine?
Re:Oni: Modern Modal Editing – Powered by Neovim by bringtheaction on Monday March 26, 2018 @10:35AM (#16679182)
I just feel at home with FreeBSD. I mean it’s not perfect. That’s why I run FreeBSD on some and not all of my computers and instead run Linux on the rest (and also macOS on one of them).

I like the idea of the same group of people maintaining the kernel and the userland utilities.

Also I am strongly in favor of the family of BSD/MIT/ISC licenses over GPL.

I love ZFS. I think dtrace is neat. I think jails are nice. I like pf. Nowadays there are equivalents for pretty much all of that on Linux. In fact you don’t even have to go with btrfs to get something like ZFS on Linux — the ZFS on Linux project makes ZFS available on Linux too. But on FreeBSD all of these things are there in the base install without having to do anything special and they will continue to be there for a very long time.

All in all, I just like FreeBSD a lot, and I feel at home with it in a way that few other systems make me feel.

Re:Oni: Modern Modal Editing – Powered by Neovim by bryphe on Sunday March 25, 2018 @05:27PM (#16674694)
Thanks for your support, Justin! Oni wouldn't be here without the awesome work you've done:)

Neovim has been a joy to build on - fast, performant, and stable. Great example of a high-quality OSS project!

Re:Oni: Modern Modal Editing – Powered by Neovim by tambourine_man on Sunday March 25, 2018 @04:14PM (#16674307)
Native Mac apps can be crazy fast. Haven’t seen a reasonably fast Electron app yet. Plus you lose wonderful native Cocoa text features, such spelling, dictionary, undo, etc.
Re:Oni: Modern Modal Editing – Powered by Neovim by O_H_E on Monday March 26, 2018 @07:27AM (#16678056)
Sorry I never used a Mac, but how can undo be a "wonderful" features ???
Re:Oni: Modern Modal Editing – Powered by Neovim by tambourine_man on Monday March 26, 2018 @09:00AM (#16678488)
Undo on native Cocoa apps have a few delightful “smarts” that you begin to take for granted and can be infuriating when absent.

For instance, native undo is time and word sensitive. I don't know its exact heuristics, but it always seems to do what you meant.

Gmail's Chrome and Electron, on the other hand, will often undo letter by letter or leave you in mid typed words, which is nuts.

If you want another example, I often write in multiple languages, something that's beautifully handled for you on native apps. Since Skype changed to Electron, it puts a red underline on every single non english word I type and there is nothing that can be done about it, besides changing the default system language and restarting the app.

There's also CoreText's sharp line width in retina displays no matter which background/foreground color combination you choose, built in dictionary a tap away, etc.

It's just a dreadful experience otherwise, once you get used.

Re:Oni: Modern Modal Editing – Powered by Neovim by grzm on Monday March 26, 2018 @07:30AM (#16678063)
The features mentioned are built into the standard macOS toolkit, which makes them handily available and consistent between applications. I don't think they were listing them for being unique as much as pointing out the feature consistency.
Re:Oni: Modern Modal Editing – Powered by Neovim by Zardoz84 on Sunday March 25, 2018 @06:23PM (#16674993)
you can use nvim-qt or neovim-gtk and keep having a minimalism experience.