One Editor To Rule Them All Dan Berger Titus Winters

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

CS 497C – Introduction to UNIX Lecture 8: The vi/vim Editor Chin-Chih Chang
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
A Guide to Unix Using Linux Fourth Edition
PacNOG 6: Nadi, Fiji Using Commands in Linux Hervey Allen Network Startup Resource Center.
XEmacs Tips for Programmers A lunchtime seminar. XEmacs Background  XEmacs not Emacs on Linux hosts  XEmacs is a specialized LISP interpreter  Built-in.
THE UNIX SYSTEM Ashish Gupta TA, Intro to Networking Jan Recital 2 Introduction to Networking, Instructor: Prof. Yan Chen.
Introduction to EMACS and XEMACS CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 4P. 1Winter Quarter Introduction to UNIX.
Chapter 2 First Java Programs
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
CSCI 330 T HE UNIX S YSTEM Editing files. E DITOR C ONCEPTS Editing a file is to modify the content of a file Text editor: Enter and modify text in a.
A First Program Using C#
謝耀偉編著 國立高雄大學應用數學系 Living in Emacs DeveloperWorks, IBM.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Chapter 3 Mastering Editors
IE 411/511: Visual Programming for Industrial Applications
EDITORS Lab 1 EECS 448 Dr. Fengjun Li and Meenakshi Mishra.
EMACS To quote the Emacs Manual: Emacs is the extensible, customizable, self- documenting real-time display editor. Emacs is an editor for plain-text,
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
Chapter 3 – Part 1 Word Processing Writer for Linux CMPF 112 : COMPUTING SKILLS.
Productivity Programs Common Features and Commands.
Chapter 19: Visual Lisp. After completing this Chapter, you will be able to do the following: What is AutoLISP Launching Visual LISP Terminology and Fundamental.
CSCI N241: Fundamentals of Web Design Copyright ©2004  Department of Computer & Information Science Tools of Web Development 2: The Emacs Editor.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor.
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
Introduction to Unix – CS 21 Lecture 8. Lecture Overview More detail on emacs and vi Regular expression matching in emacs and vi.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
9/2/ CS171 -Math & Computer Science Department at Emory University.
4 Editing files and Emacs Editing files The Emacs editor.
Chapter 5 Editing Text Files. Basic Concept A text editor works on a file buffer that is a memory copy of a disk file The disk file is not updated until.
Unix Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
EMACS Jim Vallino Proud emacs user since The truth about editors Editors are like religions. Everyone has one that they like.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
Lesson 4-Mastering the Visual Editor. Overview Introducing the visual editor. Working in an existing file with vi. Understanding the visual editor. Navigating.
Chapter Three The UNIX Editors.
Data Display Debugger (DDD)
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
How to type papers Jonathan Herzog 11 Sept Man: tool-using animal  This talk: two tools for writing papers  Various (X)Emacs modes Help you actually.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Advanced UNIX progamming Fall 2002 Instructor: Ashok Srinivasan Lecture 2 Class web site:
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Presentation By:- Komal Sadhwani
Open Source Software Development Environment
Introduction to Computer CC111
Guide To UNIX Using Linux Third Edition
Computer Architecture “Bomb Lab Hints”
Text Editors Vim (Chapter 6) Emacs (Chapter 7)
Emacs CSC 135.
Run Java file with Window cmd
Introduction to Emacs J. Caldwell, N. McCaw, D. Powell
Linux Operations and Administration
Video Notes.
The Emacs Editor Read: Forouzan, Appendix C
CSCI The UNIX System Editing files
Introduction to Linux and Code Editing
Presentation transcript:

One Editor To Rule Them All Dan Berger Titus Winters

Introduction  The hacker community has a tradition of treating their favorite text editor with a reverence bordering on religious fanaticism… Editor wars are usually fought between the devottees of Emacs and vi, the most popular editors on Unix. -

Outline  A Brief Emacs history  Fundamental Emacs Concepts  Basic Commands/Key Chords  Using Emacs as an IDE  “Nifty” Features  Customizing Emacs

Emacs: A Brief History  Originally written in 1976 by Richard Stallman (scary dude) as a set of Editor MACroS for the TECO editor.  Two common strains in the wild: Emacs (the one we’re talking about here) and XEmacs (the one we’re not).  If you want to know more: try WikiPedia/wiki/Emacs

Fundamental Emacs Ideas  Emacs is essentially a lisp interpreter.  No – this isn’t an elisp hacking seminar.  What’s important is that elisp is Turing complete;  That means Emacs is horribly extensible – and can do anything you can express in elisp (see Turing Complete)

Terminology  A “key chord” is a set of keys pressed together.  Text is stored in “buffers” – often, but not always, buffers hold the contents of files.  Reading a file into a buffer is called “visiting” the file.  Portions of the emacs display are called “windows”  Multiple emacs displays are each called a “frame”

More Emacs Ideas  Emacs does its work by calling elisp functions – which are often bound to key chords.  Buffers have associated major and minor editing modes – so the editor can behave differently when you’re editing C/C++ code vs. Python code.

Basic Commands (I)  Starting emacs:  emacs [-nw] [file1 file2 … fileN]  emacs will run either in GUI mode (under X) or tty mode (in a terminal, or with the –nw flag)  Exiting emacs:  C-x C-c  Control-”x” Control-”c”  M-x save-buffers-kill-emacs  Meta (Alt or Esc)-”x” “save-buffers-kill-emacs”

Basic Commands (II)  Get help: C-h  Run a tutorial: C-h t  Open (visit) a file: C-x C-f  Save a buffer to a file: C-x C-s

Mark and Selection  Manipulating regions of text is easy – once you understand “the mark”  The mark is one end of the region you want to work on – the other end is determined by “the point” – which is the current cursor position.  Set the mark: C-spc

Manipulating Regions  Many emacs commands (can) work on a region of text. Remember – a region is between the mark and the cursor (point).  Examples:  C-w will “kill” (cut) the selected region  Esc-w will copy the selected region  C-y “yanks” (pastes) it back  M-x ispell-region will spell check the selected region of text.

Emacs as an IDE  Emacs was written by developers for developers – so it’s not surprising that it makes a pretty good IDE. You can:  Write code  Navigate code  Compile code  Debug Code  Interface with revision control (CVS)

Writing Code  Emacs has major modes for just about every language you can imagine.  It will perform syntax-aware indentation, can colorize the code, and is generally “aware” of the structure of the code. So you can jump around basic blocks, functions, etc.  Each major mode is different – C-h m will describe the current modes.

Navigating Code  Emacs includes a support program called etags – it builds a cross reference (index) of a set of files, and helps emacs find symbols.  Complete use is outside the scope of this talk, but Google can help.

Compiling  Simple: M-x compile  By default emacs will run Make – but you can run any command you want.  It will cd into the directory containing the file you were visiting when you invoked the compile.  This means that you may have to tell make which Makefile to use, if it’s not in that directory.

Debugging  GUD – Grand Unified Debugger mode – knows how to interface with many “standard” unix debuggers, including gdb (and dbx)  M-x gdb  M-x pdb  M-x jdb  An example is worth a thousand words…

CVS Integration  Emacs will recognize if a file (directory) is managed by CVS – and give you a set of CVS commands you can perform without leaving the editor including;  Checkout a file  Commit changes to a file  Diff a file against the repository  Register a new file with revision control

Nifty Features  font-lock-mode  flyspell-mode  M-x ispell-comments-and-strings  ediff mode  tramp

Font-Lock-Mode  Provides syntax hi-lighting for languages emacs understands (many).  You can customize the colors it uses – and the face (font).  Turn it on with:  M-x font-lock-mode  Colorize your world with:  M-x font-lock-fontify-buffer

Flyspell-Mode  On-the-FLY spell checking.  Turn it on with M-x flyspell-mode  As you move across text, it get’s spell checked. Errors are marked.  If you want to spell check the entire buffer,  M-x flyspell-buffer  To see suggested spellings, place the point (cursor) on the misspelled word and middle- click (or press Esc-$)

M-x ispell-comments  Just what it sounds like – it will spell-check your code – paying attention to comments and strings (between quotes).

ediff mode  diff (the file comparison tool) on steriods.  Give emacs two (or three!) files to compare – and it will help you navigate the differences – making it easy to update one file with the changes in another.  M-x ediff-files  M-x ediff-buffers

tramp  A tool for opening files that are not local over SSH  Any file (anywhere) can be represented as  i.e.:  Very low bandwidth – so it’s usable over slow/unreliable links.  Not in the standard Emacs package, but should be installed on CS machines “soon.”

Tramp (cont.)  If you want to install it on a personal machine (Linux or Windows), you can fetch it from: 

Customizing Emacs  On startup, emacs reads and evaluates ~/.emacs – which can contain arbitrary elisp code you want executed on startup.  My.emacs file (~dberger/.emacs) is world readable – let’s take a quick look at it now…  Recent versions of emacs also include a package to help you customize emacs – M-x customize will get you started.

Emacs on MS Windows   The windows portions of Dan’s.emacs file are old – and not “supported.”  I haven’t used Windows in years – so I’ve no idea if that config is still needed or functional.

Stuff We Didn’t Cover  Emacs can be a mail reader, web browser, psychologist, and much, much more.  We didn’t cover elisp – the lisp dialect that emacs uses – there’s a good tutorial on-line:  intro/