W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode living knowledge WWU Münster Christoph Lehrenfeld November 4, 2015 (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 2 /31 Outline Emacs org-mode living knowledge WWU Münster Resources Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 3 /31 Outline Emacs org-mode living knowledge WWU Münster Resources Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 4 /31 Emacs - (More than) another editor ◮ Main developer: Richard Stallman history living knowledge ◮ 1976-1979, Greenberg: Collection of Macros WWU Münster (“Editor MACroS”) with Maclisp ◮ 1981, Gosling: erster Emacs (in C) with rudimentary scripting language (Mocklisp) ◮ 1984, Stallman: GNU Emacs (first GNU project) in Emacs Lisp (dialect to lisp ) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 5 /31 Features (a few) ◮ terminal-based ◮ keystrokes - independence of mouse (faster/remote access) ◮ support for many programming languages ◮ lots of included features (games/calendar/shell/...) living knowledge ◮ lots of extensions for special features WWU Münster ◮ highly customizable ◮ self-documenting (good manual-structure) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 6 /31 Getting started ◮ No how-to-use, rather motivation for emacs (or similar eds.) ◮ nice video tutorials: hack-emacs help commands: start a tutorial for emacs C-h t shows all active key bindings C-h b living knowledge displays command of a key binding C-h k WWU Münster explains function C-h f M-x TAB search/browse available functions (e.g. kill-emacs) C-h t means pressing Control( C ) and the t -key followed by (only) the t -key. Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 7 /31 My mostly used features (1) ◮ standard editor features(fast): (search, mark, replace, ...) ◮ modes: add functionality and adapt to file-type (buffer-type) ◮ macros (sequence of commands: record and replay) living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 7 /31 My mostly used features (1) ◮ standard editor features(fast): (search, mark, replace, ...) ◮ modes: add functionality and adapt to file-type (buffer-type) ◮ macros (sequence of commands: record and replay) coding: living knowledge ◮ autocompletion, tags (index of key words and ‘jump’ access to WWU Münster definitions) ◮ sessions (set of “buffers” for a project) ◮ compilation-mode (error/warnings jump to line) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 8 /31 My mostly used features (2) latex: ◮ flyspell-mode (spell checker) ◮ preview-latex, “compilation”, reftex-mode (list-access to labels, bib-entries..) living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 8 /31 My mostly used features (2) latex: ◮ flyspell-mode (spell checker) ◮ preview-latex, “compilation”, reftex-mode (list-access to labels, bib-entries..) living knowledge org-mode WWU Münster ◮ taking notes / preparation of talks / documentation ◮ export to html/latex/beamer/pdf/markdown (/ source code) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 9 /31 Usage of features How to use all these features? living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 10 /31 shortcuts/keystrokes for everything living knowledge WWU Münster https://xkcd.com/378/ Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 11 /31 My emacs It doesn’t matter what your editor is capable of! ◮ availability of features (fast/simple) ◮ good documentation living knowledge ◮ features should help you WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 11 /31 My emacs It doesn’t matter what your editor is capable of! ◮ availability of features (fast/simple) ◮ good documentation living knowledge ◮ features should help you WWU Münster How do I get my emacs to do what I want? Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 12 /31 customization Set Preferences user interface via “ M-x customize-variable ” Extend basic settings with config-files living knowledge ◮ Bind your keys to (sequences of) commands WWU Münster ◮ How do I do that ? Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 13 /31 emacs lisp ◮ scripting language (dialect to lisp ) ◮ emacs is written in emacs lisp (and C ) ◮ your configuration files are written in emacs lisp ◮ makes emacs highly customizable living knowledge key bindings WWU Münster (global-set-key (kbd "M-r") ’recompile) (global-set-key (kbd "<f5>") ’revert-buffer) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 14 /31 emacs lisp (more advanced) (sort of) new functionality (defun prelude-google () "Googles a query or region if any." (interactive) (browse-url living knowledge (concat WWU Münster "http://www.google.com/search?ie=utf-8&oe=utf-8&q=" (if mark-active (buffer-substring (region-beginning) (region-end)) (read-string "Google: "))))) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 15 /31 high level of customization living knowledge WWU Münster https://xkcd.com/1172/ Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 16 /31 some remarks on emacs ◮ There are other nice text editors out there (Sublime, vi(m), ..) ◮ cedet is an IDE for emacs (...) ◮ REPL (Read-eval-print loop) for script languages (python, lisp, ..) can nicely be done with emacs living knowledge ◮ Not everybody loves emacs: “a great operating system, lacking WWU Münster only a decent editor” Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 17 /31 There are other good editors living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 18 /31 Outline Emacs org-mode living knowledge WWU Münster Resources Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 19 /31 Origin and goals ◮ Original developer: Carsten Dominik ◮ Created 2003 to organize his life and work as a scientist living knowledge ◮ slogan: “org-mode: Your life in plain text” WWU Münster ◮ aims: ◮ note taking ◮ project planning ◮ authoring (e.g. this talk!) ◮ documentation (source code, literate programming) Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 20 /31 Main features ◮ everything in plain text (version control) (similar to Wiki-world but better!) ◮ outlining ◮ note-taking ◮ hyperlinks living knowledge ◮ spreadsheet features WWU Münster ◮ TODO lists ◮ literate programming (org-babel) ◮ documentation contains source code which can be extracted ◮ an emacs-mode Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 21 /31 org-mode as an emacs-mode Emacs-mode ◮ highly customizable ◮ integrates into other modes (latex/c++/..) living knowledge ◮ is bound to emacs :( WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 22 /31 org-mode files as documents Similar to Wikis ◮ lists ◮ tables ◮ formulas (full latex!) ◮ images living knowledge ◮ hyperlinks WWU Münster ◮ ... Exports to HTML/latex/beamer/pdf/markdown/ ... Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 23 /31 Note-taking example living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 24 /31 Literate programming Write documentation around your source code. ◮ Extensive documentation of your source code ◮ Extract source code from the same file as the documentation! living knowledge 1 double myf(double x) WWU Münster 2 { 3 return sqrt(x)+sqrt(1-x)+1-2.0*x; 4 } Christoph Lehrenfeld (lehrenfeld@wwu.de)
W ESTFÄLISCHE W ILHELMS -U NIVERSITÄT M ÜNSTER Emacs with org-mode 25 /31 Working with source code (org-babel) (octave) living knowledge WWU Münster Christoph Lehrenfeld (lehrenfeld@wwu.de)
Recommend
More recommend