;; Added by Package.el. This must come before configurations of;; installed packages. Don't delete this line. If you don't want it,;; just comment it out by adding a semicolon to the start of the line.;; You may delete these explanatory comments.(package-initialize)(require'package)(add-to-list'package-archives'("melpa"."http://melpa.org/packages/")t)(custom-set-variables;; custom-set-variables was added by Custom.;; If you edit it by hand, you could mess it up, so be careful.;; Your init file should contain only one such instance.;; If there is more than one, they won't work right.'(package-selected-packages'(consult-notesverticoorg-roam-uimarkdown-modeconsultorg-roam)))(custom-set-faces;; custom-set-faces was added by Custom.;; If you edit it by hand, you could mess it up, so be careful.;; Your init file should contain only one such instance.;; If there is more than one, they won't work right.)(add-to-list'package-archives'("melpa-stable"."https://stable.melpa.org/packages/"))(add-to-list'load-path"~/reps/md-roam")(require'md-roam)(setqorg-roam-file-extensions'("org""md")); enable Org-roam for a markdown extension(md-roam-mode1); md-roam-mode needs to be active before org-roam-db-sync(setqmd-roam-file-extension"md")(global-set-key(kbd"C-c <left>")'windmove-left)(global-set-key(kbd"C-c <right>")'windmove-right)(global-set-key(kbd"C-c <up>")'windmove-up)(global-set-key(kbd"C-c <down>")'windmove-down)(global-set-key(kbd"C-c d")'delete-window)(require'use-package)(use-packageorg-roam:ensuret:init(setqorg-roam-v2-ackt):custom(org-roam-directory"~/org-roam")(org-roam-completion-everywheret)(org-roam-node-display-template(concat"${title:*} "(propertize"${tags:80}"'face'org-tag)))(org-roam-capture-templates'(("d""default"plain"%?":if-new(file+head"%<%Y-%m-%d-%H:%M:%S>-${slug}.org""#+title: ${title}\n#+filetags:%^{org-roam-tags}\n#+date: %U\n"):unnarrowedt)("m""Markdown"plain"":target(file+head"%<%Y-%m-%dT%H%M%S>-${slug}.md""---\ntitle: ${title}\ndescription:\nimage:\nid: %<%Y-%m-%dT%H%M%S>\ncategory: %^{org-roam-tags}\nroam-date: %U\n---\n"):unnarrowedt)("b""Books"plain"\n* Source\n\nAuthor: %^{Author}\n\nTitle: ${title}\n\nYear: %^{Year}\n\n* Summary\n\n":if-new(file+head"%<%Y-%m-%d-%H:%M:%S>-${slug}.org""#+title: ${title}\n#+date: %U\n#+filetags: :Books: :%^{Book type}:\n"):unnarrowedt))):bind(("C-c n l".org-roam-buffer-toggle)("C-c n f".org-roam-node-find)("C-c n c".org-roam-capture)("C-c n i".org-roam-node-insert):maporg-mode-map("C-M-i".completion-at-point):maporg-roam-dailies-map("Y".org-roam-dailies-capture-yesterday)("T".org-roam-dailies-capture-tomorrow)):bind-keymap("C-c n d".org-roam-dailies-map):config(require'org-roam-dailies);; Ensure the keymap is available(org-roam-db-autosync-mode));; Make the colors and text less eye-strainy(load-theme'tango-darkt)(set-face-attribute'defaultnil:height200);; I mindlessly press ESC, so stop me from wreaking havoc(global-set-key(kbd"<escape>")'keyboard-escape-quit)(when(fboundp'windmove-default-keybindings)(windmove-default-keybindings))(add-hook'org-shiftup-final-hook'windmove-up)(add-hook'org-shiftleft-final-hook'windmove-left)(add-hook'org-shiftdown-final-hook'windmove-down)(add-hook'org-shiftright-final-hook'windmove-right)(defunbms/org-roam-rg-search()"Search org-roam directory using consult-ripgrep. With live-preview."(interactive)(let((consult-ripgrep-args"rg --null --type md --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number --with-filename ."))(consult-ripgrep"~/org-roam")))(global-set-key(kbd"C-c rr")'bms/org-roam-rg-search)(defunjmb/counsel-rg-roam()"Do counsel-ag on the org roam directory"(interactive)(counsel-rgnil"~/org-roam"))(global-set-key(kbd"C-c tt")'jmb/counsel-rg-roam)(setqresize-mini-windows'grow-only)(setqmax-mini-window-height10)(fido-vertical-mode1);;(icomplete-vertical-mode 1)(defundelete-file-and-buffer()"Kill the current buffer and deletes the file it is visiting."(interactive)(let((filename(buffer-file-name)))(iffilename(if(y-or-n-p(concat"Do you really want to delete file "filename" ?"))(progn(delete-filefilename)(message"Deleted file %s."filename)(kill-buffer)))(message"Not a file visiting buffer!"))))(global-set-key(kbd"C-c rf")'delete-file-and-buffer);; Prevent open files in second window (split screen)(setqns-pop-up-framesnil)(setqconsult-notes-file-dir-sources'(("Org"?o"~/org-roam/")))(defunconsult-ripgrep-one-file()"Call `consult-ripgrep' for the current buffer (a single file)."(interactive)(let((consult-project-root-function(lambda()"~/org-roam/"))(consult-ripgrep-args(concat"rg ""--null ""--line-buffered ""--color=never ""--line-number ""--smart-case ""--no-heading ""--max-columns=1000 ""--max-columns-preview ""--search-zip ""--with-filename ""--path-separator=/ "".")))(consult-ripgrep)))