marco 5c967dca79 CHANGE 22 drones
Update auto-compile       to  1.8.2-1-g945f4eb
Update compat             to
Update consult            to  0.35-13-g40607fb
Update consult-notes      to  006b209
Update corfu              to  0.38-7-gcc244c5
Update denote             to  5a9645b
Update ef-themes          to  559de2d
Update embark             to  0.21-165-g46fb2f8
Update epkg               to v3.3.3-81-gb22da65
Update evil               to  1.14.0-387-gd6d2e5d
Update evil-collection    to  0.0.9-32-g8be4b75
Update llama              to v0.3.1-1-ga938ac0
Update magit              to v3.3.0-742-ga3b9b007
Assimilate ob-restclient       ded3b7e
Update org                to release_9.6.8-746-g234650af2
Assimilate puppet-mode         0.4-13-g71bcd38
Update rainbow-delimiters to  2.1.5-3-gf40ece5
Assimilate restclient          0ba7281
Update transient          to v0.4.3-5-g361d8ac
Update vertico            to  1.4-21-g5780fac
Update which-key          to v3.6.0-20-g4d20bc8
Update with-editor        to v3.3.2
2023-09-05 23:51:40 +02:00

313 lines
8.1 KiB

;; -*- lexical-binding: t -*-
(setq inhibit-startup-buffer-menu t)
(setq inhibit-startup-screen t)
(setq initial-buffer-choice t)
(setq initial-scratch-message "")
(setq confirm-kill-emacs 'yes-or-no-p)
(scroll-bar-mode 0)
(tool-bar-mode 0)
(menu-bar-mode 0)
(setq ns-use-proxy-icon nil)
(setq frame-title-format nil)
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(setq isearch-allow-scroll t)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq show-trailing-whitespace t)
(setq backup-by-copying t)
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
(set-default-coding-systems 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(defalias 'go-mode 'go-ts-mode)
(defalias 'gomod-mode 'go-mod-ts-mode)
(defvar modus-themes-italic-constructs t)
(defvar modus-themes-bold-constructs nil)
(defvar modus-themes-mode-line '(borderless accented))
(defvar modus-themes-region '(bg-only no-extend))
(load-theme 'modus-vivendi t)
(add-to-list 'load-path (expand-file-name "lib/borg/" user-emacs-directory))
(require 'borg)
(use-package auto-compile
(setq auto-compile-display-buffer nil)
(setq auto-compile-mode-line-counter t)
(setq auto-compile-source-recreate-deletes-dest t)
(setq auto-compile-toggle-deletes-nonlib-dest t))
(use-package epkg
:defer t
(setq epkg-repository (expand-file-name "var/epkgs/" user-emacs-directory)))
(use-package dash
:config (global-dash-fontify-mode))
(use-package server
:commands (server-running-p)
:config (or (server-running-p) (server-mode)))
(use-package magit
:defer t
:commands (magit-add-section-hook)
(magit-add-section-hook 'magit-status-sections-hook
(use-package evil
:hook (after-init . evil-mode)
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(evil-mode t)
(evil-set-initial-state 'shell-mode 'normal)
(evil-set-initial-state 'doc-view-mode 'normal)
(evil-set-initial-state 'package-menu-mode 'normal)
(evil-set-initial-state 'biblio-selection-mode 'motion)
(evil-global-set-key 'motion "gs" 'tab-bar-switch-to-tab)
(setq doc-view-continuous t))
(use-package evil-collection
:after evil
(use-package org
(setq org-confirm-babel-evaluate nil)
(setq org-export-use-babel nil)
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)
'((emacs-lisp . t)
(plantuml . t)
(restclient . t)
(C . t)
(java . t)
(shell . t)
(sql . t)
(go . t)
(python . t))))
(use-package vertico
(use-package orderless
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((eglot (styles orderless)) (file (styles partial-completion)))))
(use-package consult
(defun find-fd (&optional dir initial)
(interactive "P")
(let ((consult-find-args "fzf -e"))
(consult-find dir initial)))
(autoload 'projectile-project-root "projectile")
(setq consult-project-root-function #'projectile-project-root))
(use-package embark)
(use-package embark-consult
(embark-collect-mode . consult-preview-at-point-mode))
(use-package marginalia
(marginalia-align 'right)
(use-package which-key
:init (which-key-mode t))
(use-package general
:after which-key
(general-override-mode t)
:keymaps 'key-translation-map
"ESC" (kbd "C-g"))
"C-x x" 'eval-defun)
(general-create-definer tyrant-def
:states '(normal visual insert motion emacs)
:prefix "SPC"
:non-normal-prefix "C-SPC")
"" nil
"SPC" (general-simulate-key "M-x")
"c" (general-simulate-key "C-c")
"h" (general-simulate-key "C-h")
"u" (general-simulate-key "C-u")
"x" (general-simulate-key "C-x")
"w" (general-simulate-key "C-w")
":" 'shell-command
"git" 'magit
"rg" 'consult-ripgrep
"fzf" 'consult-find
"em" '(:ignore t :which-key "emacs")
"emr" (lambda ()
(load-file user-init-file))
"emd" (lambda ()
(find-file user-init-file))
"th" '(:ignore t :which-key "themes")
"ths" 'consult-theme
"ta" '(:ignore t :which-key "tabs")
"tac" 'tab-new
"taq" 'tab-close
"tar" 'tab-rename
"b" '(:ignore t :which-key "buffers")
"bl" 'switch-to-buffer
"bd" 'kill-this-buffer
"f" '(:ignore t :which-key "files")
"ff" 'find-file
"fr" 'rename-file-and-buffer
"p" '(:ignore t :which-key "projects")
"pf" 'projectile-find-file
"pp" 'projectile-switch-project
"pb" 'projectile-switch-to-buffer
"o" '(:ignore t :which-key "org")
"oi" 'org-insert-structure-template
"odu" 'org-update-all-dblocks
"n" '(:ignore t :which-key "notes")
"nl" 'consult-notes
"x" '(:ignore t :which-key "xref")
"xr" 'xref-find-references
"xd" 'xref-find-definitions
(use-package corfu
(use-package projectile
(projectile-mode t)
(setq projectile-require-project-root nil)
(setq projectile-find-dir-includes-top-level t)
(setq projectile-project-search-path '(
(use-package denote
(setq denote-directory (expand-file-name "~/denote"))
(defun x/denote-journal ()
(let* ((today (format-time-string "%A %e %B %Y"))
(string (denote-sluggify today))
(files (denote-directory-files-matching-regexp string)))
((> (length files) 1)
(find-file (completing-read "Select file: " files nil :require-match)))
(find-file (car files)))
(defun x/denote-append-region-to-note (beg end)
(interactive "r")
(if-let (((region-active-p))
(text (buffer-substring-no-properties beg end)))
(goto-char (point-max))
(insert text))
(user-error "No region is available")))
(use-package consult-notes
(use-package rainbow-delimiters
(set-face-foreground 'rainbow-delimiters-depth-1-face "#c66")
(set-face-foreground 'rainbow-delimiters-depth-2-face "#6c6")
(set-face-foreground 'rainbow-delimiters-depth-3-face "#69f")
(set-face-foreground 'rainbow-delimiters-depth-4-face "#cc6")
(set-face-foreground 'rainbow-delimiters-depth-5-face "#6cc")
(set-face-foreground 'rainbow-delimiters-depth-6-face "#c6c")
(set-face-foreground 'rainbow-delimiters-depth-7-face "#ccc")
(set-face-foreground 'rainbow-delimiters-depth-8-face "#999")
(set-face-foreground 'rainbow-delimiters-depth-9-face "#666"))
(use-package lisp-mode
(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode))
(use-package no-littering)
(use-package custom
:no-require t
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load custom-file)))
;; http://steve.yegge.googlepages.com/my-dot-emacs-file
(defun rename-file-and-buffer (new-name)
"Renames both current buffer and file it's visiting to NEW-NAME."
(interactive "New name: ")
(let ((name (buffer-name))
(filename (buffer-file-name)))
(if (not filename)
(message "Buffer '%s' is not visiting a file!" name)
(if (get-buffer new-name)
(message "A buffer named '%s' already exists!" new-name)
(rename-file name new-name t)
(rename-buffer new-name)
(set-visited-file-name new-name)
(set-buffer-modified-p nil))))))