20241214
This commit is contained in:
parent
8cff3739ad
commit
c0e73aa4cf
1 changed files with 65 additions and 54 deletions
|
@ -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 helm-org)
|
dotspacemacs-additional-packages '()
|
||||||
|
|
||||||
;; A list of packages that cannot be updated.
|
;; A list of packages that cannot be updated.
|
||||||
dotspacemacs-frozen-packages '()
|
dotspacemacs-frozen-packages '()
|
||||||
|
@ -618,34 +618,6 @@ before packages are loaded."
|
||||||
(concat
|
(concat
|
||||||
(mapcar #'(lambda (c) (if (equal c ?\[) ?\( (if (equal c ?\]) ?\) c))) string-to-transform)))
|
(mapcar #'(lambda (c) (if (equal c ?\[) ?\( (if (equal c ?\]) ?\) c))) string-to-transform)))
|
||||||
|
|
||||||
;; (use-package org-roam-bibtex
|
|
||||||
;; :after org-roam
|
|
||||||
;; :config
|
|
||||||
;; (require 'org-ref)
|
|
||||||
;; (setq orb-note-actions-interface 'default)
|
|
||||||
;; (setq bibtex-completion-bibliography '("~/My Library.bib"))
|
|
||||||
;; (setq orb-preformat-keywords
|
|
||||||
;; '("title" "author" "year" "keywords"))
|
|
||||||
;; )
|
|
||||||
|
|
||||||
;; (with-eval-after-load 'ox-latex
|
|
||||||
;; ;; Подключение пакетов для Unicode
|
|
||||||
;; (add-to-list 'org-latex-packages-alist '("" "fontspec"))
|
|
||||||
;; (add-to-list 'org-latex-packages-alist '("" "polyglossia"))
|
|
||||||
|
|
||||||
;; ;; Установка классов документов
|
|
||||||
;; (setq org-latex-classes
|
|
||||||
;; '(("article"
|
|
||||||
;; "\\documentclass[11pt]{article}
|
|
||||||
;; \\usepackage{fontspec}
|
|
||||||
;; \\setmainfont{Times New Roman}
|
|
||||||
;; \\newfontfamily\\cyrillicfont{Times New Roman}
|
|
||||||
;; \\usepackage{polyglossia}
|
|
||||||
;; \\setdefaultlanguage{russian}
|
|
||||||
;; \\setotherlanguage{english}"
|
|
||||||
;; ("\\section{%s}" . "\\section*{%s}")
|
|
||||||
;; ("\\subsection{%s}" . "\\subsection*{%s}")
|
|
||||||
;; ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))
|
|
||||||
(defun get-current-layout ()
|
(defun get-current-layout ()
|
||||||
"Получить текущую раскладку клавиатуры для текущего окна с помощью xkb-switch."
|
"Получить текущую раскладку клавиатуры для текущего окна с помощью xkb-switch."
|
||||||
(string-trim (shell-command-to-string "xkb-switch")))
|
(string-trim (shell-command-to-string "xkb-switch")))
|
||||||
|
@ -668,6 +640,41 @@ before packages are loaded."
|
||||||
|
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
(with-eval-after-load 'org
|
||||||
|
(defun my/select-or-create-org-file ()
|
||||||
|
"Предложить пользователю выбрать файл для записи или создать новый."
|
||||||
|
(let* ((default-dir "~/org/braindump/") ; Укажите ваш каталог для org-файлов
|
||||||
|
(files (my/get-relative-org-files default-dir)) ; Список файлов с относительными путями
|
||||||
|
(file (completing-read "Select a file or create a new one: "
|
||||||
|
files nil nil)))
|
||||||
|
(unless (string-suffix-p ".org" file)
|
||||||
|
(setq file (concat file ".org")))
|
||||||
|
(let* ((full-path (expand-file-name file default-dir))
|
||||||
|
(dir (file-name-directory full-path))) ; Извлечь путь директории
|
||||||
|
;; Создаём недостающие директории
|
||||||
|
(unless (file-directory-p dir)
|
||||||
|
(make-directory dir t))
|
||||||
|
;; Создаём файл, если его нет, и добавляем заголовок
|
||||||
|
(unless (file-exists-p full-path)
|
||||||
|
(write-region (concat "#+TITLE: " (file-name-sans-extension file) "\n\n")
|
||||||
|
nil
|
||||||
|
full-path))
|
||||||
|
full-path))) ; Возвращает полный путь к выбранному или новому файлу
|
||||||
|
|
||||||
|
(defun my/get-relative-org-files (dir)
|
||||||
|
"Рекурсивно получить список org-файлов с путями, относительно DIR."
|
||||||
|
(let ((all-files (directory-files-recursively dir "\\.org$")))
|
||||||
|
(mapcar (lambda (file)
|
||||||
|
(file-relative-name file dir))
|
||||||
|
all-files)))
|
||||||
|
|
||||||
|
(defun my/get-location ()
|
||||||
|
"Вернуть точку сохранения записи в выбранный файл."
|
||||||
|
(let ((file (my/select-or-create-org-file)))
|
||||||
|
(set-buffer (find-file-noselect file)) ; Открывает файл в фоновом режиме
|
||||||
|
(goto-char (point-max)) ; Перемещается в конец файла
|
||||||
|
(list file))) ; Возвращает файл как место записи
|
||||||
|
|
||||||
|
|
||||||
(defun my-org-roam-refile ()
|
(defun my-org-roam-refile ()
|
||||||
"Переместить текущую заметку под заголовок 'Links' в выбранный файл."
|
"Переместить текущую заметку под заголовок 'Links' в выбранный файл."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -702,6 +709,10 @@ before packages are loaded."
|
||||||
(visual-line-mode 1)))
|
(visual-line-mode 1)))
|
||||||
|
|
||||||
(setq org-agenda-files '("~/org/grocery.org" "~/org/todos.org" "~/org/inbox.org"))
|
(setq org-agenda-files '("~/org/grocery.org" "~/org/todos.org" "~/org/inbox.org"))
|
||||||
|
(setq org-agenda-files
|
||||||
|
(append org-agenda-files
|
||||||
|
(directory-files-recursively "~/org/braindump/" "\\.org$")))
|
||||||
|
|
||||||
(use-package org-roam
|
(use-package org-roam
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:custom
|
:custom
|
||||||
|
@ -726,25 +737,18 @@ 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
|
"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
|
||||||
:after org-roam
|
;; :after org-roam
|
||||||
:ensure nil
|
;; :ensure nil
|
||||||
:custom
|
;; :custom
|
||||||
(org-roam-dailies-directory "journal/")
|
;; (org-roam-dailies-directory "journal/")
|
||||||
:config
|
;; :config
|
||||||
(setq org-roam-dailies-capture-templates
|
;; (setq org-roam-dailies-capture-templates
|
||||||
'(("d" "default" entry "* %<%I:%M %p>: %?"
|
;; '(("d" "default" entry "* %<%I:%M %p>: %?"
|
||||||
:if-new (file+head "daily/%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n")))))
|
;; :if-new (file+head "daily/%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n")))))
|
||||||
|
|
||||||
;; (setq org-latex-pdf-process
|
|
||||||
;; '("xelatex -interaction nonstopmode -output-directory %o %f"
|
|
||||||
;; "biber %b"
|
|
||||||
;; "xelatex -interaction nonstopmode -output-directory %o %f"
|
|
||||||
;; "xelatex -interaction nonstopmode -output-directory %o %f"))
|
|
||||||
|
|
||||||
(defun my/org-capture-close-frame-for-specific-templates ()
|
(defun my/org-capture-close-frame-for-specific-templates ()
|
||||||
"Close the capture window only for specific templates."
|
"Close the capture window only for specific templates."
|
||||||
|
@ -761,10 +765,16 @@ before packages are loaded."
|
||||||
"* %?"
|
"* %?"
|
||||||
:empty-lines 0)
|
:empty-lines 0)
|
||||||
|
|
||||||
("i" "Inbox"
|
;; ("i" "Inbox"
|
||||||
entry (file+headline "~/org/inbox.org" "Inbox")
|
;; entry (file+headline "~/org/inbox.org" "Inbox")
|
||||||
"* [%<%Y-%m-%d>] %U %? :inbox: \n %:annotation\n %:link"
|
;; "* [%<%Y-%m-%d>] %U %? :inbox: \n %:annotation\n %:link"
|
||||||
:empty-lines 0)
|
;; :empty-lines 0)
|
||||||
|
|
||||||
|
("d" "Braindump"
|
||||||
|
entry
|
||||||
|
(function my/get-location)
|
||||||
|
"* [%<%Y-%m-%d>] %? \n:PROPERTIES:\n:ID: %(org-id-new)\n:END:\n"
|
||||||
|
:empty-lines 1)
|
||||||
|
|
||||||
("r" "Grocery list"
|
("r" "Grocery list"
|
||||||
entry (file+headline "~/org/grocery.org" "Grocery list")
|
entry (file+headline "~/org/grocery.org" "Grocery list")
|
||||||
|
@ -789,15 +799,16 @@ before packages are loaded."
|
||||||
"* TODO [#C] %?\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/inbox.org" "Selected web capture")
|
entry
|
||||||
"* [%<%Y-%m-%d>] %^{Title} :inbox:\nSource: %u, %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
|
(function my/get-location)
|
||||||
|
"* [%<%Y-%m-%d>] %^{Title}\n:PROPERTIES:\n:ID: %(org-id-new)\n:END:\n Source: %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n%?"
|
||||||
:empty-lines 1)
|
:empty-lines 1)
|
||||||
|
|
||||||
("L" "Unselected web capture"
|
("L" "Unselected web capture"
|
||||||
entry (file+headline "~/org/inbox.org" "Web links")
|
entry
|
||||||
"* [%<%Y-%m-%d>] %(transform-square-brackets-to-round-ones \"%:description\")%? :inbox:\n- %:link\n"
|
(function my/get-location)
|
||||||
|
"* [%<%Y-%m-%d>] [[%:link][%(transform-square-brackets-to-round-ones \"%:description\")]]\n%?\n:PROPERTIES:\n:ID: %(org-id-new)\n:END:\n"
|
||||||
:empty-lines 1)))
|
:empty-lines 1)))
|
||||||
|
|
||||||
(setq org-todo-keywords
|
(setq org-todo-keywords
|
||||||
|
|
Loading…
Add table
Reference in a new issue