Closed jalvesaq closed 2 months ago
Note: I deleted a spam message.
Reason to keep only the custom Telescope dialog: we can open it with an empty search string and populate the list with all Zotcite references. With the Insert mode key binding, this would implement what @acorreya requested on #46.
This I agree with and I've already tested out telescope for the Zselectannotations
command. But the issue is that the telescope picker list cannot refresh the list. This is document here https://github.com/nvim-telescope/telescope.nvim/issues/2016#issue-1276097274
For instance, once an annotation selection has been made, it should be removed from the list of available annotations (ideally).
As far as I can tell we can implement telescope
in the annotations selection menu but that this means it might not remove an annotation that's been selected.
I tried a few things for this problem and I can't get the telescope list to change the options once the menu is open, neither does opening a new picker list work.
:Zselectannotations
works in two steps. First, it selects the reference. Then it selects the annotations.
We don't need to change anything in the second step; your implementation is good. But we can use the custom Telescope dialog for the first step. I can make a pull request for this tomorrow to make more clear what I mean.
Ahh yeah it would be okay to implement it to select which reference the annotation comes from.
In ways this should be straightforward as Zseek
now already does this.
Perhaps instead of displaying the abstract we display the reference info (journal, year etc)
We can add a config option to allow users to choose what is displayed in the telescope preview window.
But I'm definitely for having telescope in the commands 😀
The main inconsistency I reported is fixed, but we could still improve the Telescope dialog.
I'm suggesting a new way of calculating the width of the author field on the branch improve_seeker
.
News on the improve_seeker
branch: accept calling seek.refs
with an empty string and use Telescope to insert citation key (<C-X><C-C>
). This effectively allows us to close issue #46.
We can add a config option to allow users to choose what is displayed in the telescope preview window.
When we resize the terminal, Telescope automatically updates itself and shows the preview window if the terminal is large enough or hides it if the terminal doesn't have enough columns. In my opinion, we don't need further customization, unless there is demand for it.
Perhaps instead of displaying the abstract we display the reference info (journal, year etc)
The branch improve_seeker
now formats the reference. It can still be improved but it's already more informative than before because it includes the book title or journal name. The message "No abstract" is displayed only for journal articles.
Now, a custom syntax highlighting for the previewer:
The
:Zannotations
(and other commands) callvim.ui.select
. My result for:Zannotations neuroscience
is:If I use the Telescope
ui-select
extension the result is:And
:Zseek
is the only one to use a custom Telescope dialog:Perhaps we should use the custom Telescope dialog for everything. We can even create an Insert mode key binding for inserting citation keys (as an alternative, not replacement, for
cmp-zotcite
). Or we may have a global option allowing users to choose betweenvim.ui.select
and the custom Telescope dialog. More options are good for users but mean more work for us. What do you think, @adam-coates ?