-
Notifications
You must be signed in to change notification settings - Fork 7
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
Denite support #15
Comments
It should be relatively simple to support both as its already in python - it can hook in directly skipping the vimscript component, if I understand the new plugin system correctly. The bulk of code is in the bibtex/zotero database loading and parsing and it would be pretty wasteful to split that over two plugins (and have to update eg. the new betterbibtex format twice). I'm pretty sure only citation.py and loader.py have any knowledge of vim at all, it just a question of formatting the returned list of items in builder.py for consumption by denite. It's been on my list but the documentation just wasnt there last time I looked, + I'm very busy, so a pull request would really be appreciated. |
Yes the documentation is a bit thin. My first concern is getting variables
from vimrc into Python.
…On 14 Nov 2017 11:47 p.m., "Rafael Schouten" ***@***.***> wrote:
It should be relatively simple to support both as its already in python -
it can hook in directly skipping the vimscript component, if I understand
the new plugin system correctly.
The bulk of code is in the bibtex/zotero database loading and parsing and
it would be pretty wasteful to split that over two plugins (and have to
update eg. the new betterbibtex format twice). I'm pretty sure only
citation.py and loader.py have any knowledge of vim at all, it just a
question of formatting the returned list of items in builder.py for
consumption by denite.
It's been on my list but the documentation just wasnt there last time I
looked, + I'm very busy, so a pull request would really be appreciated.
The documentation wasn't great last time I looked
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VYp0nUV0tyxp-9pxTOcBpSMJ_EhWks5s2iaHgaJpZM4Qdex7>
.
|
Yep that is a question. Hopefully a I'm imagining we split out unite and denite frontends from builder.py and everything deeper than that can stay as is. |
Two options for configuration
which requires the following configuration in
I have not yet found any dual unite/denite sources so with my limited understanding of unite/denite, I am unsure what to do in order to share configuration between unite and denite. |
Actually, denite works this way regarding configuration.
only require configuration in vimrc for example
|
That looks good - if understand you we wont have to communicate with vim at all - just access self.vars directly in python? It does mean everyone will have to convert their variable configuration to that format to use denite, but its only five or so lines. |
The x:var_name situation defines variable in a particular scope (as far as I understand it) g: is just a globally scoped variable, as v: is an argument variable, s: is script level? etc. Finding another plugin conversions to follow was an issue for me too, this should be pretty formulaic and there are a lot of plugins needing conversion... |
Please explain that part? Are you saying that there is a number of unite plugins needing conversion? |
I found a useful example of highlight and syntax here. |
Thinking about global variables. The current unite implementation declare the global variables with defaults.
The first option allows the unite and denite to share the defaults. |
Sorry, I missed one of your comments regarding converting configuration to denite. This will only happen to users who use denite and so should make sense to them. My idea is to change |
Sorry I meant there are a lot of plugins that need to go through this same unite -> denite conversion process we are discussing so there should be a few examples around documenting the process. It would be nice to go with option 1. and pull the vars in from vim globals so you can swap unite/denite smoothly, unless option 2 is vastly cleaner and simpler. I was vaguely hoping there would be a syntax highlighting method without regex... we're building the description string from known separate strings then using regex to split it up again! for any other application it would be an insane strategy. But if the conversion is easy that's fine too. The Context/UniteLoader idea sounds right. Context could have pre-defined fields too, its purpose is quite opaque right now. But you might need to split out some of Buillder() as well depending on the format denite wants data in. build_source() currently returns a list of arrays of length 4 built by item_to_array() from Item() objects, for consumption in vimscript. Another process might make more sense for denite. |
Do you know of any unite plugin undergoing migration to denite?
…On 17 Nov 2017 5:39 p.m., "Rafael Schouten" ***@***.***> wrote:
Sorry I meant there are a *lot* of plugins that need to go through this
same unite -> denite conversion process we are discussing so there should
be a few examples around documenting the process.
It would be nice to go with option 1. and pull the vars in from vim
globals so you can swap unite/denite smoothly, unless option 2 is vastly
cleaner and simpler.
I was vaguely hoping there would be a syntax highlighting method without
regex... we're building the description string from known separate strings
then using regex to split it up again! for any other application it would
be an insane strategy. But if the conversion is easy that's fine too.
The Context/UniteLoader idea sounds ring. Context could have pre-defined
fields too, its purpose is quite opaque right now. But you might need to
split out some of Buillder() as well depending on the format denite wants
data in. build_source() currently returns a list of arrays of length 4
built by item_to_array() from Item() objects, for consumption in vimscript.
Another process might make more sense for denite.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIB3VcN1uPavgWsLQUvmk2zMo93-P1Bdks5s3cThgaJpZM4Qdex7>
.
|
Found dual unite/denote sources |
Great, looks fairly simple. |
I suggest creating a dev branch for denite support and so I can push to it if I have time. |
Can you work in a branch in your own repository? I shouldn't need to manage a dev branch here. I will pull it to master when it's working, but feel free to put in a pull request before that for feedback. |
What is the status regarding Denite? |
I haven't worked on this because unite is still working fine, and I'm flat out with modelling projects and other work. I'm keen for a pull request if anyone writes one. It shouldn't be major. See the discussions above, although I largely forget the details now. Otherwise I'll eventually do it when unite dies from neglect, or I have some spare time for this, but the first is more likely to be honest. |
Totally forgot about this. I like to try to do a pull request soon. |
Thank you both for responding. |
From what I can tell, denite.nvim loads new sources via
|
Yeah lets not write them all out. I used code generation in vimscript to avoid that kind of duplication originally, really the only reason there are so many sources - adding them only takes a few lines. It seems like a poor design choice to have sources allocated at the file level instead of as some kind of hooks that you can trigger multiple times programatically within one specific file, but we will have to work with that. The args seem to be a good idea if it the syntax will be clean and easy. Edit: Summarise - the second option seems best |
I am inaccurate about the second option. The relevent denite.nvim documentation for the Denite command is
Arguments are separated by |
That still looks good to me. One thing to keep in mind is that arguments like that are already used for zotero database search. But they can just be tacked on after the source argument. Also citation_source will probably need to be in a separate source file, as its a different mechanism. Just to be clear the option is that we otherwise have 20 something separate files, one for each source? |
I am thinking about replacing |
Just keep in mind that I still use unite and am reasonably happy with my set of plugins, and probably a few hundred other people as well going on download stats... so still working in unite with no config changes is the most important thing. Other than that do what needs to be done! |
Yes, I will make to keep the unite source's functionality the same. My plan is then to create two pull requests:
This way I can make sure that each pull request is tested and ensure that unite source behaves as normally. |
Thats a good idea. I have a testing suite to hammer it with, but it needs a zotero install with lots of specific data, bibtex files and does things like open pdfs so I never bothered to set up Travis. But I'll run it on your branch before merging each pull request. |
I don't think Travis-ci |
I have done the first PR. Please review on your end. |
It also uses the better-bibtex database, and probably neither of those should be in this repo. Mostly I couldn't see the return benefits of setting it up properly vs just running a script locally. Setting up Travis would probably take a day or two. And then the better bibtex format can change unexpectedly, so you want to be actually updating that and testing the latest... PR is merged. |
Yeah, the better bibtex is unstable because the Zotero 5 is badly designed which makes using keys difficult. The better bibtex database is a temporary solution. Oh well. |
Ok wow. I have tried my best not to look into any of the reasons for that weirdness, but I'm glad you understand it. This plugin is exposed to way too much of that, with unite, bibtex, vimscript, zotero, better-bibtex, python unicode hell. now denite, etc etc. I'm constantly surprised at how stable it is. |
The better bibtex is stable functionality wise but not stable
developmentally as it depends on zotero design and zotero is still
evolving. I heard the zotero will be built on Electron platform. Not sure
what that means.
…On Sun, 29 Jul 2018, 09:17 Rafael Schouten, ***@***.***> wrote:
Ok wow. I have tried my best not to look into any of the reasons for that
weirdness, but I'm glad you understand it. This plugin is exposed to way
too much of that, with unite, bibtex, vimscript, zotero, better-bibtex,
python unicode hell. now denite, etc etc. I'm constantly surprised at how
stable it is.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIB3Vaaoa2y3XYRtpmzWvbFokkRa_T4mks5uLW-HgaJpZM4Qdex7>
.
|
Looking at |
They are nested in zotero, but are listed flat in unite. Selecting one will get you everything from there down in the tree. I think the database query gets all parent collections for every field, so any of them will work. I can't remember what action__path or action__directory do there. I remember that set of commands not necessarily being limited to doing what you would think they do, but its a few years ago now. It really should have had a comment. This was the first vim plugin I wrote and I'm sure there is some cruft, especially in the vimscript... |
action__path is connected to the start action which is mostly for opening pdfs or urls. So that's not needed at all. action__text is for yank etc which is vaguely useful, but action__directory is probably also completely useless. You may as well delete them. I just realised how little I documented things in there, hope it's generally legible enough... |
Haha, I have mostly figured things out. I will not be able to continue working on this until 10th of August. |
I have made a working PR #19, I am going to test it more rigorously soon. EDIT: Still buggy with regards to actions. I need to see variety of environments of other users to understand the behavour of my code. I was trying to open files etc. |
Are you still working on this? |
Add support for denite.nvim which supersedes
unite.vim
.I am looking at how
denite.nvim
works and see if I can do a pull request.However since
citation.vim
is a source forunite.vim
it may need a rewrite fordenite.nvim
.Should
citation.vim
-like source fordenite.nvim
be a separate plugin?The text was updated successfully, but these errors were encountered: