(global-display-line-numbers-mode t) (defun upload-anki () "Upload notes to Anki and exit Emacs." (interactive) ; Make the function callable interactively (anki-editor-mode) ; Enable Anki editor mode (anki-editor-push-notes) ; Push notes to Anki (save-buffer) ; Save the current buffer (kill-emacs) ) (unless (package-installed-p 'anki-editor) (package-vc-install '(anki-editor . (:url "https://github.com/anki-editor/anki-editor")))) (global-set-key (kbd "C-c l") #'org-store-link) (global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c c") #'org-capture) (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 '(anki-editor org-roam org-roam-ui)) '(package-vc-selected-packages '((anki-editor :url "https://github.com/anki-editor/anki-editor")))) (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. ) (require 'package) ;; Add MELPA (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("gnu" . "https://elpa.gnu.org/packages/"))) (package-initialize) ;; Ensure use-package is installed (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) ;; Org and Org-roam setup (use-package org :ensure t) (use-package org-roam :ensure t :custom (org-roam-directory (file-truename "/home/t/org/roam")) :init (setq org-roam-v2-ack t) :config (org-roam-db-autosync-mode)) ;; Optional keybindings (global-set-key (kbd "C-c n l") #'org-roam-buffer-toggle) (global-set-key (kbd "C-c n f") #'org-roam-node-find) (global-set-key (kbd "C-c n i") #'org-roam-node-insert)