Oni: Beginning external status line implementation

Created on 7 Feb 2017  路  13Comments  路  Source: onivim/oni

I think at this point, getting an external status-line skeleton going would make us prepared for RFC 5686 in Neovim when it inevitably gets merged in. I literally wouldn't know where to even start on something like this, so any help or suggestions would be appreciated.

Once we have something like this up and running, I would hope to see something capable of being customized to no end. I personally love my status line in tmux, using plugins that enable notifications for weather, email, etc. I think having (optionally, but as a feature) this going would be attractive to new users.

enhancement

All 13 comments

Definitely, I agree 100%! I was just thinking about this in the context for all our UI - comparing oni to something like VSCode, Atom, or Sublime, it still does not look modern. I think creating skeletons for some new UI pieces like tabs, window splits, etc would go a long way - but that statusbar here is the perfect place to start.

I agree with the customizability. The weather, e-mail, etc are really cool ideas.

I'll see if I can get a chance to put together the skeleton shortly, and then we can work together on finalizing it and prototyping some of the extensions, if you're up for it!

@extr0py thanks, and if there's some way you could keep me up to date, I think seeing how this project grows will help me understand how this project actually works. Right now there's like 3 files that handle logic that I understand. Anything GUI related as of right now is still magic to me :)

Sure, I'll loop you in on the PR requests as I go. Yes, there's definitely some complexity - I'm trying to keep the UI components (autocomplete, quickinfo, pop up menu, etc) as decoupled as I can from Neovim - so they are almost entirely driven by the store state. There will be opportunites to clean things up / simplify too as we start adding some of these new UI extensions.

I'm thinking about some of these as initial first steps:

  • Rename overlay-ui -> ui
  • Create container
  • Create container like:
<Oni>
<Editor>
<Window>
<Neovim>
<...>
</Window>
</Editor>
<Status>
</Oni>
  • Move background into that concept

Then, create some hooks for the status bar - I'd like to have some JS extensibility via the Oni plugin interface, and we'll need to make sure it will support the messages coming from Neovim's msgpack-rpc API as well

@bryphe Is there a way to disable the statusbar of neovim? Checking the documentation oni there is statusbar.enabled, but setting this to true still show the statusbar of oni and neovim. Is there a documentation about this that I missed?

@Govinda-Fichtner, setting "statusbar.enabled": false, will only disable the Oni status bar, ie:
image

Is it possible you are seeing the neovim default status bar? If you have disabled the Oni default config, and don't have set laststatus=0 in your config, you'll end up with something like this if you disable the status bar:

image

@CrossR I actually want the oni statusbar enabled, but I want no additional neovim statusbar. I already have all the information I want in the oni statusbar.
How do I get rid of the "1,1 ... All"?

screenshot 2018-05-11 18 29 16

@Govinda-Fichtner this part of the Oni default config deals with the status bar, might be useful to copy it over into your custom init.vim:

https://github.com/onivim/oni/blob/517280af3a1b30df84bec8f643bd20b111a7312c/vim/default/bundle/oni-vim-defaults/plugin/init.vim#L8-L12

You can easily edit that from Oni with File > Preferences > Edit Neovim Config.

If you are using the default config (ie you haven't set "oni.useDefaultConfig": false, in your Oni config) then its a bug, so it'd be worth raising an issue about it.

Though, looking at your dotfiles, I can see you've set some of that config already, assumedly for terminal neovim, in which case you may want instead to use:

if exists('g:gui_oni')
    set noshowmode 
    set noruler 
    set laststatus=0 
    set noshowcmd 
else
    set showcmd
    set showmode
endif

And remove the existing calls to showcmd and showmode. That way you get the config you like in terminal neovim, and a nicer experience in Oni.

@CrossR That is awesome. That was exactly what I was looking for. Thank you!

I already was suspecting it had something to do with me disabling the oni default config. Where would I find the default neovim config oni-vim uses?

screenshot 2018-05-11 19 02 18

Is there a way to make this message ("Portkey: Loading ... ") you can see in that screenshot also appear in the oni statusbar?

That would just be here : https://github.com/onivim/oni/blob/master/vim/default/bundle/oni-vim-defaults/plugin/init.vim

I think so, but its a bigger change for both Oni and Neovim itself. There is a PR for neovim to pass us that I think, so we can render it how we want. Its not merged yet, and we haven't done any testing with the PR build (which we should), but it is coming later. (I think its this PR : https://github.com/neovim/neovim/pull/7466). So the answer is not currently, hopefully soon!

If I get some time after my exams and what not, I might look into doing it since it would be nice to externalise them for sure.

@CrossR Thanks for that input. I am really excited by Oni. Currently I am still trying to figure out where Neovim ends and Oni begins. I have some experience with vim and I would like to contribute to Oni. Maybe as a first step I would like to contribute to the documentation - but to do so I still need to ask a lot of dumb questions myself. Sorry for that.

@CrossR Regarding dumb questions - is there a Gitter/Slack or IRC channel where people hang out? I have another question :(

Is there a way to make the explorer window wider and smaller with a key binding. Ideally this would be the same you usually use to increase or decrease the size of normal vim windows...

We have a gitter but most of the chat has migrated to discord, the link for that is at the top of the website here (4th link along): onivim.io.

As for resizing the explorer, its a known issue but I think so far we've (I saw we, @Akin909 has basically done all of the cool recent stuff) been focusing on adding features first. There is an issue about it, and I do agree it would be nice tho, I find myself wanting it a bunch. (#1414)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rococode picture rococode  路  20Comments

jordan-arenstein picture jordan-arenstein  路  22Comments

ghost picture ghost  路  23Comments

badosu picture badosu  路  20Comments

phaazon picture phaazon  路  21Comments