
Oni – Modern Modal Editing - jbernardo95
https://www.onivim.io/
======
macrael
I've been writing code for ten years, I've been fairly comfortable in vim at
times, customizing it and navigating with the keyboard full time.

I find myself using the mouse all the time, and I don't understand this
obsession with mouse-less text editing. The mouse lets me perform selections,
and with some key-combos in sublime text sets me up for multiple cursor
editing very nicely, in ways that would be much much more complex if I were
trying to do them in vim.

I've always wanted to try out Acme, a mouse-first editor from plan nine, with
all of this obsession with cutting the mouse out entirely, it feels like there
is space for an editor to really consider what the mouse can be used for.

~~~
justinpombrio
> I don't understand this obsession with mouse-less text editing

For your information: the issue with mouse-laden text editing is that you need
two hands on the keyboard to type, so you are repeatedly moving a hand between
the keyboard and the mouse. This takes time: in my experience enough time that
it's often faster for me to use keyboard navigation _anyways_. Plus the
constant wrist motion can be bad for RSI.

That said, if you can edit more efficiently with the mouse, and your wrists
don't hurt, then go for it.

~~~
Avshalom
Mice are moved with the shoulder and elbow, not the wrist.

~~~
fyolnish
Don’t they move the wrist that moves the hand/fingers which then move the
mouse?

------
jswny
Well at least for me the best of Vim includes running my editor in a terminal,
so I wouldn't quite say that Oni has the best of Vim.

~~~
edanm
You know, I've always been fascinated by this statement. _Why_ is it more
comfortable for you to be in a terminal?

(For the record, I currently use Macvim but am deeply interested in Oni and
other projects. I've been a vim user for many years now and consider myself
reasonably proficient, although, you know, it's vim after all, there's always
more to learn).

~~~
akkartik
Because I already live in my terminal for everything else, and I'm constantly
opening and closing my editor, and that's slower when it spawns a new window.

I recently installed a plugin that lets me open MacVim with a shortcut
([https://github.com/cknadler/vim-anywhere](https://github.com/cknadler/vim-
anywhere)). Everytime I use it I remember why I avoid the GUI.

~~~
edanm
I don't really understand the "line in my terminal for everything else"
reasoning, as I don't mind alt-tabbing.

But I _really_ don't understand the "constantly opening and closing my editor"
thing. I'm usually working on one or two projects at a time at most, and just
keep a window open to that project. This is pretty much how most people work.
Why doesn't that work well?

I'm genuinely asking btw. I'm not sure _why_ loving vim is so correlated with
working with your editor in such an unstandard way. (I mean, I'd guess it's
the opposite - people like me come to vim for reasons having nothing to do
with that, and try to use it like our old IDEs, whereas people who started off
wanting to do everything in the terminal look for a solution and find that vim
fits them. But that's just a guess).

~~~
akkartik
Treating your shell as the environment and an editor as just one tool among
many is a perfectly internally-consistent approach. Standard, even,
considering how many of us do it. I don't claim it's the only workable way. Do
us the same courtesy.

~~~
edanm
"I don't claim it's the only workable way. Do us the same courtesy."

I'm sorry, I didn't mean to offend. As I said - I'm genuinely curious as to
what you feel makes this method better. I wouldn't be wasting my time asking
if I didn't think there was a chance I might learn something that would make
me change the way I work - that's how I picked up vim in the first place, not
to mention every other improvement I've ever made in my life.

~~~
akkartik
It's all good, just be careful with words like "standard" and phrases like
"like most people". They can subconsciously hinder learning.

This is a subject that has been hashed to death online, especially in Vim vs
Emacs discussions. Emacs behaves more like an IDE, as an environment rather
than a tool. Vim is further along the tool side of the spectrum (though I
sense Plan 9's Acme is even further along; Vim is actually pretty moderate,
believe it or not). Gvim tries to bisect the difference, but I find it to be
the worst of both worlds: not as nice an experience as say Idea or PyCharm,
but also encouraging "bad habits" from the terminal point of view, such as
using the mouse. Or navigating where you are in the system from within the
editor rather than the shell.

I actually do use multiple windows and Alt-tab between them. It's just that
most of them are terminal/shell/tmux windows. I do use other apps too (like a
web browser). But for text processing and navigation the shell is what I like
best.

Anecdotally Vim users seem more sensitive to even small latencies, and GUIs
invariably seem to introduce lag. Though I'm finding that I'm more tolerant of
lag in my non-shell windows. Using VimAnywhere has made that clear because it
causes the "universes to collide".

This whole question is actually not that important, in my opinion. You were
right above that it's mostly about what way you start out in. If you're
reasonably effective with one set of tools, to try to switch is to bait big to
catch small. There's far better uses of your time out there. Perhaps the only
thing to learn is that there are many ways to skin the cat. There, now move
on.

------
kzrdude
Looks cool. They seem to say it's based on neovim, so it's actually an
interface to the real thing, then. A shame their website is so cryptic and the
link to their source control host is not easy to find.

~~~
theknarf
There's a big github icon on the front page up to the right leading directly
to their git repo...

------
theknarf
Oni is really cool, but still early days. Since it's just a frontend for
neovim it actually seems to use less ram than Atom and VSCode. But VSCode has
a big head start and a team behind it optimizing stuff the best they can. I'd
love to see where Oni find itself in a year or two as I do believe that it
could outperform VSCode in the future. Both Oni and NeoVim got a long road
ahead of work.

------
jchw
I hate these posts, because Hacker News is incapable of talking about an
Electron based project productively.

Yeah, it could be done more efficiently without a full blown browser engine,
everyone knows that. But honestly, who doesn't already get that? It hasn't
stopped me from using VS Code regularly, which is already more performant than
IntelliJ imo, an app that doesn't use Electron.

Almost everything that can be said on this front has been said. Does it really
need to be the top 3 comments every time?

~~~
jrq
I understand your frustration, but in a world with a dozen different languages
to choose from for cross platform native desktop apps, there's very rarely a
case to be made for electron even existing.

I'm not trying to prove your point by making the insufferable comment that you
hate and already expect, so please understand I am genuinely interested:

Why would, or why should, a person interested in creating a cross platform
desktop app, choose electron?

If it's just to use their favorite web components to design with, is that
really a good enough reason? When GTK and Qt both provide js api capabilities,
what else is there to gain?

Please understand, I'm not a web developer, I'm not familiar with most of it,
but just the thought of 100+MB overhead for an app is completely unacceptable
to me. But again, the benefit of using web tech is lost on me.

~~~
zamalek
Apart from VSCode, I'm also not a fan of Electron - but I do understand why
people use it.

> When GTK and Qt both provide js api capabilities, what else is there to
> gain?

It's the HTML5. How would you write an xplat editor with GTK or QT? The
obvious answer is to use Scintilla and after some Googling surrounding getting
that right, you're successful! Now you want to start innovating the editor,
with both the speed and bravery that the VSCode team do. Now you have
problems.

As much as I despise HTML5, it does provide a canvas that behaves consistently
across platforms (so long as your browser is consistent, which Electron is). I
can't see why you'd use it for a music app or so forth, but rendering a text
editor is a surprisingly difficult task - it does present genuine benefit in
this field.

You could use OpenGL or Vulkan, but then you'd spend your life writing the UI
framework and wouldn't have the xplat layer that NodeJS offers.

~~~
jrq
So what electron developers appreciate is an easily accessible markup+canvas?

Text editors are a great example, they're very difficult to get right.

I wonder why more desktop GUI platforms aren't equipped with something similar
to html5->native markup.

Thanks for your comment, that clears up the question of appeal for me a bit. I
can see how much frustration is saved in a project like vscode by using
electron.

~~~
zamalek
> html5->native markup.

I'm personally a bigger fan of XAML (done right, with MVVM) for that purpose,
but it's unrealistic because XAML is dead. So ultimately I agree, there should
be a browser of sorts for highly trusted apps. Electron is a runtime, it
shouldn't be bundled with every app that uses it.

~~~
pjmlp
Maybe I should tell that to the guys that have paid my bills for the last 4
years.

------
city41
Oni is Electron based. But since it uses neovim as its backend and a canvas
based renderer the performance is actually very good.

~~~
pault
There's a webgl renderer behind an experimental flag that is about 10x faster
than the canvas renderer :)

~~~
city41
Wow, that's awesome. Honestly vanilla vim is often not that performant due to
limitations of how terminals work. I wouldn't be surprised if OpenGL onivim
could outperform terminal vim in a lot of scenarios. How does it compare to
gvim's performance?

~~~
pault
I haven't compared it to gvim, but gvim seems like it would have the upper
hand there since it is native. There's also the fact that no matter how fast
the renderer is, it can never be faster than the neovim instance running under
the hood. I do not have any detailed knowledge of the internals though, so I
could be wrong.

------
weliketocode
The best of Vim and any combination of other editors is still just Vim.

~~~
jamespo
emacs viper mode you mean ;)

~~~
Y_Y
ESC^wcwevilESC:x

~~~
BalinKing
Goooooo, Spacemacs!

------
llimllib
I'm very interested in the idea, but unfortunately it was way too laggy for
me. Noticeable lag just moving the cursor around prevented me from taking a
deeper look.

------
soperj
I've used the 0.3.1 version. Waiting for the ability to open multiple projects
at once before it becomes a daily driver. Thanks for all the great work :)

~~~
bryphe
Thanks soperj for the kind words! Hope we can get that soon; that's a feature
that would be useful for my workflow as well!

------
CJefferson
EDIT: the title used to be "oni: better than vim, atom and VSCode".

It seems the title comes from the submitter here, rather than the web page.

I've looked at this, and as a VSCode user, it is not at all a useful
replacement, it's barely usable for me. Also VSCode has a lots of useful
plugins, which aren't support here.

I'm sure if I learnt all the vim shortcuts it would be great but then I'm
using VSCode because I don't like vim.

~~~
wreath
This is exactly why I moved from Oni to VSCode with neovim embedded.

Oni was just way too slow and i couldn't use the plugins i needed from my
previous vim setup. I switched to VSCode and now I get best of both worlds!

~~~
eridius
How do you embed neovim in VSCode?

~~~
Arcuru
The vim extension for VSCode can use neovim for Ex-commands, though that's
still an 'experimental' feature.

------
johnchristopher
I like Oni but last time (a week ago) I tried it I went into the config file
to change the colourscheme and the doc wasn't helpful at all. I think it
somehow can take a vim config file but it wasn't really clear.

~~~
pault
There's a decent wiki article on the configuration file:
[https://github.com/onivim/oni/wiki/Configuration](https://github.com/onivim/oni/wiki/Configuration)

I use "oni.useDefaultConfig": false and "oni.loadInitVim": true and use it
basically the same way I use terminal vim, but with language server
autocomplete thrown in for free.

------
nightcracker
I tried Oni, but it fundamentally doesn't understand buffers.

~~~
pault
If you set the config option "tabs.mode": "tabs" it will behave like a normal
vim.

------
nategri
Yeah you can go ahead and miss me with every single one of these vim-via-
Electron monstrosities.

CLARIFICATION: For me the whole point of learning vim was that it's
lightweight and ubiquitous. Stuff like this is 0 out of 2 on that front.

~~~
ryanmarsh
On that note, I'm still waiting on a lightweight vim clone with a sane
plugin/command system.

I'm glad everyone likes vim as an editing style. I do to and would prefer to
use vim, however I was able to get VS Code configured with plugins how I want
to work in a matter of minutes, as opposed to wasting days upon days (over my
life probably a solid month) trying to get a sane vim config that works with
my languages and tools.

~~~
pault
Have you tried spacevim? [https://spacevim.org/](https://spacevim.org/)

