This is part of the Emacs Starter Kit.
Configuration for the eminently useful Org Mode.
Org-mode is for keeping notes, maintaining ToDo lists, doing project planning, and authoring with a fast and effective plain-text system. Org Mode can be used as a very simple folding outliner or as a complex GTD system or tool for reproducible research and literate programming.
For more information on org-mode check out worg, a large Org-mode wiki which is also implemented using Org-mode and git.
(add-hook 'org-mode-hook
(lambda ()
(local-set-key "\M-\C-n" 'outline-next-visible-heading)
(local-set-key "\M-\C-p" 'outline-previous-visible-heading)
(local-set-key "\M-\C-u" 'outline-up-heading)
;; table
(local-set-key "\M-\C-w" 'org-table-copy-region)
(local-set-key "\M-\C-y" 'org-table-paste-rectangle)
(local-set-key "\M-\C-l" 'org-table-sort-lines)
;; display images
(local-set-key "\M-I" 'org-toggle-iimage-in-org)))
See the `=org-speed-commands-default=’ variable for a list of the keys
and commands enabled at the beginning of headlines. All code blocks
are available at the beginning of a code block, the following key
sequence C-c C-v h
(bound to `=org-babel-describe-bindings=’) will
display a list of the code blocks commands and their related keys.
(setq org-use-speed-commands t)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(sh . t)))
You are encouraged to add the following to your personal configuration although it is not added by default as a security precaution.
(setq org-confirm-babel-evaluate nil)
TAB
to as if it were used in the appropriate major mode. This means
that reading and editing code form inside of your Org-mode files is
much more like reading and editing of code using its major mode.
(setq org-src-fontify-natively t)
(setq org-src-tab-acts-natively t)
library-of-babel.org
(located in the Org-mode contrib/babel
directory) file for information on the functions, and see
worg:library-of-babel for more usage information.
Code blocks can be loaded into the library of babel from any Org-mode file using the `org-babel-lob-ingest’ function.