adding justl

This commit is contained in:
Chris Cochrun 2024-07-10 09:50:38 -05:00
parent 323a620ed7
commit dda390450e
2 changed files with 47 additions and 2 deletions

View file

@ -3691,6 +3691,9 @@ Let's make sure docker is capable of using tramp.
Still need dockerfile-mode in order to be able to edit dockerfiles. Still need dockerfile-mode in order to be able to edit dockerfiles.
*** Just *** Just
:PROPERTIES:
:ID: 20240705T095129.209161
:END:
Let's use just-mode Let's use just-mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package just-mode (use-package just-mode
@ -3698,7 +3701,28 @@ Let's use just-mode
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package justl) (use-package justl
:config
(defun chris/justl-exec-recipe ()
"Execute a recipe in the justfile from the minibuffer"
(interactive)
(let* ((justfile (justl--find-justfile (project-root (eglot--current-project))))
(recipes (cl-loop for recipe in (justl--get-recipes justfile)
collect (cdr (assoc 'name recipe))))
(recipe (completing-read "Which recipe to run: " recipes)))
(if (get-buffer "*just*")
(justl--exec "just1" recipe `(,recipe))
(justl--exec justl-executable recipe `(,recipe)))
(message "%s" recipe)))
:general
(general-def 'normal justl-mode-map
"e" 'justl-exec-recipe
"E" 'justl-exec-eshell
"<return>" 'justl-exec-recipe)
(chris/leader-keys
:states 'normal
:keymaps 'rustic-mode-map
"gj" 'chris/justl-exec-recipe))
#+end_src #+end_src
*** Fish *** Fish

23
init.el
View file

@ -2708,7 +2708,28 @@ targets."
(use-package just-mode (use-package just-mode
:mode ("\\.just\\'" . just-mode)) :mode ("\\.just\\'" . just-mode))
(use-package justl) (use-package justl
:config
(defun chris/justl-exec-recipe ()
"Execute a recipe in the justfile from the minibuffer"
(interactive)
(let* ((justfile (justl--find-justfile (project-root (eglot--current-project))))
(recipes (cl-loop for recipe in (justl--get-recipes justfile)
collect (cdr (assoc 'name recipe))))
(recipe (completing-read "Which recipe to run: " recipes)))
(if (get-buffer "*just*")
(justl--exec "just1" recipe `(,recipe))
(justl--exec justl-executable recipe `(,recipe)))
(message "%s" recipe)))
:general
(general-def 'normal justl-mode-map
"e" 'justl-exec-recipe
"E" 'justl-exec-eshell
"<return>" 'justl-exec-recipe)
(chris/leader-keys
:states 'normal
:keymaps 'rustic-mode-map
"gj" 'chris/justl-exec-recipe))
(use-package fish-mode (use-package fish-mode
:mode ("\\.fish\\'" . fish-mode)) :mode ("\\.fish\\'" . fish-mode))