Help Topic: Getting Started with Emacs Spring 2020 Michael Benjamin, [email protected] Department of Mechanical Engineering, CSAIL MIT, Cambridge MA 02139

Help Topic: Getting Started with Emacs Spring 2020 Michael Benjamin, Mikerb@Mit.Edu Department of Mechanical Engineering, CSAIL MIT, Cambridge MA 02139

Help Topic: Getting Started with Emacs Spring 2020 Michael Benjamin, [email protected] Department of Mechanical Engineering, CSAIL MIT, Cambridge MA 02139 Getting Started with Emacs If you are using your own Linux machine, or your own Mac in 2.680, chances are you already are familiar with Emacs or a suitably equivalent text editor. This page is written with the new Mac user in mind who has never used Emacs. It may be useful for others as well. The pre-installed emacs Most likely your machine already has a version of emacs installed, with the full path name of /usr/bin/emacs. Verify this: $ which emacs /usr/bin/emacs If this is not the case, install it. On the Mac: $ sudo port install emacs In Linux: $ sudo apt-get install emacs The absolute minimal emacs There are many things you can do in emacs. Here we describe how to (1) open a file, (2) save a few changes, and (3) quit. This at least allows us to do a few things in emacs before learning further. 1. Open a file in emacs: $ /usr/bin/emacs testfile We use the full emacs pathname in the off chance that /usr/bin/ may not be in your shell path. You can try it without the /usr/bin/. You should be able to just type text, and use the arrow keys, backspace, delete etc., to just compose a sample for yourself. 1 2. Save a file in emacs: To save a file, type the following two commands: Ctrl-x, then Ctrl-s. You should see a line at the very bottom of your emacs window like: Wrote /Users/myname/testfile If not, type Ctrl-g in the emacs window (a useful way of resetting any weird state you may have gotten yourself into), and try the save again. 3. Quitting emacs: To quit emacs, type the following two commands: Ctrl-x, then Ctrl-c. Getting a more graphical Emacs The emacs in /usr/bin/emacs is fine for editing a text file right in the Terminal window, but normally you will want to edit files in a more graphical version of Emacs. We recommend also installing the emacs found at: www.emacsformacosx.com. After installation you will need to add the following to your shell path: /Applications/Emacs.app/Contents/MacOS Resources for Learning Emacs • Learning GNU Emacs, Debra Cameron, James Elliot, Marc Loy, Eric Raymond, and Bill Rosenblatt, 3rd Edition, 2005. • MIT E Library • Emacs Cheat Sheet (Bob Rogers), here. • Emacs Cheat Sheet (Hains/Princeton) here. • "Emacs vs. vi", Editor War 2.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us