Emacs
Table of Contents
- Introduction
- Emacs basics
- Plugins
- Emacs Org-Mode
- Documentation
- Tasks
- Export
- Miscellaneous
- How to navigate within an Org document?
- How to define capture templates?
- How to insert a source code template?
- How to insert/edit an URL?
- How to track time on an action item?
- How to move a subtree into an archive file?
- How to export an Org file to HTML?
- How to configure the export settings?
- How to define deadline for TODO item
- How to create checkboxes
- How to use org-lint to check for broken links?
- Elisp
- Miscelleanous
Introduction
Sources of Information
- Worg, the Org-Mode Community!
- http://www.emacswiki.org/emacs/CategoryHelp
- https://www.gnu.org/software/emacs/manual/html_node/emacs/Help-Summary.html
- http://www.emacs.uniyar.ac.ru/doc/em24h/emacs083.htm
- http://sachachua.com/blog/2013/05/how-to-learn-emacs-a-hand-drawn-one-pager-for-beginners/
- M-x emacs-reddit
Emacs basics
Getting started
How to install Emacs on Windows?
The users home directory (~) can be declared by creating a HOME environment variable (gnu.org).
How to open the init file on Windows?
C-x C-f ~/.emacs
File handling
Command | Description | Reference |
---|---|---|
M-x make-directory | Create a new directory | gnu.org |
C-x C-s | Save file |
Windows
Command | Description | Reference |
---|---|---|
C-x o | Move focus from one split screen to the other | http://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Window.html#Other-Window |
Makros
How to create a persistent makro?
- <F3> to start the makro recording
- Type the key sequence
- <F4> to stop the makro recording
- <M-x name-last-kbd-macro> to assign a name
- Open ".emacs" file
- <M-x insert-kbd-macro>
- E.g., (global-set-key (kbd "C-<") 'concentrate-on-one-item)
How to replay the last makro?
- Bind the function "'call-last-kbd-macro" to a key (emacswiki.org)
- Press <F3>
- Do the action
- Press <F4>
- Press the specified to to replay the makro
Plugins
Setup
YASnippet
Emacs Org-Mode
Documentation
Tasks
How to insert a "SCHEDULED" entry for TODO items?
- <C-c C-s> Insert a start date for a task
- <C-c C-d> Insert a due date for a task
How to configure repeated tasks?
Repeated tasks can be configured by adding a time declaration at the end of the time stamp. If the tasks is set DONE with <C-c C-t>, it will be reset into the TODO state automatically. (orgmode.org)
How to show due regular tasks?
Show agenda for current week: <C-c a a>. It will display all scheduled items from the agenda files list.
Export
Miscellaneous
How to navigate within an Org document?
Command | Description |
---|---|
M+Enter | insert new item on same level |
M+UP | change order of items |
M+Right or left | change indentation of items |
Shift + Arrows | mark as TODO or done |
Tab | fold/unfold sub-sections |
How to define capture templates?
How to insert a source code template?
Command | Description | Reference |
---|---|---|
< s TAB | Insert source code template | orgmode.org |
How to insert/edit an URL?
Command | Description | Reference |
---|---|---|
C-c C-l | Insert/edit URL | orgmode.org |
How to track time on an action item?
- Add start time (clock in): C-c C-x C-i
CLOCK: [2016-02-10 Mi 21:32]
- Set stop time and calculate duration (clock out): C-c C-x C-o
CLOCK: [2016-02-10 Mi 21:32]--[2016-02-10 Mi 21:44] => 0:12
=> Clocking work time | The Org Manual
How to move a subtree into an archive file?
Command | Description | Reference |
---|---|---|
C-c $ | Move a subtree into an archive file | orgmode.org |
How to export an Org file to HTML?
C-c C-e h h
( orgmode.org )
How to configure the export settings?
How to define deadline for TODO item
- Go to item
- Hit C-c C-d
- Pick date
### Tag items with keywords
- move cursor to item
- hit C-c C-c
How to create checkboxes
a) create : [ ]
b) tick/untick : C-c C-c
c) overview : [/]
, then C-c C-c OR [%]
, then C-c C-c
How to use org-lint to check for broken links?
(Available for OrgMode version 9) http://stephen.planetbarr.com.s3-website-us-west-2.amazonaws.com/posts/2015-08-11-org-lint.html
Elisp
How to use conditionals?
How to declare variables?
(gnu.org)
How to get the docstring for a function?
C-h f (describe-function)
Miscelleanous
- mark-whole-buffer - Programming in Emacs Lisp
- targzeta/move-lines
- elisp - emacs load-path - Stack Overflow
- Which keys are XF86Back and XF86Forward in EMACS? - Stack Overflow
- EmacsWiki: Locate Files Anywhere
- Emacs: reopen buffers from last session on startup? - Stack Overflow
- Using countdown timers for alerts : emacs