(menu-bar-mode -1) (tool-bar-mode -1) (require 'epa-file) (epa-file-enable) ;; (setq epa-file-encrypt-to nil) ;; (setq epa-file-select-keys nil) ;; (setq epa-file-cache-passphrase-for-symmetric-encryption nil) (setq org-startup-folded t) (setq make-backup-files nil) (setq auto-save-default nil) (require 'package) (require 'org-tempo) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/"))) (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;; Enable use-package (eval-when-compile (require 'use-package)) (use-package org :pin gnu) (use-package gruvbox-theme :config (load-theme 'gruvbox-dark-medium t)) (use-package org-contrib :ensure t :init (require 'org-depend) (require 'org-protocol)) (use-package ace-window :bind ("M-o" . ace-window)) (use-package org-bullets :hook (org-mode . org-bullets-mode)) (use-package evil :ensure t :init (setq evil-undo-system 'undo-redo) :config (evil-mode 1)) (use-package evil-surround :ensure t :init (global-evil-surround-mode 1)) (use-package helm :ensure t :config (helm-mode 1)) (use-package helm-org-rifle :ensure t :init (global-set-key (kbd "C-c r") 'helm-org-rifle-agenda-files)) (setq aw-dispatch-always t) (setq use-package-always-ensure t) ;; Must do this so the agenda knows where to look for my files (setq org-agenda-files '("~/org")) (setq org-agenda-files (delete "~/org/done.org" org-agenda-files)) ;; When a TODO is set to a done state, record a timestamp (setq org-log-done 'time) (setq org-log-redeadline 'time) (setq org-log-reschedule 'time) ;; Follow the links ;; (setq org-return-follows-link t) ;; Associate all org files with org mode (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) ;; Make the indentation look nicer (add-hook 'org-mode-hook 'org-indent-mode) ;; Remap the change priority keys to use the UP or DOWN key (define-key org-mode-map (kbd "C-c ") 'org-priority-up) (define-key org-mode-map (kbd "C-c ") 'org-priority-down) ;; Shortcuts for storing links, viewing the agenda, and starting a capture (define-key global-map "\C-cl" 'org-store-link) (define-key global-map "\C-ca" 'org-agenda) (define-key global-map (kbd "C-c c") 'org-capture) (define-key org-mode-map (kbd "C-c i") 'org-id-get-create) (define-key org-mode-map (kbd "C-c p") 'org-set-property) (global-set-key (kbd "C-c n") (lambda () (interactive) (find-file "~/org/notes.org"))) (global-set-key (kbd "C-c w") (lambda () (interactive) (find-file "~/org/work-log.org"))) (define-key helm-map (kbd "C-M-n") 'helm-next-source) (define-key helm-map (kbd "C-M-p") 'helm-previous-source) ;; When you want to change the level of an org item, use SMR (define-key org-mode-map (kbd "C-c C-g C-r") 'org-shiftmetaright) ;; Hide the markers so you just see bold text as BOLD-TEXT and not *BOLD-TEXT* (setq org-hide-emphasis-markers t) ;; Wrap the lines in org mode so that things are easier to read (add-hook 'org-mode-hook 'visual-line-mode) ;; (setq initial-buffer-choice ;; (lambda () ;; (let ((agenda-buffer (org-agenda nil "a"))) ;; (get-buffer "*Org Agenda*")))) ;; (setq org-agenda-window-setup 'only-window) ;; (setq org-agenda-include-diary t) ;; show :LOGBOOK: (setq org-log-into-drawer t) (setq org-log-done 'time) ;; evil (define-key evil-normal-state-map (kbd "TAB") 'org-cycle) ;; return the standard functionality for TAB (add-hook 'org-mode-hook (lambda () (org-load-modules-maybe t))) ;; (setq org-id-link-to-org-use-id t) ;; autosave org-mode buffers (setq auto-save-timeout 20) (add-hook 'auto-save-hook 'org-save-all-org-buffers) ;; archive (setq org-archive-location "~/org/done.org::") (defun archive-done-tasks () "Archive all tasks marked as DONE in the current buffer." (interactive) (org-map-entries 'org-archive-subtree "/DONE" 'file)) (define-key org-mode-map (kbd "C-c C-x C-d") 'archive-done-tasks) ;; disable autosave for some files (defun disable-autosave-for-specific-file () "Disable auto-save-visited-mode for a specific file." (when (string-equal (buffer-file-name) (expand-file-name "~/org/private.org.gpg")) (auto-save-visited-mode -1))) (add-hook 'find-file-hook 'disable-autosave-for-specific-file) (defun transform-square-brackets-to-round-ones(string-to-transform) "Transforms [ into ( and ] into ), other chars left unchanged." (concat (mapcar #'(lambda (c) (if (equal c ?\[) ?\( (if (equal c ?\]) ?\) c))) string-to-transform))) (when (display-graphic-p) (setq org-ellipsis " [+]") (add-hook 'org-mode-hook 'variable-pitch-mode) (let* ((variable-tuple (cond ((x-list-fonts "SauceCodePro Nerd Font Mono") '(:family "SauceCodePro Nerd Font Mono" :height 120)) (t (warn "Cannot find any suitable variable-pitch font.") nil))) (fixed-tuple (cond ((x-list-fonts "JetBrainsMono Nerd Font") '(:family "JetBrainsMono Nerd Font")) (t (warn "Cannot find any suitable fixed-pitch font.") nil))) (base-font-color (face-foreground 'default nil 'default)) (headline `(:inherit default :weight bold :foreground ,base-font-color))) ;; Подсветка текущей строки (global-hl-line-mode t) ;; Установка стилей для заголовков (custom-theme-set-faces 'user `(org-level-8 ((t (,@headline ,@variable-tuple)))) `(org-level-7 ((t (,@headline ,@variable-tuple)))) `(org-level-6 ((t (,@headline ,@variable-tuple)))) `(org-level-5 ((t (,@headline ,@variable-tuple)))) `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.0)))) `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.1)))) `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.25)))) `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.5)))) `(org-document-title ((t (,@headline ,@variable-tuple :height 1.75 :underline nil))))) ;; Установка других стилей (custom-set-faces `(variable-pitch ((t ,@variable-tuple))) `(fixed-pitch ((t ,@fixed-tuple))) '(org-ellipsis ((t (:inherit fixed-pitch :foreground "gray40" :underline nil)))) '(org-block ((t (:inherit fixed-pitch)))) '(org-block-begin-line ((t (:inherit fixed-pitch)))) '(org-block-end-line ((t (:inherit fixed-pitch)))) '(org-src ((t (:inherit fixed-pitch)))) '(org-properties ((t (:inherit fixed-pitch)))) '(org-code ((t (:inherit (shadow fixed-pitch))))) '(org-date ((t (:inherit (shadow fixed-pitch))))) '(org-document-info ((t (:inherit (shadow fixed-pitch))))) '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch))))) '(org-drawer ((t (:inherit (shadow fixed-pitch))))) '(org-indent ((t (:inherit (org-hide fixed-pitch))))) `(org-link ((t (:inherit fixed-pitch :foreground "tomato" :underline t)))) '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch) :height 0.8)))) '(org-property-value ((t (:inherit fixed-pitch))) t) '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch))))) '(org-table ((t (:inherit fixed-pitch)))) '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8)))) ;; '(org-verbatim ((t (:background "yellow" :foreground "black")))) ;; '(org-emphasis-alist ((t (:background "yellow" :foreground "black")))) ))) (setq org-capture-templates '( ("p" "Private" entry (file+headline "~/org/private.org.gpg" "Private") "* %?" :empty-lines 0) ("j" "Work Log Entry" entry (file+datetree "~/org/work-log.org") "* %?" :empty-lines 0) ("l" "Link" entry (file+headline "~/org/inbox.org" "Inbox") "* %U %?\n %:annotation\n %:link" :empty-lines 0) ("n" "Note" entry (file+headline "~/org/notes.org" "Random Notes") "** %?" :empty-lines 0) ("r" "Grocery list" entry (file+headline "~/org/grocery.org" "Grocery list") "* NEED2BUY [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n " :empty-lines 0) ("g" "General To-Do" entry (file+headline "~/org/todos.org" "General Tasks") "* TODO [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n " :empty-lines 0) ("m" "Meeting" entry (file+datetree "~/org/meetings.org") "* %? :meeting:%^g \n:PROPERTIES:\n:Created: %T\n:END:\n** Notes\n** Action Items\n*** TODO [#A] " :tree-type week :clock-in t :clock-resume t :empty-lines 0) ("c" "Code To-Do" entry (file+headline "~/org/todos.org" "Code Related Tasks") "* TODO [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n%i\nProposed Solution:\n" :empty-lines 0) ("w" "Selected web capture" entry (file+headline "~/org/web-selection.org" "Selected web capture") "* %^{Title}\nSource: %u, %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?" :empty-lines 1) ("L" "Unselected web capture" entry (file+headline "~/org/web-links.org" "Web links") "* %(transform-square-brackets-to-round-ones \"%:description\")%?\n:PROPERTIES:\n:Created: %T\n:END:\n- %:link\n" :empty-lines 1))) (setq org-todo-keywords '((sequence "TODO(t)" "NEED2BUY(n)" "PLANNING(p)" "IN-PROGRESS(i@/!)" "VERIFYING(v!)" "BLOCKED(b@)" "|" "DONE(d!)" "CANCELED(c@/!)" ) )) (setq org-todo-keyword-faces '( ("TODO" . (:foreground "GoldenRod" :weight bold)) ("PLANNING" . (:foreground "DeepPink" :weight bold)) ("IN-PROGRESS" . (:foreground "Cyan" :weight bold)) ("VERIFYING" . (:foreground "DarkOrange" :weight bold)) ("BLOCKED" . (:foreground "Red" :weight bold)) ("DONE" . (:foreground "LimeGreen" :weight bold)) ("NEED2BUY" . (:foreground "Red" :weight bold)) )) ;; Tags (setq org-tag-alist '( ;; context (:startgroup) ("@shop" . ?s) ("@home" . ?h) ("@outdoor" . ?o) ("@any" . ?a) ("@meeting" . ?m) (:endgroup) ;; basic tags (:startgroup) ("chores" . ?C) ("meeting" . ?M) ("finance" . ?F) ("sport" . ?S) ("code" . ?O) ("social" . ?I) ("productivity" . ?P) ("study" . ?U) ("privacy" . ?R) ("family" . ?A) ("travel" . ?T) ("life" . ?L) ("health" . ?H) ("friends" . ?E) ("hobby" . ?B) ("research" . ?G) ("article" . ?I) ("job" . ?J) (:endgroup) ;; Special tags ("CRITICAL" . ?X) ;; other tags ("backend") ("broken_code") ("frontend") ("hike") ("cycle") ("pkm") ("pentest") ("immigration") ("devops") ("pet") ("accomplishment") ("music") ("youtube") ("trash") ("devsecops") )) ;; Tag colors (setq org-tag-faces '( ("@home" . (:foreground "mediumPurple1" :weight bold)) ("@outdoor" . (:foreground "royalblue1" :weight bold)) ("@shop" . (:foreground "forest green" :weight bold)) ("QA" . (:foreground "sienna" :weight bold)) ("chores" . (:foreground "yellow1" :weight bold)) ("sport" . (:foreground "green yellow" :weight bold)) ("finance" . (:foreground "tomato" :weight bold)) ("privacy" . (:foreground "dark olive green" :weight bold)) ("study" . (:foreground "aquamarine" :weight bold)) ("productivity" . (:foreground "violet" :weight bold)) ("family" . (:foreground "medium violet red" :weight bold)) ("health" . (:foreground "DarkOrange1" :weight bold)) ("code" . (:foreground "snow3" :weight bold)) ("travel" . (:foreground "salmon4" :weight bold)) ("life" . (:foreground "goldenrod1" :weight bold)) ("friends" . (:foreground "plum4" :weight bold)) ("hobby" . (:foreground "SeaGreen1" :weight bold)) ("social" . (:foreground "RoyalBlue1" :weight bold)) ("research" . (:foreground "deep sky blue" :weight bold)) ("meeting" . (:foreground "magenta" :weight bold)) ("CRITICAL" . (:foreground "red1" :weight bold)) ("job" . (:foreground "medium spring green" :weight bold)) ) ) ;; Agenda View "d" (defun air-org-skip-subtree-if-priority (priority) "Skip an agenda subtree if it has a priority of PRIORITY. PRIORITY may be one of the characters ?A, ?B, or ?C." (let ((subtree-end (save-excursion (org-end-of-subtree t))) (pri-value (* 1000 (- org-lowest-priority priority))) (pri-current (org-get-priority (thing-at-point 'line t)))) (if (= pri-value pri-current) subtree-end nil))) (setq org-agenda-skip-deadline-if-done t) (setq org-agenda-custom-commands '( ;; Daily Agenda & TODOs ("d" "Daily agenda and all TODOs" ;; Display items with priority A ((tags "PRIORITY=\"A\"" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) (org-agenda-overriding-header "High-priority unfinished tasks:"))) ;; View 7 days in the calendar view (agenda "" ((org-agenda-span 7))) ;; Display items with priority B (really it is view all items minus A & C) (alltodo "" ((org-agenda-skip-function '(or (air-org-skip-subtree-if-priority ?A) (air-org-skip-subtree-if-priority ?C) (org-agenda-skip-if nil '(scheduled deadline)))) (org-agenda-overriding-header "ALL normal priority tasks:"))) ;; Display items with pirority C (tags "PRIORITY=\"C\"" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) (org-agenda-overriding-header "Low-priority Unfinished tasks:"))) ) ;; Don't compress things (change to suite your tastes) ((org-agenda-compact-blocks nil))) ;; My Super View ("j" "My Super View" ( (agenda "" ( (org-agenda-remove-tags t) (org-agenda-span 7) (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) ) ) (alltodo "" ( ;; Remove tags to make the view cleaner (org-agenda-remove-tags t) (org-agenda-prefix-format " %t %s") (org-agenda-overriding-header "CURRENT STATUS") ;; Define the super agenda groups (sorts by order) (org-super-agenda-groups '( ;; Filter where tag is CRITICAL (:name "Critical Tasks" :tag "CRITICAL" :order 0 ) ;; Filter where TODO state is IN-PROGRESS (:name "Currently Working" :todo "IN-PROGRESS" :order 1 ) ;; Filter where TODO state is BLOCKED or where the tag is obstacle (:name "Problems & Blockers" :todo "BLOCKED" :order 3 ) ;; Filter where tag is research (:name "Research Required" :tag "research" :order 4 ) ;; Filter where tag is chores (:name "Chores" :tag "chores" :order 5 ) ;; Filter where tag is meeting and priority is A (only want TODOs from meetings) (:name "Meeting Action Items" :and (:tag "meeting" :priority "A") :order 6 ) ;; Filter where state is TODO and the priority is A and the tag is not meeting (:name "Other Important Items" :and (:todo "TODO" :priority "A" :not (:tag "meeting")) :order 7 ) ;; Filter where state is TODO and priority is B (:name "General Backlog" :and (:todo "TODO" :priority "B") :order 8 ) ;; Filter where the priority is C or less (supports future lower priorities) (:name "Non Critical" :priority<= "C" :order 9 ) ;; Filter where TODO state is VERIFYING (:name "Currently Being Verified" :todo "VERIFYING" :order 10 ) ;; Filter where TODO state is PLANNING (:name "Planning Next Steps" :todo "PLANNING" :order 11 ) ) ) ) ) )) )) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages '(gruvbox-theme ace-window))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(fixed-pitch ((t :family "JetBrainsMono Nerd Font"))) '(org-block ((t (:inherit fixed-pitch)))) '(org-block-begin-line ((t (:inherit fixed-pitch)))) '(org-block-end-line ((t (:inherit fixed-pitch)))) '(org-code ((t (:inherit (shadow fixed-pitch))))) '(org-date ((t (:inherit (shadow fixed-pitch))))) '(org-document-info ((t (:inherit (shadow fixed-pitch))))) '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch))))) '(org-document-title ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120 :height 2.0 :underline nil)))) '(org-drawer ((t (:inherit (shadow fixed-pitch))))) '(org-ellipsis ((t (:inherit fixed-pitch :foreground "gray40" :underline nil)))) '(org-indent ((t (:inherit (org-hide fixed-pitch))))) '(org-level-1 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120 :height 1.75)))) '(org-level-2 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120 :height 1.5)))) '(org-level-3 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120 :height 1.25)))) '(org-level-4 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120 :height 1.1)))) '(org-level-5 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120)))) '(org-level-6 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120)))) '(org-level-7 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120)))) '(org-level-8 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "SauceCodePro Nerd Font Mono" :height 120)))) '(org-link ((t (:inherit fixed-pitch :foreground "tomato" :underline t)))) '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch) :height 0.8)))) '(org-properties ((t (:inherit fixed-pitch)))) '(org-property-value ((t (:inherit fixed-pitch)))) '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch))))) '(org-src ((t (:inherit fixed-pitch)))) '(org-table ((t (:inherit fixed-pitch)))) '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8)))) '(variable-pitch ((t :family "SauceCodePro Nerd Font Mono" :height 120))))