diff --git a/emacs/config.el b/emacs/config.el index 19f5b8e..720a6aa 100755 --- a/emacs/config.el +++ b/emacs/config.el @@ -6,30 +6,27 @@ user-mail-address "foo.dogsquared@gmail.com") (setq doom-font (font-spec :family "Iosevka" :size 16) - doom-serif-font (font-spec :family "Source Serif Pro")) + doom-serif-font (font-spec :family "Source Serif 4")) (setq doom-theme 'doom-nord) -(setq org-directory "~/writings/orgnotes" - org-roam-directory "~/writings/wiki" - org-roam-dailies-directory (f-join org-roam-directory "daily")) +(setq org-directory "~/library/writings/wiki" + org-roam-directory "~/library/writings/wiki" + org-roam-db-location (f-join org-roam-directory "org-roam.db") + org-agenda-files '("~/library/writings/wiki/inbox") + org-roam-dailies-directory (f-join org-roam-directory "daily") + org-id-link-to-org-use-id t + +file-templates-dir (expand-file-name "templates" doom-private-dir) + +wiki-directory "~/library/writings/wiki" + org-export-coding-system 'utf-8 -(setq global-display-line-numbers-mode t + enable-local-variables "query" + image-use-external-converter t + org-startup-with-inline-images t + + global-display-line-numbers-mode t display-line-numbers-type 'relative - projectile-project-search-path '("~/projects/software/" "~/writings/")) - -(setq - org-id-link-to-org-use-id t - - +file-templates-dir (expand-file-name "templates" doom-private-dir) - +wiki-directory "~/writings/wiki" - - org-journal-dir "~/writings/journal" - org-journal-file-format "%F" - - enable-local-variables "query" - image-use-external-converter t - org-startup-with-inline-images t) + projectile-project-search-path '("~/library/projects/software" "~/library/writings" "~/library/projects/learning")) (add-to-list 'org-modules 'org-habit) (add-to-list 'org-modules 'org-checklist) diff --git a/emacs/init.el b/emacs/init.el index 7ca3f1d..d837eb8 100755 --- a/emacs/init.el +++ b/emacs/init.el @@ -15,176 +15,101 @@ ;; directory (for easy access to its source code). (doom! :input - ;;chinese + chinese japanese :completion - (company +childframe) ; the ultimate code completion backend - ;;helm ; the *other* search engine for love and life - ;;ido ; the other *other* search engine... - ivy ; a search engine for love and life + (company +childframe) + (vertico +icons) :ui - ;;deft ; notational velocity for Emacs - doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs - ;;fill-column ; a `fill-column' indicator - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - ;;hydra - indent-guides ; highlighted indent columns - modeline ; snazzy, Atom-inspired modeline, plus API - ;;nav-flash ; blink the current line after jumping - ;;neotree ; a project drawer, like NERDTree for vim - ophints ; highlight the region an operation acts on - (popup +defaults) ; tame sudden yet inevitable temporary windows - ligatures ; ligatures or substitute text with pretty symbols - ;;tabs ; an tab bar for Emacs - ;;treemacs ; a project drawer, like neotree but cooler - unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe - vi-tilde-fringe ; fringe tildes to mark beyond EOB - ;;window-select ; visually switch windows - workspaces ; tab emulation, persistence & separate workspaces - ;;zen ; distraction-free coding or writing + doom + doom-dashboard + doom-quit + hl-todo + indent-guides + modeline + ophints + (popup +defaults) + (ligatures +extra) + unicode + vc-gutter + vi-tilde-fringe + workspaces :editor - (evil +everywhere); come to the dark side, we have cookies - file-templates ; auto-snippets for empty files - fold ; (nigh) universal code folding - format ; automated prettiness - ;;god ; run Emacs commands without modifier keys - ;;lispy ; vim for lisp, for people who don't like vim - ;;multiple-cursors ; editing in many places at once - ;;objed ; text object editing for the innocent - ;;parinfer ; turn lisp into python, sort of - ;;rotate-text ; cycle region at point between text candidates - snippets ; my elves. They type so I don't have to - word-wrap ; soft wrapping with language-aware indent + (evil +everywhere) + file-templates + fold + format + lispy + snippets + word-wrap :emacs - (dired +ranger) ; making dired pretty [functional] - electric ; smarter, keyword-based electric-indent - ;;ibuffer ; interactive buffer management - undo ; persistent, smarter undo for your inevitable mistakes - vc ; version-control and Emacs, sitting in a tree + (dired +ranger) + electric + undo + vc :term - ;;eshell ; the elisp shell that works everywhere - ;;shell ; simple shell REPL for Emacs - ;;term ; basic terminal emulator for Emacs - vterm ; the best terminal emulation in Emacs + vterm :checkers - syntax ; tasing you for every semicolon you forget - ;;spell ; tasing you for misspelling mispelling - ;;grammar ; tasing grammar mistake every you make + syntax :tools - ;;ansible biblio - (debugger +lsp) ; FIXME stepping through code, to help you add bugs + (debugger +lsp) direnv - ;;docker - editorconfig ; let someone else argue about tabs vs spaces - ;;ein ; tame Jupyter notebooks with emacs - (eval +overlay) ; run code, run (also, repls) - ;;gist ; interacting with github gists + editorconfig + (eval +overlay) (lookup +dictionary - +offline) ; navigate your code and its documentation + +offline) lsp - ;;macos ; MacOS-specific commands - magit ; a git porcelain for Emacs - ;;make ; run make tasks from Emacs - ;;pass ; password manager for nerds - pdf ; pdf enhancements - ;;prodigy ; FIXME managing external services & code builders - rgb ; creating color strings - ;;terraform ; infrastructure as code - ;;tmux ; an API for interacting with tmux - upload ; map local to remote projects via ssh/ftp + magit + pdf + rgb + upload :lang - ;;agda ; types of types of types of types... - assembly ; assembly for fun or debugging - (cc +lsp) ; C/C++/Obj-C madness - clojure ; java with a lisp - common-lisp ; if you've seen one lisp, you've seen them all - ;;coq ; proofs-as-programs - ;;crystal ; ruby at the speed of c - csharp ; unity, .NET, and mono shenanigans - data ; config/data formats - (dart +flutter) ; paint ui and not much else - ;;elixir ; erlang done right - ;;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses - ;;erlang ; an elegant language for a more civilized age - ess ; emacs speaks statistics - ;;faust ; dsp, but you get to keep your soul - ;;fsharp ; ML stands for Microsoft's Language - ;;fstar ; (dependent) types and (monadic) effects and Z3 - (gdscript +lsp) ; the language I waited for - ;;(go +lsp) ; the hipster dialect - ;;(haskell +dante) ; a language that's lazier than I am - ;;hy ; readability of scheme w/ speed of python - ;;idris ; - ;;(java +meghanada) ; the poster child for carpal tunnel syndrome - ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) - ;;julia ; a better, faster MATLAB - ;;kotlin ; a better, slicker Java(Script) - (latex +latexmk) ; writing papers in Emacs has never been so fun - ;;lean - ;;factor - ;;ledger ; an accounting system in Emacs - lua ; one-based indices? one-based indices - markdown ; writing docs for people to ignore - nim ; python + lisp at the speed of c - nix ; I hereby declare "nix geht mehr!" - ;;ocaml ; an objective camel + (cc +lsp) + clojure + common-lisp + data + (dart +flutter) + emacs-lisp + ess + (gdscript +lsp) + (latex +latexmk) + lua + markdown + nix (org +gnuplot - +hugo - +journal - +noter - +pandoc - +present) ; organize your plain life in plain text - raku ; write code no one else can comprehend - ;;php ; perl's insecure younger brother - ;;plantuml ; diagrams for confusing people more - ;;purescript ; javascript, but functional + +dragndrop + +hugo + +journal + +noter + +pandoc + +present + +pretty + +roam2) + raku (python +lsp +pyright - +cython) ; beautiful is better than ugly - ;;qt ; the 'cutest' gui framework ever - racket ; a DSL for DSLs - ;;rest ; Emacs as a REST client - ;;rst ; ReST in peace - (ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() - ;;scala ; java, but good - scheme ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor - ;;sml - ;;solidity ; do you need a blockchain? No. - ;;swift ; who asked for emoji variables? - ;;terra ; Earth and Moon in alignment for performance. - web ; the tubes - - :email - ;;(mu4e +gmail) - ;;notmuch - ;;(wanderlust +gmail) - - :app - ;;calendar - ;;irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader - ;;twitter ; twitter client https://twitter.com/vnought + +cython) + racket + (ruby +rails) + (rust +lsp) + scheme + sh + web :config - ;;literate (default +bindings +smartparens) + ;; My custom modules should be placed here. :tools (wiki +anki +biblio diff --git a/emacs/modules/tools/wiki/README.org b/emacs/modules/tools/wiki/README.org index a1001bb..8bcf5e6 100755 --- a/emacs/modules/tools/wiki/README.org +++ b/emacs/modules/tools/wiki/README.org @@ -4,35 +4,35 @@ #+language: en - * 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. +This module assumes that the wiki is used for multiple purposes such as managing different types of notes such as literature notes. +In addition, it can also manage your cards with a single flag toggle away. ** Module flags - - ~+anki~ enables Anki cards editing with [[https://github.com/louietan/anki-editor/][anki-editor]]. - ~+biblio~ enables reference management with [[https://github.com/jkitchin/org-ref][org-ref]] and [[https://github.com/org-roam/org-roam-bibtex][org-roam-bibtex]]. - ~+dendron~ adds [[https://dendron.so/][Dendron]]-inspired features with [[https://github.com/vicrdguez/dendroam][dendroam]]. - ~+graph~ adds a graphical user interface for your notes. - ~+markdown~ adds Markdown support in org-roam. - ** Plugins - - [[https://github.com/org-roam/org-roam/][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]] -- [[https://github.com/org-roam/org-roam-bibtex][org-roam-bibtex]] -- [[https://github.com/org-roam/org-roam-ui][org-roam-ui]] - - - +- =+anki= + - [[https://github.com/louietan/anki-editor/][anki-editor]] +- =+dendroam= + - [[https://github.com/vicrdguez/dendroam][dendroam]] +- =+markdown= + - [[https://github.com/nobiot/md-roam][md-roam]] +- =+biblio= + - [[https://github.com/jkitchin/org-ref][org-ref]] + - [[https://github.com/org-roam/org-roam-bibtex][org-roam-bibtex]] +- =+graph= + - [[https://github.com/org-roam/org-roam-ui][org-roam-ui]] * Prerequisites diff --git a/emacs/modules/tools/wiki/config.el b/emacs/modules/tools/wiki/config.el index 12b6962..ac01900 100755 --- a/emacs/modules/tools/wiki/config.el +++ b/emacs/modules/tools/wiki/config.el @@ -26,31 +26,37 @@ (defun +wiki/biblio-setup () "Setup the variables for the wiki config." (setq +wiki-bibliography-file (f-join +wiki-directory +wiki-references-filename) - +wiki-bibliography-note (f-join +wiki-directory +wiki-bibliography-note-filename) - org-cite-global-bibliography `(,+wiki-bibliography-file) - org-ref-default-bibliography +wiki-bibliography-file - org-ref-bibliography-notes +wiki-bibliography-note - bibtex-completion-bibliography +wiki-bibliography-file - bibtex-completion-notes-path +wiki-directory)) + +wiki-bibliography-note (f-join +wiki-directory +wiki-bibliography-note-filename) + + org-cite-global-bibliography `(,+wiki-bibliography-file) + + citar-bibliography `(,+wiki-bibliography-file) + citar-notes-paths `(,+wiki-directory) + citar-open-note-function 'orb-citar-edit-note + + bibtex-completion-bibliography +wiki-bibliography-file + bibtex-completion-notes-path +wiki-directory)) (use-package! org-roam-bibtex :after org-roam :preface :config - (require 'org-ref) (+wiki/biblio-setup))) (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) @@ -60,18 +66,21 @@ :hook (org-mode . anki-editor-mode) :preface (defvar +wiki-directory nil) + :init - (map! :localleader - :map org-roam-mode-map - (:prefix ("C" . "Anki cards") - :desc "Push all cards in current document" :n "p" #'anki-editor-push-notes - :desc "Push all cards in cards directory to Anki" :n "P" #'+anki-editor-push-all-notes-to-anki - :desc "Retry to push failed cards" :n "r" #'anki-editor-retry-failure-notes - :desc "Insert a card in current document" :n "i" #'anki-editor-insert-note - :desc "Create a cloze region" :n "I" #'anki-editor-cloze-region - :desc "Export the subtree as HTML" :n "e" #'anki-editor-export-subtree-to-html - :desc "Remove all anki-editor-related properties in a card" :n "d" #'+anki-editor-reset-note - :desc "Remove all properties in all notes" :n "D" #'+anki-editor-reset-all-notes)) + (map! + :map org-roam-mode-map + :localleader + (:prefix ("C" . "Anki cards") + :desc "Push all cards in current document" :n "p" #'anki-editor-push-notes + :desc "Push all cards in cards directory to Anki" :n "P" #'+anki-editor-push-all-notes-to-anki + :desc "Retry to push failed cards" :n "r" #'anki-editor-retry-failure-notes + :desc "Insert a card in current document" :n "i" #'anki-editor-insert-note + :desc "Create a cloze region" :n "I" #'anki-editor-cloze-region + :desc "Export the subtree as HTML" :n "e" #'anki-editor-export-subtree-to-html + :desc "Remove all anki-editor-related properties in a card" :n "d" #'+anki-editor-reset-note + :desc "Remove all properties in all notes" :n "D" #'+anki-editor-reset-all-notes)) + :config (setq anki-editor-create-decks 't +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name)))) diff --git a/emacs/modules/tools/wiki/packages.el b/emacs/modules/tools/wiki/packages.el index 3edf59c..ddf9cc0 100755 --- a/emacs/modules/tools/wiki/packages.el +++ b/emacs/modules/tools/wiki/packages.el @@ -6,8 +6,6 @@ :recipe (:host github :repo "org-roam/org-roam")) (when (featurep! +biblio) - (package! org-ref - :recipe (:host github :repo "jkitchin/org-ref")) (package! org-roam-bibtex :recipe (:host github :repo "org-roam/org-roam-bibtex")))