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

Show description in search #47

Open
dag opened this issue May 29, 2011 · 21 comments
Open

Show description in search #47

dag opened this issue May 29, 2011 · 21 comments
Labels
Milestone

Comments

@dag
Copy link
Contributor

dag commented May 29, 2011

For :Bundles and :BundleSearch, show the short description for listed bundles. That is, the second column in the table on vim-scripts.org. I often find I need to go to that site just to see what a bundle really does.

As I see it there are three possible formats for this.

Comment First

This is most similar to common formatting of source code. A down side is the need for extra whitespace.

" Vim Ex-command wrapper for Ruby Bundler
Bundle 'bundler'

" ku source: bundle
Bundle 'ku-bundle'

" Load a series of files easily
Bundle 'bundle'

Comment After

Feels more like a description as one might design it on a website; puts focus on the Bundle line. Also whitespace-heavy.

Bundle 'bundler'
" Vim Ex-command wrapper for Ruby Bundler

Bundle 'ku-bundle'
" ku source: bundle

Bundle 'bundle'
" Load a series of files easily

Comments Lined Up

This makes yanking include the description, for better or worse. Easier to scan. Doesn't require more whitespace than without descriptions. Unlikely to work well with long bundle names.

Bundle 'bundler'    " Vim Ex-command wrapper for Ruby Bundler
Bundle 'ku-bundle'  " ku source: bundle
Bundle 'bundle'     " Load a series of files easily
@0
Copy link
Contributor

0 commented May 29, 2011

The last ("Comments Lined Up") variant doesn't work in .vimrc files, because Vim treats the comment as a string argument to Bundle. It would be misleading to display the results that way, since they can't be used directly like one might assume.

@gmarik
Copy link
Contributor

gmarik commented May 29, 2011

yup, @0, that's correct.
Do you know if inline comment can be stripped out so it won't break Bundle command? That'd be pretty cool

@0
Copy link
Contributor

0 commented May 30, 2011

I couldn't find anything when the issue originally came up, but I think I've fixed it now.

@gmarik
Copy link
Contributor

gmarik commented May 30, 2011

@0, that's awesome!

@gmarik
Copy link
Contributor

gmarik commented May 30, 2011

Ok, looks like after @0's fix we can go with Comments Lined Up style, Nice!

@weynhamz
Copy link
Contributor

weynhamz commented Dec 2, 2012

Related to #13.

@MarcWeber
Copy link

related to #173 ?

@berryp
Copy link

berryp commented Mar 22, 2014

#403 will allow for comments on the same line.

@starcraftman
Copy link
Contributor

This is actually something we could do very easy, at least Vundle doesn't need major change. Since we allow comments on the line, we can extract the short summary (usually rest of Title tag) and pack it in with the json file the scrapper outputs. We just need to make a slight modification, use single quotes on strings and add comment after ".

Old json :

["test.vim","pytest.vim",...]

New JSON:

['test.vim " A short description', 'pytest.vim " Another desc',...]

Patch for Vundle to accept format:

diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim
index 5c43547..6d99231 100644
--- a/autoload/vundle/scripts.vim
+++ b/autoload/vundle/scripts.vim
@@ -111,10 +111,10 @@ func! vundle#scripts#view(title, headers, results)
   com! -buffer -bang -nargs=1 DeletePlugin
     \ call vundle#installer#run('vundle#installer#delete', split(<q-args>,',')[0], ['!' == '<bang>', <args>])

-  com! -buffer -bang -nargs=? InstallAndRequirePlugin
+  com! -buffer -bar -bang -nargs=? InstallAndRequirePlugin
     \ call vundle#installer#run('vundle#installer#install_and_require', split(<q-args>,',')[0], ['!' == '<bang>', <q-args>])

-  com! -buffer -bang -nargs=? InstallPlugin
+  com! -buffer -bar -bang -nargs=? InstallPlugin
     \ call vundle#installer#run('vundle#installer#install', split(<q-args>,',')[0], ['!' == '<bang>', <q-args>])

   com! -buffer -bang -nargs=0 InstallHelptags

@gmarik Any thoughts on this? I'm still not familiar with the scraper, I'll go have a look.

@starcraftman
Copy link
Contributor

Adding @jdevera.

While we are on the subject, we may want to just skip modifying the scraper and add support for parsing using this file > http://www.vim.org/script-info.php. Comes complete with summary of each plugin, releases and ids of files to download/extract. Files way too huge though we'd have to trim it down substantially. That would be part of a much larger refactor, could mean we could stop using the scraper which both costs money and takes time, more importantly has lots of overhead. We could easily refresh this file quickly and trim lines we don't need from the json.

To make it readable with vim do:

wget http://www.vim.org/script-info.php | cat script-info.php | python -mjson.tool > scripts.json

Edit: Thought about it some and probably easiest to do the first. Though, we could use this php file and cross reference it with the script json generator to add in the summary.

@jdevera
Copy link
Contributor

jdevera commented Apr 9, 2014

About the new JSON above, I'd rather those two things were in different strings, so we don't have to do more processing in vim.

[["name", "description"],["name2","description2"]]

Still ugly JSON, but with the work already done.

@jdevera
Copy link
Contributor

jdevera commented Apr 9, 2014

That script-info.php is a gem! If the scrapper is not based on this, it probably should!

BTW, anyone knows anything about the status of the scrapper? @gmarik?

@MarcWeber
Copy link

If you start using "script-info" you can join vim-pi, too (just my two cents) - we'd appreciate that. Yes - we are also willing to accept changes to vim-pi if that's necessary.

@jdevera
Copy link
Contributor

jdevera commented Apr 9, 2014

Why is vim-pi in bitbucket? while everything else is happening on github? I wonder.

@MarcWeber
Copy link

https://bitbucket.org/vimcommunity/vim-pi/issue/94/document-officially-why-bitbucket-and-not
talks about some ideas. Now neovim might change a lot anyway soon which is why I would like to delay most plugin related work for 3-6 month.

@gmarik
Copy link
Contributor

gmarik commented Apr 10, 2014

@jdevera scraper is running daily but it not updating API data which Vundle is using.
Basically API data is outdated.
script-info.php is not extremely useful for simple reason: git repos on github likely to have different names because names aren't id-based.

@MarcWeber
Copy link

vim-pi does the following: It parses the install instructions for git urls. That's why VAM knows about many (not all) github repositories. The true fix is to update vim.sf.net - but then it would be helpful to integrate with github etc - which cannot be done easily because you cannot use github API from sourceforge's PHP hosting. You could workaround it by creating third party services calling into vim.sf.net .. You may do whatever you think is best.

@starcraftman
Copy link
Contributor

@gmarik Is there a reason the scraper doesn't update the API data that Vundle downloads?

@BatmanAoD
Copy link

Just wanted to mention that I hope to see this feature soon. Is there currently any way to even distinguish between two identically-named vim.org scripts after doing a "search"? (For instance, ":BundleSearch Rename" gives a list that includes both http://www.vim.org/scripts/script.php?script_id=3525 and http://www.vim.org/scripts/script.php?script_id=1928 with nothing to distinguish them, and they have completely different behavior.)

Edit: It appears that installing Bundle 'Rename' installs 1928, not 3525. Can it be assumed that Vundle will always pick the script with the lower ID? Is there a way to force it to pick the script with the larger ID?

@starcraftman
Copy link
Contributor

@BatmanAoD I believe that is an issue more related to the scraper that indexes vim.org. Vundle just parses a json file to get that list, you can see it in your bundle dir under .vundle. I don't really know the internals of the scraper so more an issue for gmarik.

@BatmanAoD
Copy link

Hm. Looks like this is just #183, which is due to vim-scraper/vim-scraper#65, which hasn't had an update in a year. Looks like the scraper has the ability to resolve name collisions, but gmarik says that it's failing to recognize them due to local repos being out-of-date.

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

No branches or pull requests

9 participants