I have some work that requires I move around between various sub-directories. Thus, the easiest way I have found to do that is to use dired
. I also have to view some files (plain text or code), so another benefit is I can just hit RET
on the filename to do that. However, I sometimes need to run shell commands on these files. Before I used Emacs, I would just use Bash (navigating with pushd
and popd
, which is less convenient than dired
), so this allowed me to run the commands I needed.
How can I easily combine the best of both methods? I see a couple options:
- Somehow keep a
shell
buffer in sync with thedired
buffer. (Maybe somehow triggerpushd
/popd
/cd
?) - Set up some keyboard shortcuts for the
shell
buffer, to simulate movement and file viewing (the latter especially seems more difficult). - Something else?
Note that I would prefer not to call shell-command
(M-!
) every time, because it is harder to execute multiple commands in quick succession, and interact with the command output, in addition to having a less-than-convenient default keybinding.