Pergunta

I'm using Aquamacs since few weeks and I'm trying to find good customizations. First, I just wanted my aquamacs to look like this on starting :

alt text

I mean on the left, my source code. and on the right a shell pane (started with C-X 3 + M-X shell).

I've done some search on emacs/aquamacs forums, and in stackOverflow too. But I'm still blocked on this. Thanks. :)

Foi útil?

Solução 2

HEre is the stuff !!

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; C programming stuff

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Hungry delete is nice since we use spaces instead of tabs. (setq c-hungry-delete-key t)

;; Let emacs insert newlines automatically whenever it can. (setq c-auto-newline 1)

;; Set the K&R indentation style when starting C-mode.

(add-hook 'c-mode-hook

      '(lambda ()
         (c-set-style "k&r")
         (auto-fill-mode 1)
         ))

Outras dicas

If all you need is to split the window and open the shell in the newly created window, you should be able to add this:

(split-window-horizontally nil)
(other-window 1)
(shell nil)
(other-window 1) ;; return you to the original window.

to the end of your .emacs or .emacs.d/init.el depending on how you initialise emacs.

Alternatively, make it a separate function, and bind to a key command. (add these to .emacs instead of the above code.)

e.g.

(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.
  )

And bind with

(global-set-key (kbd "C-|") split-window-for-shell)

So you can use it when you want, and not just at startup.

(It will always show the same instance of shell.)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top