Students who have more advanced knowledge of computers and programming may be interested in more powerful ways to interact with racket programs.
As this thread presupposes an existing competence level (because you're advanced users), I will not be covering installation instructions. Emacs is available on Windows, Mac OSX, and Linux.
Please provide your own awesome tips and tricks to add to this thread!
I've just switched to Emacs myself, and I'm absolutely loving it. I was a long-time Vim user, but the migration to Emacs was surprisingly simple. In just 5 minutes, I was able to get Emacs running with a Racket frame directly below my script!
- Install Emacs24.
- For Linux, just install it with your package manager.
- For Mac OSX, you may want to try homebrew.
- Create a directory in your user's home called .emacs.d
- For Linux,
mkdir ~/.emacs.d
.
- For Linux,
- Launch Emacs.
- Type C-x C-f ~/.emacs.d/init.el RET
- You might be asked to Confirm this if the file does not yet exist. Hit RET.
-
Add the following to the buffer.
;; Marmalade repository (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
-
Type M-x package-initialize RET
-
With your cursor on the last closing parenthesis, type C-x C-e
- You should see the following text in the echo area at the bottom of your Emacs window.
(("marmalade" "http://marmalade-repo.org/packages/"))
- Type M-x package-install RET geiser RET
- This should download the geiser package and all its dependencies.
- If you don't like the frame that popped up, type C-x 1
- If you are not in the buffer containing your init.el file, use C-x b to get it back.
-
Add the following to the buffer containing your init.el file.
;; geiser with gracket (setq geiser-active-implementations '(racket) geiser-racket-use-gracket-p t)
-
Eval that with C-x C-e like in step 7.
-
Use C-x C-f to open or create a racket script (a file ending in .rkt).
- Use M-x run-geiser to launch a racket shell in a split buffer.
- RET means the return or enter key
- C-key means to hold ctrl, and press key, then release both
- M-key means to hold alt, and press key, then release both
- Remember to use C-x b to switch to different buffers and files
- Try C-x C-b to get a list of open buffers
- C-n and C-p scroll the cursor down and up, respectively
- C-f and C-b move the cursor forward and backward, respectively.
- M-f and M-b move the cursor forward and backward, respectively, in larger steps.
- Remember to use C-x C-f to open (and even create) new files
- Use M-x make-directory if you created a file with C-x C-f in a nonexistant directory (folder in Windows)
- Save your files! C-x s and C-x C-s
- If geiser failed to launch your racket then look here
- My .emacs.d
Please feel free to ask questions and note mistakes in my post. And please share your own awesome tips for setting up a sweet development environment with other tools!