当我使用 M-x shell 打开一个新终端时,它有时会将当前目录设置为文件所在的目录。但有时不会。那么是否有一个功能可以在当前目录中始终打开一个新终端?
最佳答案
有包裹shell-here
在 ELPA 中可用:M-x list-packages
,找shell-here
,标记安装( i
)并执行( x
)。
自述文件摘录:
Open a shell buffer in (or relative to) default-directory,
e.g. whatever directory the current buffer is in. If you have
find-file-in-project installed, you can also move around relative
to the root of the current project.
I use Emacs shell buffers for everything, and shell-here is great
for getting where you need to quickly. The =find-file-in-project=
integration makes it very easy to manage multiple shells and
maintain your path / history / scrollback when switching between
projects.
github主页:https://github.com/ieure/shell-here
我喜欢
shell-pop
也可以轻松弹出并弹出一个shell缓冲区窗口。 ELPA 中可能还有更多!
关于emacs - 如何在当前目录中打开终端?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20673836/