This page looks best with JavaScript enabled

Emacs basics

 ·  ☕ 2 min read  ·  ✍️ LifeIsFile

Emacs

Org-mode is note managing system built on emacs
Org-roam is personal knowledge system built on org-roam

Shortcuts

C+x C+s - save file
C+x C+c - exit
C-x k - close buffer
C-x b (list-buffers) -list all buffers
C-x left|right - switch buffers
C-x f - find and open file
M-x eval-buffer - reload config
C+space - to select
M+w - to copy
C+w - to cut
C+y - to paste
M-j - exit fido input (icomplete-fido-exit) to be able to add new node with matched name
C+k - kill line from current position
C+/ - undo
C+x o - next window
C+x 0 - close current window
C+x 1 - close other windows except this one
M-x toggle-truncate-lines
M-x auto-fill-mode
Tab - for collapse and expand headings

Custom shortcuts

C-c rf - delete file and buffer

Add Melpa archive

NOTE: Add all configs to ~.emacs

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)

Package funcs

M-x package-refresh-contents RET
M-x package-install RET org-roam RET

Emacs basic config

;; Make the colors and text less eye-strainy
(load-theme 'tango-dark t)
(set-face-attribute 'default nil :height 200)

;; I mindlessly press ESC, so stop me from wreaking havoc
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)

Org-Roam config

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

(require 'use-package)
(use-package org-roam
  :ensure t
  :custom
  (org-roam-directory (file-truename "~/org-roam"))
  (org-roam-completion-everywhere t)
  (org-roam-capture-templates
   '(
     ("d" "default" plain "%?"
      :if-new (file+head "%<%Y-%m-%d-%H:%M:%S>-${slug}.org" "#+title: ${title}\n#+date: %U\n")
      :unnarrowed t)

     ("b" "Books" plain "\n* Source\n\nAuthor: %^{Author}\n\nTitle: ${title}\n\nYear: %^{Year}\n\n* Summary\n\n"
      :if-new (file+head "%<%Y-%m-%d-%H:%M:%S>-${slug}.org" "#+title: ${title}\n#+date: %U\n#+filetags: :Books: :%^{Book type}:\n")
      :unnarrowed t)
     ))
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ;; ("C-c n g" . org-roam-graph) ;; Need graphviz package
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)

         ("C-c g" . org-id-get-create)
         :config
         ;; If you're using a vertical completion framework, you might want a more informative completion interface
         ;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
         (setq org-roam-completion-everywhere t)
         (org-roam-db-autosync-mode 1)
         ;; If using org-roam-protocol
         (require 'org-roam-protocol))
         

Multiline input

M-x icomplete-vertical-mode 
or
M-x fido-vertical-mode

MD support

  • Clone repo from git@github.com:nobiot/md-roam.git
  • Add to list
  • Install markdown mode

Alex Babochkin
REPORTED BY
LifeIsFile
CTO, DevOps, Backend developer