This commit is contained in:
fz0x1 2024-12-14 15:30:56 +01:00
parent e4a5818b39
commit 8cff3739ad
3 changed files with 113 additions and 79 deletions

View file

@ -46,8 +46,8 @@ This function should only modify configuration layer settings."
;; git ;; git
helm helm
;; lsp ;; lsp
markdown ;;markdown
multiple-cursors ;;multiple-cursors
;; org ;; org
;; (shell :variables ;; (shell :variables
;; shell-default-height 30 ;; shell-default-height 30
@ -68,7 +68,7 @@ This function should only modify configuration layer settings."
;; `dotspacemacs/user-config'. To use a local version of a package, use the ;; `dotspacemacs/user-config'. To use a local version of a package, use the
;; `:location' property: '(your-package :location "~/path/to/your-package/") ;; `:location' property: '(your-package :location "~/path/to/your-package/")
;; Also include the dependencies as they will not be resolved automatically. ;; Also include the dependencies as they will not be resolved automatically.
dotspacemacs-additional-packages '(org-roam org-roam-bibtex org-ref) dotspacemacs-additional-packages '(org-roam helm-org)
;; A list of packages that cannot be updated. ;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '() dotspacemacs-frozen-packages '()
@ -668,6 +668,28 @@ before packages are loaded."
(with-eval-after-load 'org (with-eval-after-load 'org
(defun my-org-roam-refile ()
"Переместить текущую заметку под заголовок 'Links' в выбранный файл."
(interactive)
(let* ((node (org-roam-node-read nil nil nil 'require-match))
(file (org-roam-node-file node))
(heading "Links")
target-point)
;; Открываем целевой файл и ищем/создаём заголовок "Links"
(save-excursion
(find-file file)
(goto-char (point-min))
;; Ищем заголовок "Links"
(if (re-search-forward (format org-complex-heading-regexp-format heading) nil t)
(setq target-point (point))
;; Если заголовок не найден, создаём его
(goto-char (point-max))
(insert (concat "\n* " heading "\n"))
(setq target-point (point))))
;; Теперь выполняем перемещение
(let ((org-reverse-note-order t)) ;; Перемещать в конец целевого заголовка
(org-refile nil nil (list heading file nil target-point)))))
(setq org-attach-method 'cp) ;; copy file to an attachments dir. (setq org-attach-method 'cp) ;; copy file to an attachments dir.
(setq org-attach-id-dir "~/org/attachments/") (setq org-attach-id-dir "~/org/attachments/")
@ -679,7 +701,7 @@ before packages are loaded."
(lambda () (lambda ()
(visual-line-mode 1))) (visual-line-mode 1)))
(setq org-agenda-files '("~/org/")) (setq org-agenda-files '("~/org/grocery.org" "~/org/todos.org" "~/org/inbox.org"))
(use-package org-roam (use-package org-roam
:ensure nil :ensure nil
:custom :custom
@ -691,10 +713,9 @@ before packages are loaded."
(org-roam-capture-templates (org-roam-capture-templates
'(("d" "default" plain '(("d" "default" plain
"%?\n\n\n* References:\n" "%?\n\n\n* Thoughts\n\n* References:\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n#+filetags:\n") "#+title: ${title}\n#+filetags:\n"))))
:unnarowed t)))
:config :config
(setq org-roam-completion-everywhere t) (setq org-roam-completion-everywhere t)
(setq org-roam-database-connector 'sqlite-builtin) (setq org-roam-database-connector 'sqlite-builtin)
@ -705,6 +726,8 @@ before packages are loaded."
;; today capture ;; today capture
(spacemacs/set-leader-keys (spacemacs/set-leader-keys
;; "aow" #'my/org-refile-or-create-file
"aorR" 'my-org-roam-refile
"aordN" 'org-roam-dailies-capture-today) "aordN" 'org-roam-dailies-capture-today)
(use-package org-roam-dailies (use-package org-roam-dailies
@ -723,6 +746,14 @@ before packages are loaded."
;; "xelatex -interaction nonstopmode -output-directory %o %f" ;; "xelatex -interaction nonstopmode -output-directory %o %f"
;; "xelatex -interaction nonstopmode -output-directory %o %f")) ;; "xelatex -interaction nonstopmode -output-directory %o %f"))
(defun my/org-capture-close-frame-for-specific-templates ()
"Close the capture window only for specific templates."
(let ((close-keys '("w" "L"))) ;; Список ключей шаблонов
(when (member (org-capture-get :key) close-keys) ;; Проверка, входит ли ключ в список
(delete-frame))))
(add-hook 'org-capture-after-finalize-hook 'my/org-capture-close-frame-for-specific-templates)
(setq org-capture-templates (setq org-capture-templates
'( '(
("p" "Private" ("p" "Private"
@ -730,29 +761,19 @@ before packages are loaded."
"* %?" "* %?"
:empty-lines 0) :empty-lines 0)
("j" "Work Log Entry" ("i" "Inbox"
entry (file+datetree "~/org/work-log.org")
"* %?"
:empty-lines 0)
("l" "Link"
entry (file+headline "~/org/inbox.org" "Inbox") entry (file+headline "~/org/inbox.org" "Inbox")
"* %U %?\n %:annotation\n %:link" "* [%<%Y-%m-%d>] %U %? :inbox: \n %:annotation\n %:link"
:empty-lines 0)
("n" "Note"
entry (file+headline "~/org/notes.org" "Random Notes")
"** %?"
:empty-lines 0) :empty-lines 0)
("r" "Grocery list" ("r" "Grocery list"
entry (file+headline "~/org/grocery.org" "Grocery list") entry (file+headline "~/org/grocery.org" "Grocery list")
"* NEED2BUY [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n " "* NEED2BUY [#C] %?\n:PROPERTIES:\n:Created: %T\n:END:\n "
:empty-lines 0) :empty-lines 0)
("g" "General To-Do" ("g" "General To-Do"
entry (file+headline "~/org/todos.org" "General Tasks") entry (file+headline "~/org/todos.org" "General Tasks")
"* TODO [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n " "* TODO [#C] %?\n:PROPERTIES:\n:Created: %T\n:END:\n "
:empty-lines 0) :empty-lines 0)
("m" "Meeting" ("m" "Meeting"
@ -765,18 +786,18 @@ before packages are loaded."
("c" "Code To-Do" ("c" "Code To-Do"
entry (file+headline "~/org/todos.org" "Code Related Tasks") entry (file+headline "~/org/todos.org" "Code Related Tasks")
"* TODO [#B] %?\n:PROPERTIES:\n:Created: %T\n:END:\n%i\nProposed Solution:\n" "* TODO [#C] %?\n:PROPERTIES:\n:Created: %T\n:END:\n%i\nProposed Solution:\n"
:empty-lines 0) :empty-lines 0)
("w" "Selected web capture" ("w" "Selected web capture"
entry (file+headline "~/org/web-selection.org" "Selected web capture") entry (file+headline "~/org/inbox.org" "Selected web capture")
"* %^{Title}\nSource: %u, %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?" "* [%<%Y-%m-%d>] %^{Title} :inbox:\nSource: %u, %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
:empty-lines 1) :empty-lines 1)
("L" "Unselected web capture" ("L" "Unselected web capture"
entry (file+headline "~/org/web-links.org" "Web links") entry (file+headline "~/org/inbox.org" "Web links")
"* %(transform-square-brackets-to-round-ones \"%:description\")%?\n:PROPERTIES:\n:Created: %T\n:END:\n- %:link\n" "* [%<%Y-%m-%d>] %(transform-square-brackets-to-round-ones \"%:description\")%? :inbox:\n- %:link\n"
:empty-lines 1))) :empty-lines 1)))
(setq org-todo-keywords (setq org-todo-keywords
@ -796,58 +817,62 @@ before packages are loaded."
;; Tags ;; Tags
(setq org-tag-alist '( (setq org-tag-alist '
;; context (
(:startgroup) ;; context
("@shop" . ?s) (:startgroup)
("@home" . ?h) ("@shop" . ?s)
("@outdoor" . ?o) ("@home" . ?h)
("@any" . ?a) ("@outdoor" . ?o)
("@meeting" . ?m) ("@any" . ?a)
(:endgroup) ("@meeting" . ?m)
(:endgroup)
;; basic tags ;; basic tags
(:startgroup) (:startgroup)
("chores" . ?C) ("chores" . ?C)
("meeting" . ?M) ("meeting" . ?M)
("finance" . ?F) ("finance" . ?F)
("sport" . ?S) ("sport" . ?S)
("code" . ?O) ("code" . ?O)
("social" . ?I) ("social" . ?I)
("productivity" . ?P) ("productivity" . ?P)
("study" . ?U) ("study" . ?U)
("privacy" . ?R) ("privacy" . ?R)
("family" . ?A) ("family" . ?A)
("travel" . ?T) ("travel" . ?T)
("life" . ?L) ("life" . ?L)
("health" . ?H) ("health" . ?H)
("friends" . ?E) ("friends" . ?E)
("hobby" . ?B) ("hobby" . ?B)
("research" . ?G) ("research" . ?G)
("article" . ?I) ("article" . ?I)
("job" . ?J) ("job" . ?J)
(:endgroup) (:endgroup)
;; Special tags ;; Special tags
("CRITICAL" . ?X) ("CRITICAL" . ?X)
;; other tags ;; other tags
("backend") ("backend")
("broken_code") ("broken_code")
("frontend") ("frontend")
("hike") ("hike")
("cycle") ("cycle")
("pkm") ("pkm")
("pentest") ("pentest")
("immigration") ("immigration")
("devops") ("devops")
("pet") ("pet")
("accomplishment") ("accomplishment")
("music") ("music")
("youtube") ("youtube")
("trash") ("trash")
("devsecops") ("devsecops")
)) ("book")
("movie")
("inbox")
))
;; Tag colors ;; Tag colors
@ -892,10 +917,12 @@ before packages are loaded."
nil))) nil)))
(setq org-agenda-skip-deadline-if-done t) (setq org-agenda-skip-deadline-if-done t)
(setq org-agenda-skip-timestamp-if-done t)
(setq org-agenda-custom-commands (setq org-agenda-custom-commands
'( '(
;; Daily Agenda & TODOs ;; Daily Agenda & TODOs
("d" "Daily agenda and all TODOs" ("d" "Daily agenda and all TODOs"
@ -931,7 +958,8 @@ before packages are loaded."
(org-agenda-remove-tags t) (org-agenda-remove-tags t)
(org-agenda-span 7) (org-agenda-span 7)
(org-agenda-skip-function (org-agenda-skip-function
'(org-agenda-skip-entry-if 'todo 'done)) '(org-agenda-skip-entry-if 'todo 'done)
'(org-agenda-skip-entry-if 'regexp ":inbox:"))
) )
) )
@ -942,6 +970,10 @@ before packages are loaded."
(org-agenda-prefix-format " %t %s") (org-agenda-prefix-format " %t %s")
(org-agenda-overriding-header "CURRENT STATUS") (org-agenda-overriding-header "CURRENT STATUS")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'regexp ":inbox:"))
;; Define the super agenda groups (sorts by order) ;; Define the super agenda groups (sorts by order)
(org-super-agenda-groups (org-super-agenda-groups
'( '(

View file

@ -1,5 +1,5 @@
! Xft.dpi: 160 ! Xft.dpi: 120
! rofi.dpi: 160 ! rofi.dpi: 120
Xft.autohint: 0 Xft.autohint: 0
Xft.lcdfilter: lcddefault Xft.lcdfilter: lcddefault

View file

@ -1,6 +1,8 @@
## qt5ct settings ## qt5ct settings
export QT_QPA_PLATFORMTHEME="qt5ct" export QT_QPA_PLATFORMTHEME=qt5ct
export QT_AUTO_SCREEN_SCALE_FACTOR=0 export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_ENABLE_HIGHDPI_SCALING=0 export QT_ENABLE_HIGHDPI_SCALING=0
# export QT_SCALE_FACTOR=1
export QT_FONT_DPI=96
## cursor size ## cursor size
export XCURSOR_SIZE=32 export XCURSOR_SIZE=32