modern_lisp-machine/emacs.d/init.el

151 lines
4.4 KiB
EmacsLisp
Raw Normal View History

2024-01-22 05:09:04 +00:00
;; -*- mode: emacs-lisp; buffer-read-only: t; -*-
2024-01-22 05:06:48 +00:00
;; this emacs configuration is heavily dependant on the guix configuration, which manages the packages.
;; the org-roam-ui packages uses a specific version of org-roam, please dont install the org-roam from
;; the main guix repo, let the package org-roam-ui do that automatically.
2024-01-22 05:00:54 +00:00
(add-hook 'scheme-mode-hook 'guix-devel-mode)
(dirvish-override-dired-mode)
;; Example: Setting cursor-type to 'box
(setq cursor-type 'box)
(setq org-roam-directory "/mnt/Data/Documents/org-files/org-roam")
(load-file "~/.emacs.d/org-roam-templates/main.el")
(set-frame-parameter nil 'alpha-background 100)
(add-to-list 'default-frame-alist '(alpha-background . 100))
(defun toggle-transparency ()
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(85 . 50) '(100 . 100)))))
(toggle-transparency)
(load-theme 'modus-operandi)
(global-set-key (kbd "C-c t") 'toggle-transparency)
(load-file "~/.emacs.d/extensions/alert/alert.el")
;; needs alert
(load-file "~/.emacs.d/extensions/pomidor/pomidor.el")
(add-to-list 'load-path "~/.emacs.d/extensions/xeft") ;; fix a bug that doesn't let it find the xapian module
(load-file "~/.emacs.d/extensions/xeft/xeft.el")
(setq xeft-title-function #'file-name-nondirectory)
;; Follow symlinks.
(setq xeft-recursive 'follow-symlinks)(defvar-local xeft--displayed-by-xeft-p nil)
(defun xeft--eager-preview()
(when-let* ((button (button-at (point)))
(path (button-get button 'path)))
;; Kill previously displayed buffer.
(when (window-live-p xeft--preview-window)
(with-selected-window xeft--preview-window
(when xeft--displayed-by-xeft-p
(kill-buffer))))
;; Show preview of current selection.
(xeft--preview-file path)))
(add-hook 'xeft-find-file-hook
(lambda () (setq xeft--displayed-by-xeft-p t)))
(advice-add 'xeft-next :after #'xeft--eager-preview)
(advice-add 'xeft-previous :after #'xeft--eager-preview)
2024-01-22 05:06:48 +00:00
(global-set-key (kbd "C-c C-n") 'org-roam-capture)
(global-set-key (kbd "C-c C-k") 'xeft)
2024-01-22 05:00:54 +00:00
;; Disable menu bar, tool bar, and scroll bar
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; Disable splash screen and startup message
(setq inhibit-splash-screen t
inhibit-startup-message t)
;; Set default font and size
(set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 120)
;; Show line numbers
(global-display-line-numbers-mode)
;; Highlight current line
(global-hl-line-mode t)
;; Clean mode-line
(setq-default mode-line-format
'("%e"
mode-line-front-space
mode-line-mule-info
mode-line-client
mode-line-modified
mode-line-remote
mode-line-frame-identification
mode-line-buffer-identification
" "
mode-line-position
(vc-mode vc-mode)
" "
mode-line-modes
mode-line-misc-info
mode-line-end-spaces))
;; Set a clean minibuffer prompt
(setq-default minibuffer-prompt-properties
'(read-only t intangible t cursor-intangible t face minibuffer-prompt))
;; Set font to Iosevka Comfy with aliasing
(set-face-attribute 'default nil
:family "Iosevka Comfy"
:height 120
:weight 'normal
:width 'normal
:foundry "CTDB"
:slant 'normal
:underline nil
:overline nil
:strike-through nil
:box nil
:inverse-video nil
:foreground "unspecified"
:background "unspecified"
:stipple nil
:inherit 'unspecified
:antialias 'subpixel)
(add-to-list
'org-capture-templates
`("wN" "Web link" entry (file+headline ,(car org-agenda-files) "Links to read later")
"* %?%a \nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"Fri\"))\n"
:immediate-finish t :empty-lines 2))
(load-file "~/.emacs.d/emacs-nyxt.el" )