Use command key as meta (macOS):
(setq ns-command-modifier 'meta)
Fido mode for minibuffer autocompletion (instead of Helm or Ivy):
(fido-mode t)
(icomplete-vertical-mode t)
I don’t like the custom*
variables being saved in my config file and cluttering it. I prefer to have them in their own location.
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)
Likewise, I don’t like having backup files (~) all over the place. But they are sometimes useful. This setting saves all of them under the same directory.
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
Inhibit the startup screen. I’ll take the scratch
buffer, thank you very much.
(setq inhibit-startup-screen t)
I barely use the mouse, so the tool bar and menu bar are just taking screen real state.
(tool-bar-mode -1)
(menu-bar-mode -1)
And I like having the clock in the mode line, so I can easily tell the time when I’m in full screen.
(display-time-mode 1)
Wrap around lines:
(global-visual-line-mode t)
Dracula theme:
(use-package dracula-theme
:ensure t
:config
(load-theme 'dracula t))
Magit. Use git without the command line.
(use-package pinentry :ensure t :defer t)
(use-package magit
:ensure t
:defer t
:bind ("C-x g" . magit-status)
:config (setq magit-save-repository-buffers nil)
(pinentry-start)
:after (pinentry))
Some essential org-mode bindings:
(use-package org
:bind
("C-c l" . org-store-link)
("C-c a" . org-agenda)
("C-c c" . org-capture)
:config
(setq org-use-speed-commands t)
;; enable bash for babel
(org-babel-do-load-languages
'org-babel-load-languages
'((shell . t)))
(setq org-confirm-babel-evaluate nil)
;; don't leave an empty line after inserting a heading
(setq org-blank-before-new-entry
'((heading . nil) (plain-list-item . nil)))
(setq org-directory "~/org")
(setq org-agenda-files (list "notes.org" "inbox.org"))
(setq org-enforce-todo-dependencies t)
;; Don't show blocked tasks in agenda
(setq org-agenda-dim-blocked-tasks 'invisible)
;; Don't show future scheduled tasks in agenda
(setq org-agenda-todo-ignore-scheduled 'future)
(defun dgp/org-add-created-date ()
"Add a CREATED property with the current date when creating a task."
(when (and (org-get-todo-state)
(not (org-entry-get (point) "CREATED")))
(org-set-property "CREATED" (format-time-string "[%Y-%m-%d %a]"))))
;; Add hook after change state
(add-hook 'org-after-todo-state-change-hook 'dgp/org-add-created-date)
;; Org Capture Template for TODOs to Inbox
(setq org-capture-templates
'(("t" "Todo" entry (file "~/org/inbox.org")
"* TODO %?\n :PROPERTIES:\n:CREATED: %U\n:END:")))
;; org refile settings
(setq org-refile-targets (list
(cons 'org-agenda-files
(cons :maxlevel 9))))
(setq org-refile-use-outline-path t)
(setq org-outline-path-complete-in-steps nil)
;; Record when a task is done
(setq org-log-done 'time)
;; Change level 4 color to play well with dracula theme
(custom-theme-set-faces 'user
`(org-level-4 ((t (:foreground "orange")))))
;; Add org habits
(add-to-list 'org-modules 'org-habit)
(setq org-habit-show-all-today t))
And setting up org-journal for my daily notes:
(use-package org-journal
:ensure t
:bind ("C-c d" . org-journal-new-entry)
:config
(setq org-journal-dir "~/Documents/notes/Daily/"))
undo-tree graphically shows the state of emacs undo tree and lets you navigate through it.
(use-package undo-tree
:init (global-undo-tree-mode)
:config
(setq undo-tree-history-directory-alist
`(("." . ,(concat user-emacs-directory "undo-tree-history")))))
ace-window. Jump to other window by typing a character. And set the characters so they are all in the home row.
(use-package ace-window
:bind ("C-x o" . ace-window)
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
Yasnippets for template insertion (those pesky code blocks!):
(use-package yasnippet
:ensure t
:config
(yas-global-mode 1))
Spell checking:
;; Set aspell as the default spell checker
(setq ispell-program-name "aspell")
;; And default dictionary to English
(setq ispell-dictionary "english")
;; Enable flyspell mode
(add-hook 'text-mode-hook 'flyspell-mode)
Run LLM locally with ollama and gptel:
(use-package gptel
:ensure t
:config
(setq
gptel-model 'gemma:2b
gptel-backend (gptel-make-ollama "Ollama"
:host "localhost:11434"
:stream t
:models '(gemma:2b))))
To have bookmarks directly point to org headings:
(use-package org-bookmark-heading
:ensure t)
New packages that I’m testing but might be removed:
(use-package denote
:ensure t
:defer t)
(use-package which-key
:ensure t
:config
(which-key-mode) ;; Enable which-key globally
(setq which-key-idle-delay 0.2)) ;; Time (in seconds) to wait before showing key hints
(use-package dashboard
:ensure t
:config
(dashboard-setup-startup-hook)
(setq dashboard-startup-banner 1)
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(agenda . 5)))
(setq dashboard-banner-logo-title "Welcome to Emacs, Dani")
(setq dashboard-footer-messages '("Thinkito V1.0")))
(use-package moody
:config
(moody-replace-mode-line-front-space)
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
(use-package treemacs
:ensure t
:bind
("C-c t" . treemacs-select-window)
([f8] . treemacs)
:config
(setq treemacs-width 30
treemacs-is-never-other-window t))
To automatically commit changes in my documents:
(use-package git-auto-commit-mode
:ensure t
:config
(setq gac-ask-for-summary-p t))
Insert current date ‘Day, YYYY-MM-DD’:
(defun insert-current-date ()
(interactive)
(insert (format-time-string "%A, %Y-%m-%d")))
(global-set-key (kbd "C-c d") 'insert-current-date)
Following instructions here: https://kchousos.github.io/posts/sicp-in-emacs/
(use-package sicp)
(use-package racket-mode)
(use-package ob-racket
:straight (ob-racket :type git :host github :repo "hasu/emacs-ob-racket")
:init
(add-to-list 'org-babel-load-languages '(racket . t)))
Read feeds with elfeed(;
(use-package elfeed-org
:ensure t
:config
(elfeed-org))
(use-package org-ql
:ensure t)