Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 149 lines (131 sloc) 5.804 kb
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
1 #+TITLE: Starter Kit Org
2 #+OPTIONS: toc:nil num:nil ^:nil
3
4 This is part of the [[file:starter-kit.org][Emacs Starter Kit]].
5
6 * Starter Kit Org
7 Configuration for the eminently useful [[http://orgmode.org/][Org Mode]].
8
9 Org-mode is for keeping notes, maintaining ToDo lists, doing project
10 planning, and authoring with a fast and effective plain-text system.
11 Org Mode can be used as a very simple folding outliner or as a complex
12 GTD system or tool for reproducible research and literate programming.
13
14 For more information on org-mode check out [[http://orgmode.org/worg/][worg]], a large Org-mode wiki
15 which is also *implemented using* Org-mode and [[http://git-scm.com/][git]].
16
17 ** Org-Mode Hook
abc0301 @eschulte yas and org-mode are finally working well together
eschulte authored
18 The latest version of yasnippets doesn't play well with Org-mode, the
19 following function allows these two to play nicely together
20 #+begin_src emacs-lisp
21 (defun yas/org-very-safe-expand ()
8b7ea3d @eschulte tweaks to yasnippet/org setup
eschulte authored
22 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
abc0301 @eschulte yas and org-mode are finally working well together
eschulte authored
23 #+end_src
24
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
25 #+begin_src emacs-lisp
26 (add-hook 'org-mode-hook
27 (lambda ()
28 (local-set-key "\M-\C-n" 'outline-next-visible-heading)
29 (local-set-key "\M-\C-p" 'outline-previous-visible-heading)
30 (local-set-key "\M-\C-u" 'outline-up-heading)
31 ;; table
32 (local-set-key "\M-\C-w" 'org-table-copy-region)
33 (local-set-key "\M-\C-y" 'org-table-paste-rectangle)
34 (local-set-key "\M-\C-l" 'org-table-sort-lines)
35 ;; display images
36 (local-set-key "\M-I" 'org-toggle-iimage-in-org)
2426813 @eschulte now tracking the latest version of yasnippets also added org-mode snippe...
eschulte authored
37 ;; yasnippet (using the new org-cycle hooks)
38 (make-variable-buffer-local 'yas/trigger-key)
39 (setq yas/trigger-key [tab])
abc0301 @eschulte yas and org-mode are finally working well together
eschulte authored
40 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
8b7ea3d @eschulte tweaks to yasnippet/org setup
eschulte authored
41 (define-key yas/keymap [tab] 'yas/next-field)
42 ))
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
43 #+end_src
44
0a4b785 @eschulte enabling speed-commands for headlines and code blocks in Org-mode
eschulte authored
45 ** Speed keys
46 Speed commands enable single-letter commands in Org-mode files when
47 the point is at the beginning of a headline, or at the beginning of a
48 code block.
49
50 See the `=org-speed-commands-default=' variable for a list of the keys
51 and commands enabled at the beginning of headlines. All code blocks
52 are available at the beginning of a code block, the following key
53 sequence =C-c C-v h= (bound to `=org-babel-describe-bindings=') will
54 display a list of the code blocks commands and their related keys.
55
56 #+begin_src emacs-lisp
57 (setq org-use-speed-commands t)
58 #+end_src
59
4cbb949 @eschulte Changing default settings of code-blocks in Org-mode
eschulte authored
60 ** Code blocks
61 This activates a number of widely used languages, you are encouraged
62 to activate more languages using the customize interface for the
63 `=org-babel-load-languages=' variable, or with an elisp form like the
64 one below. The customize interface of `=org-babel-load-languages='
65 contains an up to date list of the currently supported languages.
66 #+begin_src emacs-lisp
67 (org-babel-do-load-languages
68 'org-babel-load-languages
69 '((emacs-lisp . t)
70 (sh . t)
71 (R . t)
72 (perl . t)
73 (ruby . t)
74 (python . t)
75 (js . t)
76 (haskell . t)
77 (clojure . t)
78 (ditaa . t)))
79 #+end_src
80
81 You are encouraged to add the following to your personal configuration
82 although it is not added by default as a security precaution.
83 #+begin_src emacs-lisp :tangle no
84 (setq org-confirm-babel-evaluate nil)
85 #+end_src
86
87 The following displays the contents of code blocks in Org-mode files
88 using the major-mode of the code. It also changes the behavior of
89 =TAB= to as if it were used in the appropriate major mode. This means
90 that reading and editing code form inside of your Org-mode files is
91 much more like reading and editing of code using its major mode.
92 #+begin_src emacs-lisp
93 (setq org-src-fontify-natively t)
94 (setq org-src-tab-acts-natively t)
95 #+end_src
96
f5c5330 @eschulte adding library of babel to the default starter kit initialization
eschulte authored
97 ** Load up the Library of Babel
98 The library of babel contains makes many useful functions available
99 for use by code blocks in *any* emacs file. See the actual
100 [[file:src/org/contrib/babel/library-of-babel.org][library-of-babel.org]] file for information on the functions, and see
101 [[http://orgmode.org/worg/org-contrib/babel/intro.php#library-of-babel][worg:library-of-babel]] for more usage information.
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
102 #+begin_src emacs-lisp
f5c5330 @eschulte adding library of babel to the default starter kit initialization
eschulte authored
103 (org-babel-lob-ingest
104 (expand-file-name
105 "library-of-babel.org"
106 (expand-file-name
107 "babel"
108 (expand-file-name
109 "contrib"
110 (expand-file-name
111 "org"
112 (expand-file-name "src" dotfiles-dir))))))
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
113 #+end_src
114
0d2e26b @eschulte Now the latest Org-mode manual will always be available in info
eschulte authored
115 ** Ensure the Latest Org-mode manual is in the info directory
116 By placing the =doc/= directory in Org-mode at the front of the
117 =Info-directory-list= we can be sure that the latest version of the
118 Org-mode manual is available to the =info= command (bound to =C-h i=).
119 #+begin_src emacs-lisp
120 (unless (boundp 'Info-directory-list)
7a17290 @eschulte default value of Info-directory-list is now based on Info-default-direct...
eschulte authored
121 (setq Info-directory-list Info-default-directory-list))
0d2e26b @eschulte Now the latest Org-mode manual will always be available in info
eschulte authored
122 (setq Info-directory-list
123 (cons (expand-file-name
124 "doc"
125 (expand-file-name
126 "org"
127 (expand-file-name "src" dotfiles-dir)))
128 Info-directory-list))
129 #+end_src
130
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
131 ** Starter Kit Documentation
132 This code defines the =starter-kit-project= which is used to publish
133 the documentation for the Starter Kit to html.
134
135 #+begin_src emacs-lisp :results silent
1f43f32 @eschulte tweaked publishing code
eschulte authored
136 (unless (boundp 'org-publish-project-alist)
137 (setq org-publish-project-alist nil))
9ec27ba @eschulte fixed code for publishing documentation
eschulte authored
138 (let ((this-dir (file-name-directory (or load-file-name buffer-file-name))))
139 (add-to-list 'org-publish-project-alist
140 `("starter-kit-documentation"
141 :base-directory ,this-dir
142 :base-extension "org"
681d4f4 @eschulte now using external css for starter-kit documentation
eschulte authored
143 :style "<link rel=\"stylesheet\" href=\"emacs.css\" type=\"text/css\"/>"
793a4c6 @eschulte linking to starter-kit-gnus.org from the main page
eschulte authored
144 :publishing-directory ,this-dir
9ec27ba @eschulte fixed code for publishing documentation
eschulte authored
145 :index-filename "starter-kit.org"
146 :auto-postamble nil)))
f277cfe @eschulte adding starter-kit-org.org, which includes a project definition for publ...
eschulte authored
147 #+end_src
148
Something went wrong with that request. Please try again.