licht1stein / repo-hydra.el

Easily define repo-specific Emacs hydras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

repo-hydra.el

Easily create repo-specific menus for Emacs.

This library was inspired by an amazingly instructive interview by Juan Monetta (@jpmonettas), he also wrote the main macro which I only slightly changed and turned into a library.

Examples

Normal repo hydra

This is an example repo-hydra for this repository. Note, that the first argument to repo-hydra-define has to exactly match the root directory name of the git repo (case sensitive).

(repo-hydra-define
 "repo-hydra.el"
 ("i" text-scale-increase "In")
 ("o" text-scale-decrease "Out"))

If repo-hydra-show is called from within the repo-hydra.el repository, the hydra will show:

Clojure repo hydra

I have kept the original logic of the Clojure macro in repo-hydra-define-clj, it automatically evaluates the clojure code in strings with the current CIDER REPL:

(repo-hydra-define-clj
 "sanskrit"
 ("c" sanskrit-cider-connect "Connect REPL" (cider-connect-clj '(:host "localhost" :port 33000)))
 ("p" sanskrit-portal "Portal" "(user/portal)")
 ("P" sanskrit-clear-portal "Clear Portal" "(user/clear-portal)")
 ("S" sanskrit-require-snitch "Require snitch" "(require '[snitch.core :refer [defn* defmethod* *fn *let]])"))

Install

Using use-package and straight

(use-package repo-hydra
  :straight (:type git :host github :repo "licht1stein/repo-hydra.el")
  :bind ("<f6>" . repo-hydra-show))

Versioning

This library uses break versioning, this means that upgrading from 1.0.x to 1.0.whatever is always non-breaking, upgrading to 1.1.x might break something small, and upgrading to 2.x.x will break something big.

About

Easily define repo-specific Emacs hydras

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 93.9%Language:Makefile 6.1%