Update editor configs

This commit is contained in:
Gabriel Arazas 2021-05-09 10:42:17 +08:00
parent 932a81aa81
commit 233e6bac4e
6 changed files with 61 additions and 54 deletions

View File

@ -219,7 +219,7 @@ mouse:
# If this is `true`, the cursor is temporarily hidden when typing.
hide_when_typing: false
url:
hints:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.

View File

@ -32,11 +32,6 @@
(defvar my/wiki-asset-directory-name "assets")
(defun align-non-space (BEG END)
"Align non-space columns in region BEG END."
(interactive "r")
(align-regexp BEG END "\\(\\s-*\\)\\S-+" 1 1 t))
(defun my/create-assets-folder ()
"A quick convenient function to create an assets folder in the wiki folder."
(interactive)
@ -95,11 +90,15 @@
("l" "literature" plain "%?"
:if-new
(file+head ,(f-join "literature" "%<%Y-%m-%d-%H-%M-%S>")"#+title: ${title}
(file+head ,(f-join "literature" "%<%Y-%m-%d-%H-%M-%S>.org") "#+title: ${title}
#+date: \"%<%Y-%m-%d %T %:z>\"
#+date_modified: \"%<%Y-%m-%d %T %:z>\"
#+language: en")
:unnarrowed t))
:unnarrowed t)
("d" "dailies" entry "* %?"
:if-new
(file+head ,(expand-file-name "%<%Y-%m-%d>.org" org-roam-dailies-directory) "#+title: %<%Y-%m-%d>\n")))
org-roam-dailies-capture-templates `(("d" "default" entry "* %?"
:if-new

View File

@ -1,6 +1,6 @@
#+title: tools/wiki
#+date: "2021-05-05 00:27:26 +08:00"
#+date_modified: "2021-05-05 01:52:39 +08:00"
#+date_modified: "2021-05-08 12:28:46 +08:00"
#+language: en
@ -8,14 +8,16 @@
* Description
This module set up my personal wiki configuration with Emacs primarily with org-roam.
Just like Emacs itself, tried my best to make it fully configurable.
The setup uses org-roam v2.
** Module flags
- ~+anki~ enables Anki cards editing with [[https://github.com/louietan/anki-editor/][anki-editor]].
- ~+markdown~ adds Markdown support in org-roam.
- ~+biblio~ enables reference management with [[https://github.com/jkitchin/org-ref][org-ref]].
- ~+dendron~ adds [[https://dendron.so/][Dendron]]-inspired features with [[https://github.com/vicrdguez/dendroam][dendroam]].
- ~+markdown~ adds Markdown support in org-roam.
@ -25,6 +27,7 @@ The setup uses org-roam v2.
- [[https://github.com/louietan/anki-editor/][anki-editor]]
- [[https://github.com/vicrdguez/dendroam][dendroam]]
- [[https://github.com/nobiot/md-roam][md-roam]]
- [[https://github.com/jkitchin/org-ref][org-ref]]

View File

@ -9,26 +9,6 @@
;;; Code:
(defvar +wiki-directory "~/wiki")
(defvar +anki-cards-directory-name "cards")
(defvar +structured-notes-directory-name "structured")
(defvar +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))
(defvar +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name))
(defun +anki-editor-push-all-notes-to-anki ()
(interactive)
(anki-editor-push-notes nil nil (directory-files-recursively +anki-cards-directory "\\.*org" nil)))
(defun +anki-editor-reset-note () "Reset the Anki note in point by deleting the note ID and the deck."
(interactive)
(org-entry-delete (point) anki-editor-prop-note-id)
(org-entry-delete (point) anki-editor-prop-deck))
(defun +anki-editor-reset-all-notes ()
"Reset the Anki notes in the current buffer by deleting the note ID and the deck."
(interactive)
(anki-editor-map-note-entries #'+anki-editor-reset-note))
(use-package! org-roam
:hook (org-load . org-roam-mode)
:commands
@ -66,7 +46,22 @@
org-roam-dailies-directory (f-join +wiki-directory "daily"))
(org-roam-setup))
(use-package! anki-editor
(when (featurep! +anki)
(defvar +anki-cards-directory-name "cards")
(defvar +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))
(defun +anki-editor-push-all-notes-to-anki ()
(interactive)
(anki-editor-push-notes nil nil (directory-files-recursively +anki-cards-directory "\\.*org" nil)))
(defun +anki-editor-reset-note ()
"Reset the Anki note in point by deleting the note ID and the deck."
(interactive)
(org-entry-delete (point) anki-editor-prop-note-id)
(org-entry-delete (point) anki-editor-prop-deck))
(defun +anki-editor-reset-all-notes ()
"Reset the Anki notes in the current buffer by deleting the note ID and the deck."
(interactive)
(anki-editor-map-note-entries #'+anki-editor-reset-note))
(use-package! anki-editor
:hook (org-mode . anki-editor-mode)
:preface
(defvar +wiki-directory nil)
@ -84,12 +79,15 @@
"D" #'+anki-editor-reset-all-notes))
:config
(setq anki-editor-create-decks 't
+anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name)))
+anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))))
(use-package! dendroam
(when (featurep! +dendron)
(defvar +structured-notes-directory-name "structured")
(defvar +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name))
(use-package! dendroam
:after org-roam
:preface (defvar +wiki-directory nil)
:config
(setq +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name)))
(setq +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name))))
;;; config.el ends here

View File

@ -5,6 +5,10 @@
(package! org-roam
:recipe (:host github :repo "org-roam/org-roam" :branch "v2"))
(when (featurep! +biblio)
(package! org-ref
:recipe (:host github :repo "jkitchin/org-ref")))
(when (featurep! +anki)
(package! anki-editor
:recipe (:host github

View File

@ -48,6 +48,9 @@ endif
let g:deoplete#enable_at_startup = 1
" A linting engine and an LSP client.
Plug 'dense-analysis/ale'
" One of the most popular plugins.
" Allows to create more substantial status bars.
Plug 'vim-airline/vim-airline'