Replace dwim-shell-command with eshell-command
Gives the same feature, but has offers more.
This commit is contained in:
parent
4bf3d05e07
commit
4db75eb591
2 changed files with 13 additions and 20 deletions
|
@ -100,16 +100,6 @@ Rewriting my shell scripts in Emacs Lisp uses my [[https://gitlab.com/howardabra
|
||||||
("C-M-|" . piper)
|
("C-M-|" . piper)
|
||||||
("C-|" . piper-user-interface)))
|
("C-|" . piper-user-interface)))
|
||||||
#+end_src
|
#+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)
|
** Yet Another Snippet System (YASnippets)
|
||||||
Using [[https://github.com/joaotavora/yasnippet][yasnippet]] to convert templates into text:
|
Using [[https://github.com/joaotavora/yasnippet][yasnippet]] to convert templates into text:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#+TITLE: Eshell
|
#+TITLE: Expanding Eshell
|
||||||
#+AUTHOR: Howard X. Abrams
|
#+AUTHOR: Howard X. Abrams
|
||||||
#+DATE: 2022-09-13
|
#+DATE: 2022-09-13
|
||||||
#+FILETAGS: :emacs:
|
#+FILETAGS: :emacs:
|
||||||
|
@ -788,21 +788,24 @@ Scrolling through the output and searching for results that can be copied to the
|
||||||
:hook ((eshell-pred-load . ha-eshell-add-predicates)
|
:hook ((eshell-pred-load . ha-eshell-add-predicates)
|
||||||
(eshell-exit . delete-window))
|
(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)
|
("M-R" . eshell-insert-history)
|
||||||
("C-d" . ha-eshell-quit-or-delete-char)))
|
("C-d" . ha-eshell-quit-or-delete-char)))
|
||||||
#+end_src
|
#+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
|
#+begin_src emacs-lisp
|
||||||
(ha-leader
|
(ha-leader
|
||||||
"a e" '(:ignore t :which-key "eshell")
|
"!" '("eshell cmd" . execute-command-on-file-buffer)
|
||||||
"a e e" '("new eshell" . eshell-here)
|
"a e" '(:ignore t :which-key "eshell")
|
||||||
"a e r" '("remote" . eshell-remote)
|
"a e e" '("new eshell" . eshell-here)
|
||||||
"a e p" '("project" . eshell-project)
|
"a e r" '("remote" . eshell-remote)
|
||||||
"a e g" '("at point" . eshell-here-on-line)
|
"a e p" '("project" . eshell-project)
|
||||||
"a e !" '("exec on file-buffer" . execute-command-on-file-buffer))
|
"a e g" '("at point" . eshell-here-on-line)
|
||||||
|
"a e !" '("exec on file-buffer" . execute-command-on-file-buffer))
|
||||||
#+end_src
|
#+end_src
|
||||||
No, i’m not sure why =use-package= has an issue with both =:hook=, =:bind= and =:config= directives in sequence.
|
No, i’m not sure why =use-package= has an issue with both =:hook=, =:bind= and =:config= directives in sequence.
|
||||||
* Technical Artifacts :noexport:
|
* Technical Artifacts :noexport:
|
||||||
|
|
Loading…
Reference in a new issue