Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default split window layout

I use aquamacs 90% of the time to edit R files with ESS (Emacs Speaks Statistics). In this mode, I find it indispensable to have a split window, C-x 3 C-x 2, such that I can view simultaneously the source code and the R buffer (terminal window). Thus, every time I launch aquamacs, I need to perform the following steps: split the window, select the right one, switch buffer to *R*, go back to the file. How can I save this setup across sessions?

thanks.

like image 531
baptiste Avatar asked Dec 21 '22 03:12

baptiste


2 Answers

Try this:

(defun open-r-project ()
  (interactive)
  (delete-other-windows)
  (split-window-horizontally)
  (R)
  (ess-change-directory "~/projects/")
  (next-multiframe-window)
  (find-file "~/projects/")
  (previous-multiframe-window)
)

(global-set-key (kbd "C-c r") 'open-r-project)

Note, however, that this is my first LISP function. I have no idea how to make the project dir parameter working. Will try tomorrow. Oh, and note that I'm using SVN version of ESS.

like image 145
aL3xa Avatar answered Dec 27 '22 09:12

aL3xa


There is C-c C-z (ess-switch-to-end-of-ESS) which does the splitting and switching to the end of ess inferior buffer. I am using it all the time.

like image 41
VitoshKa Avatar answered Dec 27 '22 10:12

VitoshKa