Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

WIP Quickopen Enhancements #635

Closed
wants to merge 6 commits into from

Conversation

cyansprite
Copy link
Contributor

@cyansprite cyansprite commented Aug 20, 2017

Progress Made

Can select more than one item now

  • c-i increments/decrements
  • On enter/c-v/c-s opens all the incremented in buffers and whichever you enter/c-v/c-s on it will give that one focus.

Can quickopen for colorschemes

  • recaches each request due to not having a way to check if it updated outside of vim, it's fast so... I don't see this being a problem.

Fixed quickopen overflow with small windows

  • Max width to cap at 600px (width before)
  • width defaults to 70%
  • details overflow-x: hidden so they aren't floating in random space...

Force open bookmarks

  • Sometimes I want to open them even if I'm in a cwd other than home/install.

TODO

  • Force open bookmark/select folder
  • Colorschemes activate on select instead of actually having to hit enter, this way you get a live preview of the colorscheme and you don't have to reopen each and everytime.
  • Ignore binary files for all file gathering.
  • Work on speed improvements
  • Async files for things other than git folders
  • State bg/fg colors for neovim to have for oni QO menus
  • Cache files on directory change/construction
  • Update ignore (we will use .gitignore kind of ignore)
  • Be able to type as things load...
  • Refine input field typing experience.
  • Make incrementing only available for certain QuickOpenTypes, currently this would be files.

Future TODO

  • Cache files when we figure out projections/workspaces.
  • Searching through search results
  • Implement loc list with incrementing buffer lines and search results.
  • Buffer lines for ALL active buffers.
  • Preview and silent loading of buffers
  • * [ ] Make editing shortcuts for (nvim temporary buffer/instance)
    • State popup bg/fg colors for neovim to have for oni AutoComplete menus

Gif Showing Basics Done so far.

  • Scrollbar... this is going to be fairly complex due to us only using 10 items right now, but... it shouldn't be that bad.
  • Figure out what color to make the highlighting. (Use a light bg you'll see what I mean.
  • Make incrementing loading play with tabs better so it's not slow on many file selections.
  • Quick Open support for buffers
  • Have an option to ignore hidden files/folders
  • Prefix support
    • : - vim command mode for current window
    • / - buffer search (integrate with the buffer search you added)
    • ! - oni command mode (same commands shown in Ctrl+Shift+P)
    • '`' - show available vim marks
    • & - show available buffers
    • Others....

- Can select more than one item now
- Can quickopen for colorschemes
@bryphe
Copy link
Member

bryphe commented Aug 20, 2017

Wow, really cool stuff in the gif! I like the colorscheme switching a lot 😄

And cool list - it's neat to see the progress indication on the PR.

Make editing shortcuts for ease

One thing I was thinking about this - is I think there are going to be a few places in Oni where we will have a 'lightweight' edit experience (like a small textbox). A few scenarios I had in mind for this:

  • QuickOpen (obviously)
  • Rename experience in the file explorer (press 'F2' or some bound key to trigger a rename, and a small textbox opens over the folder)
  • Snippet editing - tracked by Feature - Snippets #55

But for all these cases, it'd be nice to have a the full set of neovim key bindings I have configured (, , etc). I was thinking, potentially, of having these textboxes essentially be tiny neovim windows - so that we could use neovim to process the keybindings.

That would be a bigger chunk of work, and depend on some of the initial multiplexing changes, so it might make sense to defer that piece (if that approach makes sense).

Scrollbar... this is going to be fairly complex due to us only using 10 items right now, but... it shouldn't be that bad.

We might be able to remove the '10-item' limit and use something like https://github.com/bvaughn/react-virtualized to only render a subset.

There were a couple of other things I was thinking top-of-mind too:

  • Having the Menu use the current color schemes background / foreground colors - I noticed I had to darken up the background fade a bit, but it looked really nice - and might look even cooler with your colorscheme switcher!
  • Have an incremental-loading experience. Like right now, if there is a big folder, we show "Loading..." but then don't show any results until everything is available. Most fuzzy-finders start showing files/results as soon as they can - that would be a huge experience improvement.

Looking awesome!

@cyansprite
Copy link
Contributor Author

cyansprite commented Aug 20, 2017

And cool list - it's neat to see the progress indication on the PR.

Didn't realized it did progress I just wanted a nice list :).

But for all these cases, it'd be nice to have a the full set of neovim key bindings I have configured (, , etc). I was thinking, potentially, of having these textboxes essentially be tiny neovim windows - so that we could use neovim to process the keybindings.
That would be a bigger chunk of work, and depend on some of the initial multiplexing changes, so it might make sense to defer that piece (if that approach makes sense).

If we use the single neovim instance strategy we could use a temporary hidden buffer that the user doesn't have to know about (i.e. we don't show hidden buffers and unless they open it with buffers! they won't ever know, if they close it we can just open it again...) and so we can use this temporary buffer, use setline()/getline() and that will be our input field, this way we don't have to wait for a new spin each and every time, we can just edit the buffer as the text field tied to it, and then we can edit just like any other neovim buffer... it's a bit complex but it's a wildy awesome idea and I would enjoy this a lot, but I don't even know how it's hooked up to begin with but, yeah.
Optionally we can have an entire nvim instance to itself... and other things we might want nvim to use but the user never interact directly, that might be an even better plan.
We could have nvim multiplexing or a neovim singleton, and then a nvim singleton for temporary operations like text inputs.
This kind of goes inline with #633

We might be able to remove the '10-item' limit and use something like https://github.com/bvaughn/react-virtualized to only render a subset.

I will look into that.

Having the Menu use the current color schemes background / foreground colors - I noticed I had to darken up the background fade a bit, but it looked really nice - and might look even cooler with your colorscheme switcher!

I plan on adding a bg/fg color to the state by using &bg/&fg, if these are null then use default (i'm not sure what this is in nvim I've never looked at it honestly without a color for normal...)
On source/color scheme loaded recache these values, that way we can use them for our menus.

Have an incremental-loading experience. Like right now, if there is a big folder, we show "Loading..." but then don't show any results until everything is available. Most fuzzy-finders start showing files/results as soon as they can - that would be a huge experience improvement.

We need a solution, I can use my binary to do this but there is not a good way in typescript without writing an algorithm or porting a library and their dependencies, however I think a solution implemented in typescript may not be the best solution but using something like ag/ripgrep/etc that way we can stream async and we don't use a scripting language that can't optimize as other coding bases.

@cyansprite
Copy link
Contributor Author

@cyansprite
Copy link
Contributor Author

currently writing a manual find, it's working pretty nice, almost done.

@cyansprite
Copy link
Contributor Author

typescript, only dependency is fs and ignore

@cyansprite
Copy link
Contributor Author

going to add support for a config ignore and config use global ignore ~/.gitignore

@keforbes
Copy link
Collaborator

These will be awesome enhancements, but could you add "update README" to your list of todo's? We need to be sure to track all the various key combos we're introducing, especially when there isn't a (neo)vim equivalent.

@cyansprite
Copy link
Contributor Author

cyansprite commented Aug 21, 2017

These will be awesome enhancements, but could you add "update README" to your list of todo's? We need to be sure to track all the various key combos we're introducing, especially when there isn't a (neo)vim equivalent.

Once I have a concrete list :) This is more of a guide really.

- Don't show directories
- Don't recurse if it's not a directory
- Explain oni.config
- Use relative path instead of absolute, in long directories this could
be VERY annoying...
- For git ls-files and overriden command also filter user/global ignore
and binary extensions.
@bryphe
Copy link
Member

bryphe commented Aug 24, 2017

Sorry I'm a bit late to the party here! Was (finally) reading through the comments 😄

I really liked this:

If we use the single neovim instance strategy we could use a temporary hidden buffer that the user doesn't have to know about (i.e. we don't show hidden buffers and unless they open it with buffers! they won't ever know, if they close it we can just open it again...) and so we can use this temporary buffer, use setline()/getline() and that will be our input field, this way we don't have to wait for a new spin each and every time, we can just edit the buffer as the text field tied to it, and then we can edit just like any other neovim buffer... it's a bit complex but it's a wildy awesome idea and I would enjoy this a lot, but I don't even know how it's hooked up to begin with but, yeah.
Optionally we can have an entire nvim instance to itself... and other things we might want nvim to use but the user never interact directly, that might be an even better plan.
We could have nvim multiplexing or a neovim singleton, and then a nvim singleton for temporary operations like text inputs.
This kind of goes inline with #633

Sounds like we're exactly on the same page here! That's exactly how I was thinking of using it. I forgot to call out one use case I want to pursue also - I'd like to have an embedded browser in Oni (which is basically free, because Electron), and then use Neovim to manipulate text inputs. I think it'd be really helpful, at least for me, to be able to pop open github and use the keyboard to navigate around (#361) and use all the neovim-power I have to write text in the issues. Lots of cool possibilities!

- Ignore image extensions, need to add more and more binary.. maybe
convert to json? Idk strings are pretty easy.

- Fixed ignore for git files so we ignore binary and image as well as
global git ignore, need to add .oniignore, but maybe not? We have it
already as a setting do we really need another config file?

- Re-filter input if still loading directories (This is a big edge case)

- Cache files on dir changed and construction, that way if we don't move
dirs which most of the times people don't, it will just have the files
saved, ready for loading.

- Manual walk enhanced.

Noticed a bug in overriden commands, doesn't seem to work at all with
ag, need to investigate if it's just ag -l --nocolor or if it's others
as well, git works fine... weird.
@cyansprite
Copy link
Contributor Author

cyansprite commented Aug 24, 2017

Sorry I'm a bit late to the party here! Was (finally) reading through the comments 😄

You're good, I've been super busy so sorry about the late commits.

Sounds like we're exactly on the same page here! That's exactly how I was thinking of using it. I forgot to call out one use case I want to pursue also - I'd like to have an embedded browser in Oni (which is basically free, because Electron), and then use Neovim to manipulate text inputs. I think it'd be really helpful, at least for me, to be able to pop open github and use the keyboard to navigate around (#361) and use all the neovim-power I have to write text in the issues. Lots of cool possibilities!

And I would LOVE to be able to do normal day to day things with the power of neovim, sounds revolutionary in a way :P.
I wonder what would best to start implementing this, probably your change you are making would be a good start, then when I'm done with this PR I can try and get it to work for the input field, then that should make a pretty clear pathway for the rest.

If you don't care test it out, it works great for me, however like my commit says the overridden command doesn't seem to work.

@cyansprite
Copy link
Contributor Author

@extr0py
Also, this is the plugin I've been working on.
It might be buggy, if you find anything please let me know!
https://github.com/cyansprite/Extract

@cyansprite
Copy link
Contributor Author

Nice gif for progress being made

@bryphe
Copy link
Member

bryphe commented Aug 28, 2017

Wow, that's awesome! Can't wait to have that integrated. It's so cool to see the changes to setting & configuration made real-time

@bryphe
Copy link
Member

bryphe commented Aug 28, 2017

And thanks for linking the plugin, I'll check it out in a bit! I read through the README and it sounds interesting. I need to test it out / see how to map in my workflow. Yanking into a list and being able to grab from the list in a convenient manner sounds interesting, especially when you are juggling multiple items you want to store.

@cyansprite
Copy link
Contributor Author

Wow, that's awesome! Can't wait to have that integrated. It's so cool to see the changes to setting & configuration made real-time

Yeah I was super happy with the color-scheme outcome.

And thanks for linking the plugin, I'll check it out in a bit! I read through the README and it sounds interesting. I need to test it out / see how to map in my workflow. Yanking into a list and being able to grab from the list in a convenient manner sounds interesting, especially when you are juggling multiple items you want to store.

Thanks, from when I use it it's pretty useful, I haven't found any bugs since the initial commits ( I think 14 while demoing? )
However, there are a few improvements I can think of, let me know how it goes!
As far as I can tell it works with Oni, as it should since it works in vanilla neovim as well.

@Bretley
Copy link
Contributor

Bretley commented Oct 10, 2017

@cyansprite: I don't know how familiar you are with helm, or if this is within your skillset/goal here, but do you think you could generalize the quickOpen?

I could imagine this replacing wildmenu/cmdline pretty easily, all we'd have to do is have the user give us an activation action, a list of things to choose from, and a final behavior

just a thought

@cyansprite
Copy link
Contributor Author

@Bretley Feel free to take it over, I'm not working on this anymore, it's more of just staying here until @bryphe decides it's no longer necessary, I don't have time to work on Oni anymore fortunately.

@Bretley
Copy link
Contributor

Bretley commented Oct 10, 2017

@bryphe since I haven't been here for a while, is this a Proof Of Concept or is this something wand merged in? I'm not saying I'd be able to do it, but I could try!

@bryphe
Copy link
Member

bryphe commented Oct 10, 2017

@Bretley I think there are a lot of really great ideas in this PR from @cyansprite (and great discussion too!), so I've been using it as a reference. There are a few things that are top-of-mind for me in the menu space:

The most important gap we have today, though (in my opinion), is the 'first-run' experience - the first time you open Oni up, and open the quick open experience - it's a bit confusing and unintuitive. I like the experience VSCode has, where you can type ? and see some of the available options - figuring out a way to ease the user in and show them the capabilities in an intuitive way is important here. Having the command prefixes would certainly help a lot. I think there's still some design / thinking we need to do here.

Long-term, too, I'd like to see if it is possible to consolidate the Oni commands & Vim ex commands together too (I think you mentioned this a bit in #776). It'd be nice if users didn't have to think too hard about whether they need to : or <C+S+P> to get where they need to go 😄

It might be a challenge to bring this PR in as-is giving that the menu API surface is changing, but if there are any parts that interest you that could be split out, I'm definitely open to that! Some ideas for chunks to split out could be the multi-selection (extending the new menu API to handle that), or create the colorscheme chooser - that was a really cool part of this PR too 👍

Otherwise, thinking about how we can smooth out that first-open experience would be awesome.

@bryphe
Copy link
Member

bryphe commented Jan 26, 2018

Will close this out as it's pretty old, and some of the bits of functionality have migrated to other PRs.

@bryphe bryphe closed this Jan 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants