1 / 18

EMACS

EMACS. Jim Vallino Proud emacs user since 1979. The truth about editors. Editors are like religions. Everyone has one that they like. What does emacs stand for?. Editor MACroS Eight Megs And Constantly Swapping EMACS Makes A Computer Slow EMACS Makes All Computing Simple

Télécharger la présentation

EMACS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EMACS Jim Vallino Proud emacs user since 1979

  2. The truth about editors • Editors are like religions. Everyone has one that they like.

  3. What does emacs stand for? • Editor MACroS • Eight Megs And Constantly Swapping • EMACS Makes A Computer Slow • EMACS Makes All Computing Simple • EMACS May Allow Customized Screwups • Escape Meta Alt Control Shift • Eventually Malloc()s All Computer Storage • Extensible Macro System

  4. How long has emacs been around? • Many variants have been developed • I first used it at Bell Labs in 1979 • Current favorites • GNU Emacs • XEmacs

  5. How do you use emacs? • Start it and use it • Current versions have menu interface so you do not have to remember lots of (any?) key sequences • Ctrl-G terminates any command • You will quickly customize it to your liking

  6. Customizing emacs • Under the hood emacs is run by elisp • Standard emacs library has elisp code to do just about everything • Including vip-mode for the “must have vi” crowd • ~/.emacs executed on startup to configure editor to your liking • Hack your way into a stupor writing elisp functions

  7. Can you do X in emacs? • Yes! • You may have to write some elisp code to get it to work though.

  8. Typical things done in .emacs • Fix braindead defaults for Ctrl-H and delete(global-set-key "\C-h" 'delete-backward-char)(global-set-key [delete] 'delete-char)(global-set-key "\M-h" 'help-command) • Set path to personal elisp library(defvar emacslib (expand-file-name "~/lib/emacs") • Set screen colors(set-background-color "black")(set-foreground-color "white")(set-cursor-color "white") • Trigger modes(setq auto-mode-alist (cons '("\\.txt\\'" . indented-text-mode) auto-mode-alist))

  9. More in .emacs • Load your personal keybindings • Custom-set-variables controlled from within emacs

  10. Searching • Standard • Incremental • Regular expression

  11. Emacs modes • Always editing in some “mode” • Mode usually based on file extension • Can set manually • Force in file: -*- Perl -*- • Name your favorite language there’s probably a mode for it

  12. What do you get with a mode? • Set of local key bindings • Some come transparently like auto indent • Templates • Syntax sensitive indenting • Abbreviations • Compilation commands • Hook function to run when mode is loaded • Customizing a mode

  13. Version control • RCS and CVS builtin • Register file initially • Check in/out • Add revision coments • Compare revisions

  14. Help system • Ctrl-H is default keybinding • Operation available • a – apropos • b – key bindings • c, k – describe key sequence • f – describe function • i – info command • m – describe mode • v – describe variable • w – where is command bound

  15. Emacs terms • Buffer – holds a file being edited; may or may not be visible • Window – a display region for a file • Frame – an Emacs “window” managed by the local windowing toolkit; may contain multiple windows • Multiple frames are allowed • Mark – a remembered hidden location • Point – current location of cursor

  16. Miscellaneous modes • Directory • Shell • Vip • If you can’t live without vi you can live with emacs with vip-mode • Full functionality of vi and ex

  17. What good is vi? • It’s available on every Unix system. • It starts in an instant

  18. What’s the difference between emacs and vi? • The difference between emacs and vi is like the difference between making love and masturbation. That is to say: vi will always be there when you need it.-- signature for Patrick Dockhorn, patsch@ubka.uni-karlsruhe.de

More Related