Emacs: Organize org-mode blocks a bit better

This commit is contained in:
Joseph Ferano 2023-08-25 20:11:53 +07:00
parent 5a297e694d
commit 6c715bf945

View File

@ -2288,81 +2288,46 @@ and there's no need for a middle-man when it's already been implemented.
:dap-compilation "cargo build" :dap-compilation "cargo build"
:dap-compilation-dir "${workspaceFolder}")) :dap-compilation-dir "${workspaceFolder}"))
#+end_src #+end_src
** Org-Mode ** org-mode
*** General
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'org-bullets)
(defun joe/org-init ()
(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG"))) (setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG")))
(setq org-agenda-files '("~/Notes/Schedule.org"))
(setq org-directory "~/Notes/") (setq org-directory "~/Notes/")
(org-babel-do-load-languages (evil-define-key 'normal calendar-mode-map (kbd "RET") #'org-calendar-select)
'org-babel-load-languages #+end_src
'((emacs-lisp . t) *** Visuals
(makefile . t) #+begin_src emacs-lisp
(ocaml . t)
(python . t)
(C . t)
(haskell . t)
;; (rust . t)
(shell . t)))
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("ml" . "src ocaml"))
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
(add-to-list 'org-structure-template-alist '("py" . "src python"))
(add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("cc" . "src C :includes stdio.h stdlib.h"))
(setq org-edit-src-content-indentation 0))
(with-eval-after-load 'org (joe/org-init))
(setq org-blank-before-new-entry (setq org-blank-before-new-entry
'((heading . nil) '((heading . nil)
(plain-list-item . nil))) (plain-list-item . nil)))
(setq org-cycle-separator-lines 1) (setq org-cycle-separator-lines 1)
(setq org-hide-emphasis-markers t) (setq org-hide-emphasis-markers t)
(setq org-src-window-setup 'current-window)
(defun joe/org-hook () (require 'org-bullets)
(local-set-key (kbd "C-. C-i") 'consult-org-heading)
(setq org-download-image-dir "./Images/")
(setq org-download-heading-lvl nil)
(org-fancy-priorities-mode)
(olivetti-mode)
(org-bullets-mode)
(org-indent-mode))
(add-hook 'org-mode-hook 'joe/org-hook)
(require 'org-download)
(require 'org-kanban)
(require 'org-fancy-priorities) (require 'org-fancy-priorities)
;; (setq org-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴")) ;; (setq org-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴"))
;; (setq org-fancy-priorities-list '("⚡" "⬆" "⬇")) ;; (setq org-fancy-priorities-list '("⚡" "⬆" "⬇"))
;; (setq org-fancy-priorities-list '("⚡" "⬆" "⬇")) ;; (setq org-fancy-priorities-list '("⚡" "⬆" "⬇"))
(setq org-fancy-priorities-list '((?D . "🌃") (?C . "🌇") (?B . "☀️") (?A . "🌄"))) (setq org-fancy-priorities-list '((?D . "🌃") (?C . "🌇") (?B . "☀️") (?A . "🌄")))
(require 'org-roam)
(setq org-roam-directory "/home/joe/Notes/Roam/")
(setq org-roam-node-display-template (concat "${title:*} "
(propertize "${tags:10}" 'face 'org-tag)))
(org-roam-db-autosync-mode)
(define-key global-map (kbd "C-c n l") #'org-roam-buffer-toggle)
(define-key global-map (kbd "C-c n f") #'org-roam-node-find)
(define-key global-map (kbd "C-c n g") #'org-roam-graph)
(define-key global-map (kbd "C-c n i") #'org-roam-node-insert)
(define-key global-map (kbd "C-c n c") #'org-roam-capture)
(org-roam-setup)
(evil-define-key 'normal calendar-mode-map (kbd "RET") #'org-calendar-select)
(defun joe/org-hook ()
(org-fancy-priorities-mode)
(org-bullets-mode)
(org-indent-mode)
(olivetti-mode))
(add-hook 'org-mode-hook 'joe/org-hook)
#+end_src #+end_src
** Org-capture *** org-agenda
#+begin_src emacs-lisp
(setq org-agenda-files '("~/Notes/Schedule.org" "~/Notes/TODO.org" "~/Notes/Daily.org"))
#+end_src
*** org-capture
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun joe/capture-leetcode-newfile () (defun joe/capture-leetcode-newfile ()
(let* ((title (read-string "Title: ")) (let* ((title (read-string "Title: "))
(title (string-replace " " "-" title)) (title (string-replace " " "-" title))
@ -2418,6 +2383,66 @@ and there's no need for a middle-man when it's already been implemented.
#'joe/capture-daily) #'joe/capture-daily)
)) ))
#+end_src #+end_src
*** org-babel
#+begin_src emacs-lisp
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(makefile . t)
(ocaml . t)
(python . t)
(C . t)
(haskell . t)
;; (rust . t)
(shell . t)))
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("ml" . "src ocaml"))
(add-to-list 'org-structure-template-alist '("rs" . "src rust"))
(add-to-list 'org-structure-template-alist '("py" . "src python"))
(add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("cc" . "src C :includes stdio.h stdlib.h"))
(setq org-edit-src-content-indentation 0)
(setq org-src-window-setup 'current-window)
#+end_src
org-tempo provides the ability to insert block snippets in the form of =<el= and
with the cursor you hit TAB and you complete the following;
=#+begin_src emacs-lisp=
=#+end_src=
#+begin_src emacs-lisp
(require 'org-tempo)
#+end_src
*** org-download
#+begin_src emacs-lisp
(require 'org-download)
(setq org-download-image-dir "./Images/")
(setq org-download-heading-lvl nil)
#+end_src
*** COMMENT org-roam
#+begin_src emacs-lisp
(require 'org-roam)
(setq org-roam-directory "/home/joe/Notes/Roam/")
(setq org-roam-node-display-template (concat "${title:*} "
(propertize "${tags:10}" 'face 'org-tag)))
(org-roam-db-autosync-mode)
(define-key global-map (kbd "C-c n l") #'org-roam-buffer-toggle)
(define-key global-map (kbd "C-c n f") #'org-roam-node-find)
(define-key global-map (kbd "C-c n g") #'org-roam-graph)
(define-key global-map (kbd "C-c n i") #'org-roam-node-insert)
(define-key global-map (kbd "C-c n c") #'org-roam-capture)
(org-roam-setup)
#+end_src
*** COMMENT org-kanban
#+begin_src emacs-lisp
(require 'org-kanban)
#+end_src
** Org-capture
** Magit ** Magit
The best git porcelain/client I've ever used. Also kill stray magit buffers left The best git porcelain/client I've ever used. Also kill stray magit buffers left