Org-mode: beginners setup
Agenda Setup
Aсcording to the official Documentation for beginners the following things are necessary for starting to use Org-mode: Nothing at all!
From my side, I have to add that one probably still needs some
experience in using of Emacs itself. Basic setup to emacs
configuration file for Org-mode (~/.emacs
in my case):
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
; Jigurda
The first string will tell emacs automatically go to org-mode when
a file with .org extension is opened. The second string bind C-c+l
(big
C in emacs notation is Ctrl
button, -
to press it simultaneously,
+
to press in a sequence) key for storing a link to a particular
string particular file. This link can be inserted to org-file later
with C-c+C-l
. To open the link one can use C-c+C-o
. The third string
bind C-c+a
for agenda window:
For my Agenda I use two different files: tasks.org
and
schedule.org
. In schedule.org
I store events and task.org
is used
for everyday’s TODOs.
(define-key global-map "\C-cc" 'org-capture)
; Log done state in TODOs
(setq org-log-done t)
; Set Org-Capture templates
(setq org-capture-templates
`(
("t" "todo" entry (file+headline "~/Calendars/task.org" "Tasks")
(file "~/org/tasks.orgcaptmpl"))
("e" "event" entry (file+datetree "~/Calendars/schedule.org" "Events")
(file "~/org/events.orgcaptmpl"))
))
(setq org-agenda-files (list "~/Calendars/task.org"
"~/Calendars/schedule.org"
))
Org capture available with C-c+c
starts dialogue box where I can choose
which type of notes I want to create. With t
the task note will be
created. The task event will be stored in the file
~/Calendars/task.org
. I use ~/org/tasks.orgcaptmpl
as a template
for a task note. The template file for task look like:
** TODO %t %^{Title}
%?
%t
is time and %^{Title}
is the title. Guide to notes template with more
options is available
(http://emacsnyc.org/assets/documents/how-i-use-org-capture-and-stuff.pdf). The
same is for event type of notes.
Google Calendar in Emacs: Calfw
The other usefull tools for Org-mode Agenda are Calfw and Org-Gcal (thanks to http://jameswilliams.be/blog/2016/01/11/Taming-Your-GCal.html).
Calfw allows agenda to look nicely. It is actually like to have Google-Calendar view inside Emacs. For installation it is possible to simply clone emacs-calfw from the repo (https://github.com/kiwanami/emacs-calfw) and add to .emacs file the following strings:
(load "~/emacs/emacs-calfw/calfw.el")
(load "~/emacs/emacs-calfw/calfw-org.el")
(require 'calfw)
(require 'calfw-org)
(defalias 'ca 'cfw:open-org-calendar)
Then Calfw view is available with M-x ca
:
Google Calendar in Emacs: synchronization with Org-Gcal
Org-Gcal is used for synchronyzation with Google-calendar. To install it, one needs to clone:
- https://github.com/tkf/emacs-request
- https://github.com/jwiegley/alert
- https://github.com/kiwanami/emacs-deferred
- https://github.com/myuhe/org-gcal.el
and load to .emacs
file:
(load "~/emacs/alert/alert.el")
(load "~/emacs/emacs-request/request.el")
(load "~/emacs/emacs-deferred/deferred.el")
(load "~/emacs/emacs-request/request-deferred.el")
(load "~/emacs/org-gcal.el/org-gcal.el")
(require 'org-gcal)
The last thing to set up synchronization is to create application in Google-API that is allowed to access to Google-calendar. The instruction that is provided on https://github.com/myuhe/org-gcal.el seems outdated. Here I list the new up-to-date instruction:
- Go on Google Developers Console
- Create a project (with any name)
- Click on Google APIs
- Choose Calendar API
- Press “Enable” button to enable Calendar API for your project
- Press “Go to credentials” button to set up access
- Choose “OAuth client ID”, First you will offer to setup project consent screen. You need to sepcify only “Product name shown to users” line and press save button.
- After saving, “Create client ID” will appear and you should choose Application type “Other” and “Create”
- save client ID and client secret
- Go to Google Calendar
- Go to settings, Choose “Calendar” menu. Press on the name of calendar you want to synchronize.
- Near ICAL and HTML you will find Calendar ID: callendar id
So you finally have three different things: client ID, client secret and callendar id. Now to set up synchronization add the following strings to your emacs configuration file:
(setq org-gcal-client-id "cliend ID"
org-gcal-client-secret "client secret"
org-gcal-file-alist '(("callendar id" . "~/Calendars/schedule.org")
))
TODOs
- It is still not clear for me how to set up synchronization with Google Calendars Tasks.