Emacs

Table of Contents

Introduction

Emacs basics

Getting started

How to install Emacs on Windows?

(stackoverflow.com)

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

(stackoverflow.com)

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?

  1. <F3> to start the makro recording
  2. Type the key sequence
  3. <F4> to stop the makro recording
  4. <M-x name-last-kbd-macro> to assign a name
  5. Open ".emacs" file
  6. <M-x insert-kbd-macro>
  7. E.g., (global-set-key (kbd "C-<") 'concentrate-on-one-item)

How to replay the last makro?

  1. Bind the function "'call-last-kbd-macro" to a key (emacswiki.org)
  2. Press <F3>
  3. Do the action
  4. Press <F4>
  5. Press the specified to to replay the makro

Plugins

Emacs Org-Mode

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

(orgmode.org)

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.

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?

  1. Add start time (clock in): C-c C-x C-i
CLOCK: [2016-02-10 Mi 21:32]
  1. 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?

Elisp

How to use conditionals?

(gnu.org)

An example on actions depending on the operating system can be found here.

How to declare variables?

How to get the docstring for a function?

C-h f (describe-function)

Miscelleanous

GitHubImpressum