- Emacs
emacs.app
brew cask install emacs
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.dbut it does create the path for command line. Tips for emacs setup on OS X.
git checkout develop #use the master version(setq org-startup-indented t), d t:
active timestamp: <2020-02-09 23:00 Sun>
, d T:
inactive timestamp [2020-02-09 Sun]
, i t: add tags to headline
SPC a o m: open a org-tags-view
, s a: add archive tag
, s n: narrow to the subtree
, s N: widen
SPC s s: search in current buffer
SPC s f: fuzzy search for files
SPC s d: ag search in current dir
SPC s r f: rg search in files
SPC a o m: search with tags in agenda files
SPC a o r: full text search in agenda files
SPC a o s: search with keywords in agenda files
Custom Commands:
SPC o s: helm-org-agenda-files-heading search headings in agenda files. Bind this to a shortcut.
-
Add more keywords
(setq org-todo-keywords '((sequence "iTODO(t)i" "PROGRESS(p)" "|" "DONE(d)" "CANCELLED(c)")))
org-todo-keywords
-
Add the highlights of the keywords
(custom-set-variables '(org-todo-keyword-faces (quote (("TODO" . "#dc752f") ("PROGRESS" . "#4f97d7") ("DONE" . "#86dc2f")))) )
org-todo-keyword-faces
If the effects are not taken, use org-mode-restart to clear the caches in Emacs.
The Org Manual Org Mode - Organize Your Life In Plain Text
C-c, C-, or , i b: open code block templates
C-c, C-,: open code block templates
C-c, C-': edit code block in separate window
C-c, C-C: edit code block in separate window
C-c, C-v, t: tangle code block in buffer
SPC u, C-c, C-v, t: tangle current code block
print "This Is A python code"
print "hahaha">>>
import edu.princeton.cs.algs4.StdIn;
class Test {
private String pat;
public Test(String pat) {
this.pat = pat;
}
public static void main(String[] args) {
System.out.println("Hello World!");
}
}print("this")C-c a: trigger org-agenda menu
(setq org-agenda-files (quote
("~/OneDrive/org/notes.org"
"~/OneDrive/org/gtd.org")))org-agenda-files
-
In agenda view
C-c C-s: to schedule item
C-c c: trigger org-capture
org-capture-templates
- Add template for org-capture.
(setq org-capture-templates
'(("n" "Notes" entry (file+headline "~/OneDrive/org/notes.org" "Notes"))
("t" "ToDo" entry (file+headline "~/OneDrive/org/gtd.org" "Tasks")
"* TODO %?\n %i\n %a")
))- How to use Template Expansion
-
configuration in
org-modules(defun dotspacemacs/user-config () "Configuration for user code: This function is called at the very end of Spacemacs startup, after layer configuration. Put your configuration code here, except for variables that should be set before packages are loaded." (setq org-modules (quote (org-habit))) (setq org-agenda-files '("~/OneDrive/org/gtd.org")) )
-
add a schedule to a TODO task.
-
add
:STYLE: habitto the task.
C-k toggle habit in agenda view
Problem after installation of the develop branch.
# org-refile does not work. org-copy-subtree: Invalid function: org-preserve-local-variables
cd ~/.emacs.d && git pull --rebase; find ~/.emacs.d/elpa/2*/develop/org-plus-contrib* -name '*.elc' -delete, s r: open refile window
(setq org-refile-targets '((org-agenda-files :maxlevel . 3)))
(setq org-refile-use-outline-path 'file)
(setq org-outline-path-complete-in-steps nil)file:///Users/alfmunny/.spacemacs
SPC m e e open export menu
Options:
-
:Archive: tag,
, s aMaybe suitable for some project
-
Archive to
C-c C-x A(org-archive-to-archive-sibling)For major categories, like this one Tasks
-
Use org-refile, refile it to a structured notes,
, s rImportant notes, which has to be taken into notes
-
Archive to *archive,
, s ANot needed anymore
Reference: info:org#Archiving
(spacemacs/declare-prefix "o" "custom")
(spacemacs/set-leader-keys "os" 'helm-org-agenda-files-headings)(global-set-key (kbd "C-c n l") 'org-roam)
(global-set-key (kbd "C-c n f") 'org-roam-find-file)
(global-set-key (kbd "C-c n g") 'org-roam-graph)
(global-set-key (kbd "C-c n i") 'org-roam-insert)
(global-set-key (kbd "C-c n I") 'org-roam-insert-immediate)https://develop.spacemacs.org/doc/DOCUMENTATION.html#binding-keys
g-r-A multi editing using visual selection
g-r-q quit register
, C i: clock in
, C o: clock out
, C R: clock report
:LOGBOOK:
CLOCK: [2020-02-13 Thu 17:04]--[2020-02-13 Thu 17:06] => 0:02
:END:
SPC m s b: send buffer SPC m s B: send buffer and switch to REPL SPC m s f: send function and switch to REPL SPC m s i: start the inferior REPL process SPC m c c: execute current file in a comint shell
setq visual-line-mode tTo navigate under visual line mode:
M-x spacemacs/toggle-visual-line-navigation-on
SPC t n a absolute line number
SPC t n r relative line number
SPC t n v visual line number
SPC t S toggle spell checking
(setq spell-checking-enable-by-default nil)C-u C-c . insert current active time with prompt
C-u C-u C-c . insert current active time without prompt
C-u C-c ! insert current inactive time with prompt C-u C-u C-c ! insert current inactive time without prompt
M-x writeroom-mode Writeroom Mode
mov ax, 1000H