Skip to content

Commit

Permalink
lots of minor org-mode tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Stein committed Sep 12, 2018
1 parent a0bdee3 commit d45afd4
Showing 1 changed file with 75 additions and 6 deletions.
81 changes: 75 additions & 6 deletions config/init-31-doc-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

;;; Code:


(use-package org
:ensure org-plus-contrib
:init
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-mode-hook 'org-indent-mode)
Expand All @@ -28,9 +30,11 @@
:diminish org-indent-mode
:defer t
:bind (("\C-c a" . org-agenda)
("\C-c c" . org-capture))
("\C-c c" . org-capture)
("\C-c j" . gs-helm-org-link-to-contact))
:config


(defun sk/diminish-org-indent ()
"Diminish org-indent-mode on the modeline"
(interactive)
Expand All @@ -48,21 +52,56 @@
(load-file "~/.emacs.d/config/gs-org.el")
(require 'org)

(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")

;; == Agenda ==
(defvar org-agenda-window-setup)
(setq org-agenda-window-setup 'current-window)

;; Run/highlight code using babel in org-mode
(org-babel-do-load-languages
'org-babel-load-languages
'(
(python . t)
(ipython . t)
(octave . t)
(C . t)
(sh . t)
(shell . t)
))
;; Syntax hilight in #+begin_src blocks
(setq org-src-fontify-natively t)
;; Don't prompt before running code in org
(setq org-confirm-babel-evaluate nil)
;; Display inline images after running code
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

;; Org + LaTeX
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("book-noparts"
"\\documentclass{book}"
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))


(use-package helm-org-rifle
:ensure t)

(use-package ob-async
:ensure t
;:load-path "/Users/Greg/Desktop/ob-async"
:config
(setq ob-async-no-async-languages-alist '("ipython"))
)

(use-package ob-ipython
:ensure t)

;; Capture mode
(add-hook 'org-capture-mode-hook 'evil-insert-state)
Expand Down Expand Up @@ -102,7 +141,7 @@
)
(general-define-key
:keymaps 'org-agenda-mode-map
:prefix (concatenate 'string gjs-leader-key)
:prefix gjs-leader-key
:states '(normal motion)
"" '(:ignore t :which-key "Agenda")
"i" 'org-agenda-clock-in
Expand All @@ -111,8 +150,11 @@
"t" 'org-agenda-todo
"w" 'org-agenda-refile
"/" 'org-agenda-filter-by-tag
"cs" '(gs-org-goto :which-key "org goto")
"c/" '(helm-org-rifle :which-key "org-rifle")
)


;; Evil key configuration (org)

(defun gs-org-meta-return (&optional _arg)
Expand All @@ -127,7 +169,14 @@
(interactive)
(org-insert-heading '(4) invisible-ok)
(evil-insert 0))


(defun gs-org-goto ()
"Insert heading with `org-insert-heading-respect-content' set to t."
(interactive)
(org-refile '(4))
;; (let ((org-goto-interface 'outline-path-completion)) (org-goto))
)

;; (general-define-key
;; :keymaps org-mode-map
;; :states '(normal)
Expand All @@ -141,12 +190,32 @@
"i" '(org-clock-in :which-key "clock in")
"o" '(org-clock-out :which-key "clock out")
"t" '(org-todo :which-key "todo state")
"ct" '(org-todo :which-key "todo state")
"ce" '(org-export-dispatch :which-key "org export")
"cp" '(org-set-property :which-key "org set property")
"cs" '(gs-org-goto :which-key "org goto")
"cj" '(gs-helm-org-link-to-contact :which-key "link contact")
"c/" '(helm-org-rifle :which-key "org-rifle")
)

;; some functions for timing
)

(use-package org-ref
:ensure t
:after org
:init
(setq reftex-default-bibliography '("~/org/resources/bibliography/references.bib"))
;; see org-ref for use of these variables
(setq org-ref-default-bibliography '("~/org/resources/bibliography/references.bib"))

;; Ensure LaTeX export correctly produces the bibliography
(setq org-latex-pdf-process
'("pdflatex -interaction nonstopmode -output-directory %o %f"
"bibtex %b"
"pdflatex -interaction nonstopmode -output-directory %o %f"
"pdflatex -interaction nonstopmode -output-directory %o %f"))
)

(defun org-build-agenda ()
(interactive)
(setq last-build-time (format-time-string "%S.%3N"))
Expand Down

0 comments on commit d45afd4

Please sign in to comment.