diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index a88f6e6..5302b5b 100755 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -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. diff --git a/emacs/config.el b/emacs/config.el index f78bd11..26d56f2 100755 --- a/emacs/config.el +++ b/emacs/config.el @@ -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 diff --git a/emacs/modules/tools/wiki/README.org b/emacs/modules/tools/wiki/README.org index 65e470e..65066b3 100644 --- a/emacs/modules/tools/wiki/README.org +++ b/emacs/modules/tools/wiki/README.org @@ -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]] diff --git a/emacs/modules/tools/wiki/config.el b/emacs/modules/tools/wiki/config.el index 21faf5c..3d45ad7 100644 --- a/emacs/modules/tools/wiki/config.el +++ b/emacs/modules/tools/wiki/config.el @@ -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,30 +46,48 @@ org-roam-dailies-directory (f-join +wiki-directory "daily")) (org-roam-setup)) -(use-package! anki-editor - :hook (org-mode . anki-editor-mode) - :preface - (defvar +wiki-directory nil) - :init - (map! :localleader - :map org-mode-map - (:prefix ("C" . "Anki cards") - "p" #'anki-editor-push-notes - "P" #'+anki-editor-push-all-notes-to-anki - "r" #'anki-editor-retry-failure-notes - "i" #'anki-editor-insert-note - "I" #'anki-editor-cloze-region - "e" #'anki-editor-export-subtree-to-html - "d" #'+anki-editor-reset-note - "D" #'+anki-editor-reset-all-notes)) - :config - (setq anki-editor-create-decks 't - +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))) +(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) + :init + (map! :localleader + :map org-mode-map + (:prefix ("C" . "Anki cards") + "p" #'anki-editor-push-notes + "P" #'+anki-editor-push-all-notes-to-anki + "r" #'anki-editor-retry-failure-notes + "i" #'anki-editor-insert-note + "I" #'anki-editor-cloze-region + "e" #'anki-editor-export-subtree-to-html + "d" #'+anki-editor-reset-note + "D" #'+anki-editor-reset-all-notes)) + :config + (setq anki-editor-create-decks 't + +anki-cards-directory (f-join +wiki-directory +anki-cards-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))) +(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)))) ;;; config.el ends here diff --git a/emacs/modules/tools/wiki/packages.el b/emacs/modules/tools/wiki/packages.el index cd7bf7b..56e1c0d 100644 --- a/emacs/modules/tools/wiki/packages.el +++ b/emacs/modules/tools/wiki/packages.el @@ -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 diff --git a/nvim/init.vim b/nvim/init.vim index 45213e4..42c3ad5 100755 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -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'