mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 12:30:59 +01:00
get rid of outshine
This commit is contained in:
@@ -100,7 +100,7 @@ Returns t if version changed, nil otherwise."
|
|||||||
(beginning-of-buffer)
|
(beginning-of-buffer)
|
||||||
(re-search-forward ";; .. Changelog")
|
(re-search-forward ";; .. Changelog")
|
||||||
(next-line)
|
(next-line)
|
||||||
(tvd-outshine-end-of-section)
|
;; (tvd-outshine-end-of-section)
|
||||||
(when newversion
|
(when newversion
|
||||||
(insert (format "\n;; %s\n" tvd-emacs-version)))
|
(insert (format "\n;; %s\n" tvd-emacs-version)))
|
||||||
(insert (format ";; - %s\n" entry)))))
|
(insert (format ";; - %s\n" entry)))))
|
||||||
@@ -116,12 +116,9 @@ Returns t if version changed, nil otherwise."
|
|||||||
show-trailing-whitespace t)
|
show-trailing-whitespace t)
|
||||||
(eldoc-mode t)
|
(eldoc-mode t)
|
||||||
|
|
||||||
;; enable outline (with outshine)
|
;; enable outline
|
||||||
(outline-minor-mode)
|
(outline-minor-mode)
|
||||||
|
|
||||||
;; enable outshine mode
|
|
||||||
(outshine-hook-function)
|
|
||||||
|
|
||||||
(electric-indent-local-mode t)))
|
(electric-indent-local-mode t)))
|
||||||
|
|
||||||
;; use UP arrow for history in *ielm* as well, just as C-up
|
;; use UP arrow for history in *ielm* as well, just as C-up
|
||||||
|
|||||||
365
conf-lisp/org.el
365
conf-lisp/org.el
@@ -6,163 +6,163 @@
|
|||||||
|
|
||||||
;; I like custom bullets
|
;; I like custom bullets
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:config
|
:config
|
||||||
(setq org-bullets-bullet-list '("►" "✜" "✸" "✿" "♦")))
|
(setq org-bullets-bullet-list '("►" "✜" "✸" "✿" "♦")))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:config
|
:config
|
||||||
|
|
||||||
|
|
||||||
;; enable syntax highlighting for embedded source blocks
|
;; enable syntax highlighting for embedded source blocks
|
||||||
(require 'ob-python)
|
(require 'ob-python)
|
||||||
(require 'ob-perl)
|
(require 'ob-perl)
|
||||||
(require 'ob-shell)
|
(require 'ob-shell)
|
||||||
|
|
||||||
|
|
||||||
;; capture target, os-dependend
|
;; capture target, os-dependend
|
||||||
;; FIXME: put this file outside emacs?
|
;; FIXME: put this file outside emacs?
|
||||||
(setq tvd-org-file (concat tvd-config-dir "/notizen.org")
|
(setq tvd-org-file (concat tvd-config-dir "/notizen.org")
|
||||||
org-attach-directory (concat tvd-config-dir "/attachments"))
|
org-attach-directory (concat tvd-config-dir "/attachments"))
|
||||||
|
|
||||||
;; easier to open that way
|
;; easier to open that way
|
||||||
(defun notizen()
|
(defun notizen()
|
||||||
(interactive)
|
(interactive)
|
||||||
(switch-to-buffer (find-file tvd-org-file))
|
(switch-to-buffer (find-file tvd-org-file))
|
||||||
(agenda))
|
(agenda))
|
||||||
|
|
||||||
;; text formatting made easy, bound to C-c keys locally
|
;; text formatting made easy, bound to C-c keys locally
|
||||||
(defun tvd-org-emphasize(CHAR)
|
(defun tvd-org-emphasize(CHAR)
|
||||||
"expand once if no region and apply emphasize CHAR"
|
"expand once if no region and apply emphasize CHAR"
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (region-active-p)
|
(unless (region-active-p)
|
||||||
(er/expand-region 1))
|
(er/expand-region 1))
|
||||||
(org-emphasize CHAR))
|
(org-emphasize CHAR))
|
||||||
|
|
||||||
(defun bold()
|
(defun bold()
|
||||||
"bold text in org mode"
|
"bold text in org mode"
|
||||||
(interactive)
|
(interactive)
|
||||||
(tvd-org-emphasize '42))
|
(tvd-org-emphasize '42))
|
||||||
|
|
||||||
(defun italic()
|
(defun italic()
|
||||||
"italic text in org mode"
|
"italic text in org mode"
|
||||||
(interactive)
|
(interactive)
|
||||||
(tvd-org-emphasize '47))
|
(tvd-org-emphasize '47))
|
||||||
|
|
||||||
(defun code()
|
(defun code()
|
||||||
"verbatim text in org mode"
|
"verbatim text in org mode"
|
||||||
(interactive)
|
(interactive)
|
||||||
(tvd-org-emphasize '126))
|
(tvd-org-emphasize '126))
|
||||||
|
|
||||||
(defun underline()
|
(defun underline()
|
||||||
"underline text in org mode"
|
"underline text in org mode"
|
||||||
(interactive)
|
(interactive)
|
||||||
(tvd-org-emphasize '95))
|
(tvd-org-emphasize '95))
|
||||||
|
|
||||||
;; my org-mode specific <C-left> and <C-right>
|
;; my org-mode specific <C-left> and <C-right>
|
||||||
(defun tvd-org-left-or-level-up()
|
(defun tvd-org-left-or-level-up()
|
||||||
"jump one word to the left if not on a org heading,
|
"jump one word to the left if not on a org heading,
|
||||||
otherwise fold current level and jump one level up."
|
otherwise fold current level and jump one level up."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (and (org-at-heading-p) (looking-at "*"))
|
(if (and (org-at-heading-p) (looking-at "*"))
|
||||||
(progn
|
(progn
|
||||||
(hide-subtree)
|
(hide-subtree)
|
||||||
(outline-up-heading 1))
|
(outline-up-heading 1))
|
||||||
(left-word)))
|
(left-word)))
|
||||||
|
|
||||||
(defun tvd-org-heading-up()
|
(defun tvd-org-heading-up()
|
||||||
"If on a heading, fold current heading, jump one level
|
"If on a heading, fold current heading, jump one level
|
||||||
up and unfold it, otherwise jump paragraph as usual."
|
up and unfold it, otherwise jump paragraph as usual."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (and (org-at-heading-p) (looking-at "*"))
|
(if (and (org-at-heading-p) (looking-at "*"))
|
||||||
(progn
|
(progn
|
||||||
(hide-subtree)
|
(hide-subtree)
|
||||||
(org-backward-heading-same-level 1)
|
(org-backward-heading-same-level 1)
|
||||||
(org-cycle))
|
(org-cycle))
|
||||||
(backward-paragraph)))
|
(backward-paragraph)))
|
||||||
|
|
||||||
(defun tvd-org-heading-down()
|
(defun tvd-org-heading-down()
|
||||||
"If on a heading, fold current heading, jump one level
|
"If on a heading, fold current heading, jump one level
|
||||||
down and unfold it, otherwise jump paragraph as usual."
|
down and unfold it, otherwise jump paragraph as usual."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (and (org-at-heading-p) (looking-at "*"))
|
(if (and (org-at-heading-p) (looking-at "*"))
|
||||||
(progn
|
(progn
|
||||||
(hide-subtree)
|
(hide-subtree)
|
||||||
(org-forward-heading-same-level 1)
|
(org-forward-heading-same-level 1)
|
||||||
(org-cycle))
|
(org-cycle))
|
||||||
(forward-paragraph)))
|
(forward-paragraph)))
|
||||||
|
|
||||||
;; org-mode specific config, after load
|
;; org-mode specific config, after load
|
||||||
(eval-after-load "org"
|
(eval-after-load "org"
|
||||||
'(progn
|
'(progn
|
||||||
(add-hook 'org-mode-hook
|
(add-hook 'org-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(setq
|
(setq
|
||||||
org-M-RET-may-split-line nil
|
org-M-RET-may-split-line nil
|
||||||
org-agenda-files (list tvd-org-file)
|
org-agenda-files (list tvd-org-file)
|
||||||
org-agenda-restore-windows-after-quit t
|
org-agenda-restore-windows-after-quit t
|
||||||
org-blank-before-new-entry (quote ((heading . auto) (plain-list-item . auto)))
|
org-blank-before-new-entry (quote ((heading . auto) (plain-list-item . auto)))
|
||||||
org-catch-invisible-edits (quote error)
|
org-catch-invisible-edits (quote error)
|
||||||
org-columns-default-format "%80ITEM %22Timestamp %TODO %TAGS %0PRIORITY"
|
org-columns-default-format "%80ITEM %22Timestamp %TODO %TAGS %0PRIORITY"
|
||||||
org-insert-heading-always-after-current (quote t)
|
org-insert-heading-always-after-current (quote t)
|
||||||
org-mouse-1-follows-link nil
|
org-mouse-1-follows-link nil
|
||||||
org-remember-store-without-prompt t
|
org-remember-store-without-prompt t
|
||||||
org-reverse-note-order t
|
org-reverse-note-order t
|
||||||
org-startup-indented t
|
org-startup-indented t
|
||||||
org-startup-truncated nil
|
org-startup-truncated nil
|
||||||
org-return-follows-link t
|
org-return-follows-link t
|
||||||
org-use-speed-commands t
|
org-use-speed-commands t
|
||||||
org-yank-adjusted-subtrees t
|
org-yank-adjusted-subtrees t
|
||||||
org-refile-targets '((nil . (:maxlevel . 5)))
|
org-refile-targets '((nil . (:maxlevel . 5)))
|
||||||
org-refile-use-outline-path t
|
org-refile-use-outline-path t
|
||||||
org-outline-path-complete-in-steps nil
|
org-outline-path-complete-in-steps nil
|
||||||
org-completion-use-ido t
|
org-completion-use-ido t
|
||||||
org-support-shift-select t
|
org-support-shift-select t
|
||||||
org-hide-emphasis-markers t
|
org-hide-emphasis-markers t
|
||||||
org-fontify-done-headline t
|
org-fontify-done-headline t
|
||||||
org-pretty-entities t
|
org-pretty-entities t
|
||||||
org-use-sub-superscripts nil
|
org-use-sub-superscripts nil
|
||||||
org-confirm-babel-evaluate nil)
|
org-confirm-babel-evaluate nil)
|
||||||
; shortcuts
|
; shortcuts
|
||||||
(setq org-speed-commands-user
|
(setq org-speed-commands-user
|
||||||
(quote (
|
(quote (
|
||||||
("0" . ignore)
|
("0" . ignore)
|
||||||
("1" . delete-other-windows)
|
("1" . delete-other-windows)
|
||||||
("2" . ignore)
|
("2" . ignore)
|
||||||
("3" . ignore)
|
("3" . ignore)
|
||||||
("d" . org-archive-subtree-default-with-confirmation) ; delete, keep track
|
("d" . org-archive-subtree-default-with-confirmation) ; delete, keep track
|
||||||
("v" . org-narrow-to-subtree) ; only show current heading ("view")
|
("v" . org-narrow-to-subtree) ; only show current heading ("view")
|
||||||
("q" . widen) ; close current heading and show all ("quit")
|
("q" . widen) ; close current heading and show all ("quit")
|
||||||
(":" . org-set-tags-command) ; add/edit tags
|
(":" . org-set-tags-command) ; add/edit tags
|
||||||
("t" . org-todo) ; toggle todo type, same as C-t
|
("t" . org-todo) ; toggle todo type, same as C-t
|
||||||
("z" . org-refile) ; archive the (sub-)tree
|
("z" . org-refile) ; archive the (sub-)tree
|
||||||
("a" . org-attach) ; manage attachments
|
("a" . org-attach) ; manage attachments
|
||||||
)))
|
)))
|
||||||
; same as toggle
|
; same as toggle
|
||||||
(local-set-key (kbd "C-t") 'org-todo)
|
(local-set-key (kbd "C-t") 'org-todo)
|
||||||
|
|
||||||
; alt-enter = insert new subheading below current
|
; alt-enter = insert new subheading below current
|
||||||
(local-set-key (kbd "<M-return>") 'org-insert-subheading)
|
(local-set-key (kbd "<M-return>") 'org-insert-subheading)
|
||||||
|
|
||||||
; search for tags (ends up in agenda view)
|
; search for tags (ends up in agenda view)
|
||||||
(local-set-key (kbd "C-f") 'org-tags-view)
|
(local-set-key (kbd "C-f") 'org-tags-view)
|
||||||
|
|
||||||
; run presenter, org-present must be installed and loadedwhite
|
; run presenter, org-present must be installed and loadedwhite
|
||||||
(local-set-key (kbd "C-p") 'org-present)
|
(local-set-key (kbd "C-p") 'org-present)
|
||||||
|
|
||||||
; todo colors
|
; todo colors
|
||||||
(setq org-todo-keyword-faces '(
|
(setq org-todo-keyword-faces '(
|
||||||
("TODO" . (:foreground "deepskyblue" :weight bold))
|
("TODO" . (:foreground "deepskyblue" :weight bold))
|
||||||
("START" . (:foreground "olivedrab" :weight bold))
|
("START" . (:foreground "olivedrab" :weight bold))
|
||||||
("WAIT" . (:foreground "darkorange" :weight bold))
|
("WAIT" . (:foreground "darkorange" :weight bold))
|
||||||
("DONE" . (:foreground "forestgreen" :weight bold))
|
("DONE" . (:foreground "forestgreen" :weight bold))
|
||||||
("CANCEL" . (:foreground "red" :weight bold))
|
("CANCEL" . (:foreground "red" :weight bold))
|
||||||
("FAIL" . (:foreground "red" :weight bold))
|
("FAIL" . (:foreground "red" :weight bold))
|
||||||
))
|
))
|
||||||
|
|
||||||
(local-set-key (kbd "C-c b") 'bold)
|
(local-set-key (kbd "C-c b") 'bold)
|
||||||
(local-set-key (kbd "C-c /") 'italic)
|
(local-set-key (kbd "C-c /") 'italic)
|
||||||
(local-set-key (kbd "C-c 0") 'code) ; aka = without shift
|
(local-set-key (kbd "C-c 0") 'code) ; aka = without shift
|
||||||
(local-set-key (kbd "C-c _") 'underline)
|
(local-set-key (kbd "C-c _") 'underline)
|
||||||
|
|
||||||
; edit babel src block in extra buffer:
|
; edit babel src block in extra buffer:
|
||||||
; default is C-c ' which is hard to type
|
; default is C-c ' which is hard to type
|
||||||
@@ -170,73 +170,78 @@ down and unfold it, otherwise jump paragraph as usual."
|
|||||||
; Also note: enter <s then TAB inserts a code block
|
; Also note: enter <s then TAB inserts a code block
|
||||||
; Next, C-c C-c executes the code, adding :results table at the
|
; Next, C-c C-c executes the code, adding :results table at the
|
||||||
; end of the begin line, creates a table of the output
|
; end of the begin line, creates a table of the output
|
||||||
(local-set-key (kbd "C-c C-#") 'org-edit-special)
|
(local-set-key (kbd "C-c C-#") 'org-edit-special)
|
||||||
|
|
||||||
;; faster jumping
|
;; faster jumping
|
||||||
(local-set-key (kbd "<C-up>") 'tvd-org-heading-up)
|
(local-set-key (kbd "<C-up>") 'tvd-org-heading-up)
|
||||||
(local-set-key (kbd "<C-down>") 'tvd-org-heading-down)
|
(local-set-key (kbd "<C-down>") 'tvd-org-heading-down)
|
||||||
|
|
||||||
;; move word left or heading up, depending where point is
|
;; move word left or heading up, depending where point is
|
||||||
(local-set-key (kbd "<C-left>") 'tvd-org-left-or-level-up)
|
(local-set-key (kbd "<C-left>") 'tvd-org-left-or-level-up)
|
||||||
|
|
||||||
;; use nicer bullets
|
;; use nicer bullets
|
||||||
(when (fboundp 'org-bullets-mode)
|
(when (fboundp 'org-bullets-mode)
|
||||||
(org-bullets-mode 1))
|
(org-bullets-mode 1))
|
||||||
|
|
||||||
(org-babel-do-load-languages 'org-babel-load-languages
|
(org-babel-do-load-languages 'org-babel-load-languages
|
||||||
'((python . t)
|
'((python . t)
|
||||||
(emacs-lisp . t)
|
(emacs-lisp . t)
|
||||||
(shell . t)
|
(shell . t)
|
||||||
(perl . t)))))))
|
(perl . t)))))))
|
||||||
|
|
||||||
;; no more ... at the end of a heading
|
;; no more ... at the end of a heading
|
||||||
(setq org-ellipsis " ⤵")
|
(setq org-ellipsis " ⤵")
|
||||||
|
|
||||||
;; my own keywords, must be set globally, not catched correctly inside hook
|
;; my own keywords, must be set globally, not catched correctly inside hook
|
||||||
(setq org-todo-keywords
|
(setq org-todo-keywords
|
||||||
'((sequence "TODO" "START" "WAIT" "|" "DONE" "CANCEL" "FAIL")))
|
'((sequence "TODO" "START" "WAIT" "|" "DONE" "CANCEL" "FAIL")))
|
||||||
|
|
||||||
;; I always want to be able to capture, even if no ORG is running
|
;; I always want to be able to capture, even if no ORG is running
|
||||||
(global-set-key (kbd "C-n") (lambda () (interactive) (org-capture)))
|
(global-set-key (kbd "C-n") (lambda () (interactive) (org-capture)))
|
||||||
|
|
||||||
;; must be global since code edit sub buffers run their own major mode, not org
|
;; must be global since code edit sub buffers run their own major mode, not org
|
||||||
(global-set-key (kbd "C-c C-#") 'org-edit-src-exit)
|
(global-set-key (kbd "C-c C-#") 'org-edit-src-exit)
|
||||||
|
|
||||||
;; some org mode vars must be set globally
|
;; some org mode vars must be set globally
|
||||||
(setq org-default-notes-file tvd-org-file
|
(setq org-default-notes-file tvd-org-file
|
||||||
org-startup-indented t
|
org-startup-indented t
|
||||||
org-indent-indentation-per-level 4)
|
org-indent-indentation-per-level 4)
|
||||||
|
|
||||||
;; my own capture templates
|
;; my own capture templates
|
||||||
(setq org-capture-templates
|
(setq org-capture-templates
|
||||||
'(("n" "Project" entry (file+headline tvd-org-file "Unsorted Tasks")
|
'(("n" "Project" entry (file+headline tvd-org-file "Unsorted Tasks")
|
||||||
"* TODO %^{title}\n%u\n** Kostenstelle\n** Contact Peer\n** Contact Customer\n** Aufträge\n** Daten\n** Notizen\n %i%?\n"
|
"* TODO %^{title}\n%u\n** Kostenstelle\n** Contact Peer\n** Contact Customer\n** Aufträge\n** Daten\n** Notizen\n %i%?\n"
|
||||||
:prepend t :jump-to-captured t)
|
:prepend t :jump-to-captured t)
|
||||||
|
|
||||||
("t" "Todo Item" entry (file+headline tvd-org-file "Manual-Agenda-Tasks")
|
("t" "Todo Item" entry (file+headline tvd-org-file "Manual-Agenda-Tasks")
|
||||||
"* TODO %^{title}\n:LOGBOOK:\n%u:END:\n" :prepend t :immediate-finish t)
|
"* TODO %^{title}\n:LOGBOOK:\n%u:END:\n" :prepend t :immediate-finish t)
|
||||||
|
|
||||||
("s" "Scheduled Item" entry (file+headline tvd-org-file "Scheduled-Agenda-Tasks")
|
("s" "Scheduled Item" entry (file+headline tvd-org-file "Scheduled-Agenda-Tasks")
|
||||||
"* TODO %^t %^{title}\n:LOGBOOK:\n%u:END:\n" :prepend t :immediate-finish t)
|
"* TODO %^t %^{title}\n:LOGBOOK:\n%u:END:\n" :prepend t :immediate-finish t)
|
||||||
|
|
||||||
("j" "Journal" entry (file+headline tvd-org-file "Kurznotizen")
|
("j" "Journal" entry (file+headline tvd-org-file "Kurznotizen")
|
||||||
"* TODO %^{title}\n%u\n %i%?\n" :prepend t :jump-to-captured t)
|
"* TODO %^{title}\n%u\n %i%?\n" :prepend t :jump-to-captured t)
|
||||||
|
|
||||||
("c" "Copy/Paste" entry (file+headline tvd-org-file "Kurznotizen")
|
("c" "Copy/Paste" entry (file+headline tvd-org-file "Kurznotizen")
|
||||||
"* TODO %^{title}\n%u\n %x\n" :immediate-finish t :prepend t :jump-to-captured t)))
|
"* TODO %^{title}\n%u\n %x\n" :immediate-finish t :prepend t :jump-to-captured t)))
|
||||||
|
|
||||||
;; follow links using eww, if present
|
;; follow links using eww, if present
|
||||||
;; (if (fboundp 'eww-browse-url)
|
;; (if (fboundp 'eww-browse-url)
|
||||||
;; (setq browse-url-browser-function 'eww-browse-url))
|
;; (setq browse-url-browser-function 'eww-browse-url))
|
||||||
|
|
||||||
;; mark narrowing with an orange fringe, the advice for 'widen
|
;; mark narrowing with an orange fringe, the advice for 'widen
|
||||||
;; is in the outline section.
|
;; is in the outline section.
|
||||||
(advice-add 'org-narrow-to-subtree :after
|
(advice-add 'org-narrow-to-subtree :after
|
||||||
'(lambda (&rest args)
|
'(lambda (&rest args)
|
||||||
(set-face-attribute 'fringe nil :background tvd-fringe-narrow-bg)))
|
(set-face-attribute 'fringe nil :background tvd-fringe-narrow-bg)))
|
||||||
|
|
||||||
;; always use the latest docs
|
;; always use the latest docs
|
||||||
(with-eval-after-load 'info
|
(with-eval-after-load 'info
|
||||||
(info-initialize)
|
(info-initialize)
|
||||||
(add-to-list 'Info-directory-list
|
(add-to-list 'Info-directory-list
|
||||||
(expand-file-name "~/.emacs.d/lisp/org/doc"))))
|
(expand-file-name "~/.emacs.d/lisp/org/doc")))
|
||||||
|
|
||||||
|
;; orange fringe when narrowed
|
||||||
|
(advice-add 'org-narrow-to-subtree :after
|
||||||
|
'(lambda (&rest args)
|
||||||
|
(set-face-attribute 'fringe nil :background tvd-fringe-narrow-bg))))
|
||||||
|
|||||||
@@ -57,16 +57,12 @@ otherwise fold current level and jump one level up."
|
|||||||
'(progn
|
'(progn
|
||||||
(add-hook 'outline-minor-mode-hook
|
(add-hook 'outline-minor-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
;; narrowing, we use outshine functions, it's loaded anyway
|
;; narrowing, we use org functions, it's loaded anyway
|
||||||
(defalias 'n 'outshine-narrow-to-subtree)
|
(defalias 'n 'org-narrow-to-subtree)
|
||||||
(defalias 'w 'widen)
|
(defalias 'w 'widen)
|
||||||
(define-key outline-minor-mode-map (kbd "<C-up>") 'tvd-outline-heading-up)
|
(define-key outline-minor-mode-map (kbd "<C-up>") 'tvd-outline-heading-up)
|
||||||
(define-key outline-minor-mode-map (kbd "<C-down>") 'tvd-outline-heading-down)
|
(define-key outline-minor-mode-map (kbd "<C-down>") 'tvd-outline-heading-down)
|
||||||
;;(define-key outline-minor-mode-map (kbd "<C-left>") 'tvd-outline-left-or-level-up)
|
;;(define-key outline-minor-mode-map (kbd "<C-left>") 'tvd-outline-left-or-level-up)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
;; orange fringe when narrowed
|
|
||||||
(advice-add 'outshine-narrow-to-subtree :after
|
|
||||||
'(lambda (&rest args)
|
|
||||||
(set-face-attribute 'fringe nil :background tvd-fringe-narrow-bg)))
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user