2022-04-22 02:54:47 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
;; TURN ON IN INIT FILE!!!!!
|
|
|
|
|
|
|
|
;; Make gc pauses faster by decreasing the threshold.
|
|
|
|
(setq gc-cons-threshold (* 2 1000 1000))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; helper functions
|
|
|
|
;; Figure out if inside Termux
|
|
|
|
(require 'subr-x)
|
|
|
|
(setq kmn/is-termux
|
|
|
|
(string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a"))))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; os specific config
|
|
|
|
(when (eq system-type 'windows-nt)
|
|
|
|
; Fix resolution of ~ to match other client paths
|
|
|
|
(setenv "HOME" "C:/Users/mcros/Nextcloud")
|
|
|
|
(setq default-directory "C:/Users/mcros/Nextcloud")
|
|
|
|
|
|
|
|
; add executables to path ahead of them being used by extensions / emacs stuff
|
|
|
|
(add-to-list 'exec-path "C:/Users/mcros/OneDrive/Programs/PortableApps/sqlite3")
|
2022-08-25 15:37:02 +00:00
|
|
|
(add-to-list 'exec-path "C:/msys64/usr/bin/unzip.exe")
|
2022-08-25 15:49:25 +00:00
|
|
|
(setenv "PATH" (concat "C:\\msys64\\mingw64\\bin;" (getenv "PATH")))
|
2022-04-22 02:54:47 +00:00
|
|
|
)
|
|
|
|
(when kmn/is-termux
|
|
|
|
; setup storage locations -- cheat so mobile/desktop look alike for file urls
|
|
|
|
;(setq user-init-file "/data/data/com.termux/files/home/storage/shared/.emacs")
|
|
|
|
;(setq user-emacs-directory "/data/data/com.termux/files/home/storage/shared/.emacs.d/")
|
|
|
|
;(setenv "HOME" "/data/data/com.termux/files/home/storage/shared/")
|
|
|
|
;(load user-init-file)
|
|
|
|
|
|
|
|
; Fix resolution of ~ to match other client paths
|
2022-04-26 12:06:30 +00:00
|
|
|
(setenv "HOME" "/data/data/com.termux/files/home/")
|
|
|
|
(setq default-directory "/data/data/com.termux/files/home/")
|
2022-04-22 02:54:47 +00:00
|
|
|
|
|
|
|
; Better fonts
|
|
|
|
(setq org-src-fontify-natively t)
|
|
|
|
|
|
|
|
; Setup xdg-open as the default for opening files (except for the few we want emacs to open native)
|
|
|
|
; xdg-open is linked to termux-open by default ; if you need 'more' look into tmux-open and adjust accordingly
|
|
|
|
; (add-to-list 'org-file-apps '("\\.doc.*" . "open %s"))
|
|
|
|
(setq org-file-apps
|
|
|
|
'(;; default
|
|
|
|
(auto-mode . emacs)
|
|
|
|
("\\.org" . emacs)
|
|
|
|
("\\.txt" . emacs)
|
2022-08-26 18:41:24 +00:00
|
|
|
(".*" . "termux-open --chooser --view %s")))
|
2022-04-22 02:54:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; global config
|
|
|
|
(load "~/.emacs.d.profiles/common/_global.el")
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2022-06-02 18:33:30 +00:00
|
|
|
; compile bytecode for this profile
|
|
|
|
(unless (was-compiled-p "~/.emacs.d.profiles/org")
|
|
|
|
(byte-recompile-directory "~/.emacs.d.profiles/org" 0))
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2022-09-13 19:06:22 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; additional packages
|
|
|
|
(add-to-list 'package-selected-packages
|
|
|
|
'(org-super-agenda)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; Load misc extensions
|
|
|
|
(require 'org)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; Update/add auto file handling
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; keyboard shortcuts
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-keyboard.el")
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; Set some orgmode config
|
|
|
|
(defun my/org_timestamp ()
|
|
|
|
(interactive)
|
|
|
|
(org-insert-time-stamp (current-time) (current-time) "t")
|
|
|
|
)
|
|
|
|
(org-defkey org-mode-map (kbd "C-c !") #'my/org_timestamp)
|
|
|
|
(setq org-startup-folded t)
|
|
|
|
(setq org-return-follows-link t)
|
|
|
|
(setq org-startup-folded t)
|
|
|
|
(setq org-support-shift-select t)
|
|
|
|
(setq org-src-fontify-natively t)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; tags
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-tags")
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; files
|
|
|
|
(setq org-default-notes-file "~/org/_index.org")
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; agendas
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-agendas.el")
|
|
|
|
|
2022-09-13 20:19:20 +00:00
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; capture templates
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-capture.el")
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; org-habit
|
|
|
|
(add-to-list 'org-modules 'org-habit)
|
|
|
|
(setq org-habit-preceding-days 14)
|
|
|
|
(setq org-habit-following-days 7)
|
|
|
|
(setq org-agenda-span 1)
|
|
|
|
|
2022-09-06 19:08:49 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; helm specific org adjustments
|
|
|
|
(load "~/.emacs.d.profiles/common/helm-org.el")
|
|
|
|
(require 'helm-org)
|
|
|
|
(helm-mode 1)
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist '(org-capture . helm-org-completing-read-tags))
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist '(org-set-tags . helm-org-completing-read-tags))
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist '(org-set-tags-command . helm-org-completing-read-tags))
|
|
|
|
|
2022-09-08 16:49:35 +00:00
|
|
|
; fix helm multi-tag select (needs custom seprator. default is comma
|
|
|
|
;(setq helm-crm-default-separator ":"
|
|
|
|
(define-advice helm--completion-in-region (:around (helm-fun origfun start end collection &optional predicate) temporary-helm-crm-separator-for-tags)
|
|
|
|
(setq tcrmds helm-crm-default-separator)
|
|
|
|
;; If the last command was any of these values, we're looking at tags most likely
|
|
|
|
(when (or (member last-command '(org-capture org-ctrl-c-ctrl-c org-set-tags org-set-tags-command))
|
|
|
|
;;This is a workaround for completions when you've already started typing.
|
|
|
|
(and (eq this-command 'crm-complete)
|
|
|
|
(eq major-mode 'org-mode))
|
|
|
|
;; This is probably the only thing we really need, but it doesn't handle custom "Tags" prompts
|
|
|
|
(and (active-minibuffer-window)
|
|
|
|
(eq "Tags: " (minibuffer-prompt))))
|
|
|
|
(setq helm-crm-default-separator ":"))
|
|
|
|
;; Call the original Helm Completion function with all the original arguments
|
|
|
|
(funcall helm-fun origfun start end collection predicate)
|
|
|
|
(setq helm-crm-default-separator tcrmds))
|
|
|
|
|
2022-04-22 02:54:47 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; ui tuning
|
2022-04-25 23:11:06 +00:00
|
|
|
(diminish 'projectile-mode)
|
2022-04-22 02:54:47 +00:00
|
|
|
(when (eq system-type 'windows-nt)
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-desktop.el"))
|
|
|
|
(when kmn/is-termux
|
|
|
|
(load "~/.emacs.d.profiles/org/config-org-mobile.el"))
|
2022-04-24 20:37:32 +00:00
|
|
|
|
|
|
|
(with-eval-after-load "persp-mode-autoload"
|
|
|
|
(with-eval-after-load "org"
|
2022-08-26 14:25:29 +00:00
|
|
|
(persp-def-auto-persp "kmn"
|
2022-04-24 20:37:32 +00:00
|
|
|
:mode-name ".*org-mode.*"
|
|
|
|
:noauto
|
|
|
|
:dyn-env '(after-switch-to-buffer-functions ;; prevent recursion
|
|
|
|
(persp-add-buffer-on-find-file nil)
|
|
|
|
persp-add-buffer-on-after-change-major-mode)
|
|
|
|
:hooks '(after-switch-to-buffer-functions)
|
|
|
|
:switch 'window)))
|