Sliim / helm-github-stars

Browse your starred repositories with Emacs helm interface
GNU General Public License v3.0
68 stars 4 forks source link

request to provide ivy interface?? #20

Open zilongshanren opened 8 years ago

zilongshanren commented 8 years ago

I know helm is a good interface for completion, but ivy wins in performance.

Recently I have replaced all the helm stuff in my Spacemacs config with ivy replacement and it works fine and I gain lots of performance boost.

One thing I miss most might be the helm-github-stars, could you consider add ivy support?

Thanks.

Sliim commented 8 years ago

Hi!

Hmm why not :). But I'm not a ivy-mode user so I don't know how it works. Do you have some diff to share where I can see the effort to add this support?

Maybe consider to rename the project to github-stars that provides both helm-github-stars and ivy-github-stars separately?

zilongshanren commented 8 years ago

@Sliim Hi, thanks. I think rename the repo to emacs-github-stars might be more clearer.

Here is a example for flyspell:

The helm interface: https://github.com/pronobis/helm-flyspell

The ivy interface: https://github.com/d12frosted/flyspell-correct (This repo also provide helm interface)

And here are many helm porting elisp functions rewritten with ivy:

https://github.com/abo-abo/swiper/blob/master/counsel.el

And a few blog posts:

ivy-mode uses minubuffer for overview, it's suuuuuuuuuuper faster than helm...

I hope these links helps and look forward to have ivy for github-stars! 😄

Sliim commented 8 years ago

It looks interesting :) Thanks for these resources, I will try it as soon as possible!

xuchunyang commented 8 years ago

I don't use ivy either, instead of writing helm or ivy specific code, we can also provide a universal command which uses Emacs standard completing function completing-read, as far as I know, both helm-mode and ivy-mode can "hijack" that function.

(defun github-stars (&optional refresh)
  "Search and open your GitHub stars.
With prefix argument, refresh cache."
  (interactive "P")
  (when refresh (hgs/clear-cache-file))
  (let ((repo
         (completing-read
          "> "
          (mapcar #'hgs/get-repo-name (hgs/get-github-stars)))))
    (browse-url (concat "https://github.com/" repo))))

(defun github-repos (&optional refresh)
  "Search and open your GitHub repos.
With prefix argument, refresh cache."
  (interactive "P")
  (when refresh (hgs/clear-cache-file))
  (let ((repo
         (completing-read
          "> "
          (mapcar #'hgs/get-repo-name (hgs/get-github-repos)))))
    (browse-url (concat "https://github.com/" repo))))
Sliim commented 8 years ago

Thx @xuchunyang

So we can split code in several files: