helm-github-stars icon indicating copy to clipboard operation
helm-github-stars copied to clipboard

request to provide ivy interface??

Open zilongshanren opened this issue 9 years ago • 5 comments
trafficstars

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.

zilongshanren avatar May 10 '16 03:05 zilongshanren

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?

Sliim avatar May 10 '16 23:05 Sliim

@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:

  • http://blog.binchen.org/posts/use-ivy-to-open-recent-directories.html
  • http://blog.binchen.org/posts/use-ivy-mode-to-tweak-workgroups2.html
  • http://blog.binchen.org/posts/hello-ivy-mode-bye-helm.html

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! 😄

zilongshanren avatar May 11 '16 01:05 zilongshanren

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

Sliim avatar May 11 '16 22:05 Sliim

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))))

xuchunyang avatar Jun 11 '16 05:06 xuchunyang

Thx @xuchunyang

So we can split code in several files:

  • github-stars.el that contains core functions and Emacs standard completing support.
  • helm-github-stars.el that adds Helm support.
  • ivy-github-stars.el that adds Ivy support.

Sliim avatar Jun 12 '16 18:06 Sliim