Skip to content

Adding support for neovim vim.ui.select#281

Merged
lervag merged 5 commits intolervag:masterfrom
saccarosium:master
Mar 23, 2023
Merged

Adding support for neovim vim.ui.select#281
lervag merged 5 commits intolervag:masterfrom
saccarosium:master

Conversation

@saccarosium
Copy link
Copy Markdown
Contributor

related to: #274

  • Removing WikiFzf{Pages,Tags,Toc} in favor of Wiki{Pages,Tags,Toc}

This uses on Neovim vim.ui.select and on vim junegunn/fzf.

  • Renaming WikiPageToc and WikiPageLocToc to WikiGenerateToc and WikiGenerateLocToc

This is for prefenting user confusion with WikiToc and also make more clear the outcome of the command.

Demos

with FzfLua

WikiPages
pages

WikiTags
tags

WikiToc
toc

with Telescope

WikiPages
pages

WikiTags
tags

WikiToc
toc

@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 21, 2023

Removing WikiFzf{Pages,Tags,Toc} in favor of Wiki{Pages,Tags,Toc}

This uses on Neovim vim.ui.select and on vim junegunn/fzf.

Thank you, I really appreciate your work here! I was already working on this myself, but it was not going very fast. I'm glad to have help here!

Renaming WikiPageToc and WikiPageLocToc to WikiGenerateToc and WikiGenerateLocToc

Thanks, I agree on this suggestion, except that I want it to be WikiTocGenerate... and similar for the mappings.


I believe we are quite close already with your effort, but we need some more work:

  • Now we are "breaking" things for those who are using neovim who wants to use fzf. I believe we could solve this with a new option, e.g. g:wiki_select_method. The default value would be fzf for Vim and nvim for neovim, and it would allow neovim users to revert to the old fzf backend.

  • We need updated docs for the Wiki{Pages,Tags,Toc} commands that distinguish the command intents from the "implementation" (neovim vs fzf).

  • Is it possible to somehow add a previewer with vim.ui.select?

  • Is it possible and relevant to add a formatter for wiki.pages()?

  • Is it possible and relevant to add a formatter for wiki.toc()?

command! -buffer WikiPageToc call wiki#toc#create(0)
command! -buffer WikiPageTocLocal call wiki#toc#create(1)
command! -buffer WikiGenerateToc call wiki#toc#create(0)
command! -buffer WikiGenerateToc call wiki#toc#create(1)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind this change, except I would prefer WikiTocGenerate. But we also need to make this change later (near line 111).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I was probably unclear on my last sentence. You changed WikiPageToc to WikiTocGenerate now, but you did not change the map definition later on line 115:

  nnoremap <silent><buffer> <plug>(wiki-page-toc)             :WikiPageToc<cr>

*<plug>(wiki-fzf-pages)*
*WikiFzfPages*
*<plug>(wiki-pages)*
*WikiPages*
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need some updated docs.

@saccarosium
Copy link
Copy Markdown
Contributor Author

Is it possible to somehow add a previewer with vim.ui.select?

I don't think is possible natively, or in a way that it is general enogh for all kinds of fuzzy finders.

We need updated docs for the Wiki{Pages,Tags,Toc} commands that distinguish the command intents from the "implementation" (neovim vs fzf).

My plan was to write it myself but I need help on where is appropriate to make (under what heading/subsection)

@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 23, 2023

There's a minor detail left (line 115 of buffer.vim), and the docs. I can do the docs.

Also, I appreciate that you've used conventional commits here!

@lervag lervag merged commit 087d60f into lervag:master Mar 23, 2023
lervag added a commit that referenced this pull request Mar 23, 2023
@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 23, 2023

I've merged this now and also pushed an update to the docs. Let me know what you think.

@saccarosium
Copy link
Copy Markdown
Contributor Author

I think is a good idea listing this integration in the README. As you saw in some of the GIFs if uploaded the user can use basecly every neovim fuzzy finder, is very cool!

lervag added a commit that referenced this pull request Mar 23, 2023
@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 23, 2023

I've tried to list these now.

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

Successfully merging this pull request may close these issues.

2 participants