Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap #1

Closed
7 of 23 tasks
prabirshrestha opened this issue Dec 23, 2018 · 6 comments
Closed
7 of 23 tasks

Roadmap #1

prabirshrestha opened this issue Dec 23, 2018 · 6 comments

Comments

@prabirshrestha
Copy link
Owner

prabirshrestha commented Dec 23, 2018

Here are few things I would like to support in quickpick.vim.

  • on_change handler so pickers can implement custom on the fly search useful for npm search and install package.
  • add quickpick#exists() to check if the quickpick with id is available so that we only modify the items if it exists. useful for async pickers.
  • add support for user_data for items instead of just string to allow pickers to add metadata. Example: User might want to show the description as picker item, but they want to refer by id when clicking accept.
  • allow the user to bind custom action. Ctrl-v for vertical split, Ctrl-T for new tab and so on.
  • implement default action type, such as file so the on_accept handler is implement automatically and the pickers don't need to implement it all the time. Unlike filtering/search this doesn't have much impact on perf so it is ok to be in the core. It is opt in so pickers can decided if they want to re-implement.
  • add on_selection_change handler so pickers can implement custom preview. For example it may decide to show the file on preview buffer, change the colorscheme of vim as the selection changes.
  • add support for on_cancel so users can reset changes. Useful for colorscheme picker when we want users to go back to the original colorscheme after changing.
  • add support for multiple support. Ex: Useful when you want to delete multiple git branches.
  • add flag to disable multiple selection
  • add set_busy so that async pickers can show spinner to make it feel more responsive.
  • add set_title so the picker title can be customized on the fly
  • add set_prompt so the prompt can be customized on the fly
  • add set_selected_items so the items can be marked on the fly.
  • add ignore_focus_out so the picker doesn't close automatically when it focus out.
  • implement <Plug> mappings so user can custom bind keys. For now the keys are similar to CtrlP.
  • implement syntax highlighting for matches
  • add events such on_before_open, on_after_open. Provides hook to set title/busy indicator if it was hidden and reopened.
  • add on_resize event so the pickers can only send partial data that is required to render the items instead of sending thousands of items. this could be difficult to solve as we also need to track where we are. This is similar to virtualization of lists that we see very common on the web. - https://github.com/bvaughn/react-virtualized
  • add append_items api which allows the pickers to stream data to the picker so the picker doesn't need to keep sending data that it already sent before. Makes it less chatty if someone implements picker using jobs.
  • add get_statusto check the status of the picker best of the id. Useful for async when you don't want to call set_items if the picker is already closed.

Pickers to demonstrate proof of concept:

  • npm install/yarn add
  • file picker in python with threading so it doesn't block the UI with custom filtering and ranking algorithm optimized for path search with fallback to vimscript if the user doesn't have python installed.
  • sample neovim remote plugin so all the heavy lifting is done in the remote plugin in different process.

If anyone has more suggestions feel to add comments here.

@andreypopp
Copy link

Like the idea of this plugin, I think preview functionality is also useful (show some additional info for the currently selected item). What do you think?

@andreypopp
Copy link

Another feature request (hope it's okay I'm posting them here): an ability to set initially highlighted item — I'm considering to use quickpick.vim for rendering module outlines and would be nice to start picking from the closest item to the current cursor position in the module.

@prabirshrestha
Copy link
Owner Author

Feel free to request anything here. I would be interested to see what others would like to see too.

@prabirshrestha
Copy link
Owner Author

The plugin itself is at a very experimental phase so apis will change. If you are relying on day to day do make sure to pin to a commit.

@prabirshrestha
Copy link
Owner Author

@andreypopp if you checkout the vnext branch it now supports highlighting. You do need vim with matchfuzzypos and prop_add. If you are using neovim matchfuzzypos is not supported but is currently in their PR. prop_add is vim specific api so to make highlights work need to use neovim specific apis.

image

vnext branch is a complete rewrite and is better and includes additional features such as automatic fuzzy match which is opt in by default, automatic debounce which is also opt in by default. Fuzzymatch happens in C which ships with vim so is pretty fast.

on_selection include bufnr and winid so you should be able to add your own popups.

I'm in the process of updating my quickpick sources to the new api so should be available in master pretty soon. Unfortunately it does have breaking changes.

@prabirshrestha
Copy link
Owner Author

quickpick.vim now support a rich set of features. closing this for now.

rest of the features or bugs can be filed separately from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants