Replace dwim-shell-command with eshell-command

Gives the same feature, but has offers more.
This commit is contained in:
Howard Abrams 2022-09-28 13:41:45 -07:00
parent 4bf3d05e07
commit 4db75eb591
2 changed files with 13 additions and 20 deletions

View file

@ -100,16 +100,6 @@ Rewriting my shell scripts in Emacs Lisp uses my [[https://gitlab.com/howardabra
("C-M-|" . piper)
("C-|" . piper-user-interface)))
#+end_src
Interested in the [[https://github.com/xenodium/dwim-shell-command][DWIM Shell Command]] project from [[https://xenodium.com/emacs-dwim-shell-command/][Álvaro Ramírez]]. It acts like the regular [[help:shell-command][shell-command]], but the ~q~ closes the results. A command with =<<f>>= operates on the filename of the current buffer, so =chmod a+x <<f>>= works as expected. More useful in [[help:dired][dired]] where you can mark a bunch of files and then operate on all files with such syntax.
#+begin_src emacs-lisp
(use-package dwim-shell-command
:straight (:host github :repo "xenodium/dwim-shell-command")
:bind (("M-!" . dwim-shell-command)
:map dired-mode-map
([remap dired-do-async-shell-command] . dwim-shell-command)
([remap dired-do-shell-command] . dwim-shell-command)
([remap dired-smart-shell-command] . dwim-shell-command)))
#+end_src
** Yet Another Snippet System (YASnippets)
Using [[https://github.com/joaotavora/yasnippet][yasnippet]] to convert templates into text:

View file

@ -1,4 +1,4 @@
#+TITLE: Eshell
#+TITLE: Expanding Eshell
#+AUTHOR: Howard X. Abrams
#+DATE: 2022-09-13
#+FILETAGS: :emacs:
@ -788,15 +788,18 @@ Scrolling through the output and searching for results that can be copied to the
:hook ((eshell-pred-load . ha-eshell-add-predicates)
(eshell-exit . delete-window))
:bind (:map eshell-mode-map
:bind (("M-!" . execute-command-on-file-buffer)
("s-1" . execute-command-on-file-buffer)
:map eshell-mode-map
("M-R" . eshell-insert-history)
("C-d" . ha-eshell-quit-or-delete-char)))
#+end_src
Note that the default list to [[emacs-lisp:(describe-variable 'eshell-visual-commands)][eshell-visual-commands]] is mostly good enough.
Note that the default list to [[emacs-lisp:(describe-variable 'eshell-visual-commands)][eshell-visual-commands]] is good enough.
Finally, add some leader commands to call my previously defined functions:
Add leader commands to call my defined functions:
#+begin_src emacs-lisp
(ha-leader
"!" '("eshell cmd" . execute-command-on-file-buffer)
"a e" '(:ignore t :which-key "eshell")
"a e e" '("new eshell" . eshell-here)
"a e r" '("remote" . eshell-remote)