几周以来我一直在使用 Aquamacs,我正在努力寻找好的定制。首先,我只是希望我的 aquamacs 在开始时看起来像这样:
我的意思是在左边,我的源代码。右侧是 shell 窗格(从 CX 3 + MX shell 开始)。
我在 emacs/aquamacs 论坛和 stackOverflow 上进行了一些搜索。但我仍然被阻止。谢谢。:)
如果您只需要拆分窗口并在新创建的窗口中打开外壳,您应该可以添加以下内容:
(split-window-horizontally nil)
(other-window 1)
(shell nil)
(other-window 1) ;; return you to the original window.
到您的末尾.emacs
或.emacs.d/init.el
取决于您如何初始化 emacs。
或者,使其成为一个单独的函数,并绑定到一个键盘命令。(添加这些.emacs
而不是上面的代码。)
例如
(defun split-window-for-shell ()
"Split the current window and open a shell in the new window."
(interactive)
(split-window-horizontally nil)
(other-window 1)
(shell nil)
(other-window 1) ;; return you to the original window.
)
并绑定
(global-set-key (kbd "C-|") split-window-for-shell)
因此,您可以在需要时使用它,而不仅仅是在启动时。
(它将始终显示相同的 shell 实例。)
这是东西!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;; C编程的东西
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 饥饿删除很好,因为我们使用空格而不是制表符。(setq c-hungry-delete-key t)
;; 让 emacs 尽可能自动插入换行符。(setq c-auto-newline 1)
;; 启动 C 模式时设置 K&R 缩进样式。
(add-hook 'c-mode-hook
'(lambda ()
(c-set-style "k&r")
(auto-fill-mode 1)
))