定义Aquamacs Shell的Bash别名
题
对于Emacs,您可以在.emacs.d/init_bash.sh中定义壳模式别名,但是Aquamacs(OS X 10.5上的2.0)似乎没有使用此功能。还有其他地方可以定义这些地方吗?
解决方案
来自shell.el:
如果文件
~/.emacs_SHELLNAME' exists, or
〜/.emacs.d/init_shellname.sh',它作为初始输入给出(但由于定时错误,如果启动时丢弃输入,则可能会丢失)。缓冲区放置在外壳模式下,给出用于发送输入和控制外壳副本的命令。看shell-mode'. See also the variable
Shell-Prompt-Pattern'。
因此,您可能想尝试查看是否 〜/.emacs_bash 作品。
其他提示
为我解决了:我做了两个似乎可以解决问题的更改(我较早完成了Aquamacs-> Tools-> install命令行工具)。更改是:a)删除我创建的“〜/.emacs_bash”符号; b)创建一个包含我的别名设定脚本的调用的“〜/.bashrc”文件; c)从'〜/.bash_profile'调用'〜/.bashrc'(将其属于〜/'。bash_profile'留在〜/.bash_profile'的位置)。
Aquamacs似乎将'/usr/bin:/bin:/usr/sbin:/sbin:/sbin:/usr/texbin'添加到从'〜/.bash_profile'中获得的路径,但这似乎不是问题。
- 我以前的答案和问题:
从'〜/.emacs_bash'到'〜/.bash_profile'的符号链接成功地获得了'〜/.bash_profile'在Aquamacs上执行,因此Shell Buffers具有一些所需的设置(Aliases)。
但是,需要的是配置aquamacs,以便“〜/.bash_profile”每个aquamacs会话执行一次,而'〜/.bashrc'每个aquamacs shell执行一次?否则,例如,使用'〜/.emacs_bash'到'〜/.bash_profile'的链接,串联的shell变量(通常为$ path)在它们中获得了许多冗余值。
在 *nix和cygwin上,在nt上,gnu emacs以'.bash_profile'和'.bashrc'的框架锻炼:'.bash_profile'在 *nix系统上执行一次,包括emacs shell,包括emacs shell,缓冲区,从中获取变量。同样,'.bashrc'每 *nix shell执行一次,包括emacs shell缓冲区。
有人对如何让Aquamacs做同样的事情有任何指导吗?