;; -*- lexical-binding: t -*- ;; (defun org-capture-init() ;; (setq org-capture-templates ;; '(("t" "Personal todo" entry ("Inbox") ;; "* TODO %?\n%i\n%a" :prepend t)))) (use-package org :straight (org :fork (:host nil :repo "https://code.tecosaur.net/tec/org-mode.git" :branch "dev" :remote "tecosaur") :branch "dev" :files (:defaults "etc") :build t :pre-build (with-temp-file "org-version.el" (require 'lisp-mnt) (let ((version (with-temp-buffer (insert-file-contents "lisp/org.el") (lm-header "version"))) (git-version (string-trim (with-temp-buffer (call-process "git" nil t nil "rev-parse" "--short" "HEAD") (buffer-string))))) (insert (format "(defun org-release () \"The release version of Org.\" %S)\n" version) (format "(defun org-git-version () \"The truncate git commit hash of Org mode.\" %S)\n" git-version) "(provide 'org-version)\n"))) :pin nil) :hook (org-mode . org-cdlatex-mode) :hook (org-mode . org-indent-mode) :hook (org-mode . visual-line-mode) :pretty-hydra ;; See `org-structure-template-alist' ((:color blue :quit-key ("q" "C-g")) ("Basic" (("a" (hot-expand "" . org-insert-subheading)) :config (elemacs-load-packages-incrementally '(calendar find-func format-spec org-macs org-compat org-faces org-entities org-list org-pcomplete org-src org-footnote org-macro ob org org-clock org-agenda org-capture)) ;; For hydra (defun hot-expand (str &optional mod) "Expand org template. STR is a structure template string recognised by org like > info caddr (alist-get :file)) "org-src-babel.tmp")) (when (fboundp 'lsp-deferred) ;; Avoid headerline conflicts (setq-local lsp-headerline-breadcrumb-enable nil) (lsp-deferred) (_ (user-error "LSP:: invalid type")))) (put ',intern-pre 'function-documentation (format "Enable lsp-mode in the buffer of org source block (%s)." (upcase ,lang))) (if (fboundp ',edit-pre) (advice-add ',edit-pre :after ',intern-pre) (progn (defun ,edit-pre (info) (,intern-pre info)) (put ',edit-pre 'function-documentation (format "Prepare local buffer environment for org source block (%s)." (upcase ,lang)))))))) (defconst org-babel-lang-list '("go" "python" "ipython" "ruby" "js" "css" "sass" "c" "rust" "java" "cpp" "c++" "shell") "The supported programming languages for interactive Babel.") (dolist (lang org-babel-lang-list) (eval `(lsp-org-babel-enable ,lang))) (provide 'init-org)