From f136aaa0302ec998307d204d1632653d132dbc63 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Fri, 2 Jan 2026 14:44:06 +0100 Subject: [PATCH] Added Orderless completion Emacs --- emacs/.emacs.d/early-init.el | 23 +++++++++++++++++++++++ emacs/.emacs.d/lisp/misc/dashboard.el | 17 +++++++++++++++++ emacs/.emacs.d/lisp/tools/completion.el | 23 +++++++++++++++++++++++ emacs/.emacs.d/recentf | 10 ++++++++++ 4 files changed, 73 insertions(+) create mode 100644 emacs/.emacs.d/early-init.el create mode 100644 emacs/.emacs.d/lisp/misc/dashboard.el create mode 100644 emacs/.emacs.d/recentf diff --git a/emacs/.emacs.d/early-init.el b/emacs/.emacs.d/early-init.el new file mode 100644 index 0000000..d887ee9 --- /dev/null +++ b/emacs/.emacs.d/early-init.el @@ -0,0 +1,23 @@ +;;===================================================================================== +;; Define loader functions +;;===================================================================================== +(defconst fscotto/modules-dir + (expand-file-name "lisp" user-emacs-directory)) + +(defun fscotto/load-module (module) + "Load a MODULE from symbol." + (let* ((module-name (symbol-name module)) + (path (expand-file-name + (concat (replace-regexp-in-string "/" "/" module-name) + ".el") + fscotto/modules-dir))) + (unless (file-exists-p path) + (error "Module not found: %s" path)) + (load path nil 'nomessage))) + +(defun fscotto/load-modules (&rest modules) + "Load MODULES." + (mapc #'fscotto/load-module modules)) + +(defvar fscotto/emacs-profile + (or (getenv "EMACS_PROFILE") "full")) diff --git a/emacs/.emacs.d/lisp/misc/dashboard.el b/emacs/.emacs.d/lisp/misc/dashboard.el new file mode 100644 index 0000000..04cebf3 --- /dev/null +++ b/emacs/.emacs.d/lisp/misc/dashboard.el @@ -0,0 +1,17 @@ +;;; dashboard.el --- Startup dashboard -*- lexical-binding: t; -*- + +(use-package dashboard + :ensure t + :init + (setq dashboard-startup-banner 'logo + dashboard-center-content t + dashboard-set-heading-icons t + dashboard-set-file-icons t + dashboard-items '((recents . 8) + (projects . 5))) + :config + (dashboard-setup-startup-hook)) + +(provide 'dashboard) + +;;; misc-dashboard.el ends here diff --git a/emacs/.emacs.d/lisp/tools/completion.el b/emacs/.emacs.d/lisp/tools/completion.el index 957e151..413b0ed 100644 --- a/emacs/.emacs.d/lisp/tools/completion.el +++ b/emacs/.emacs.d/lisp/tools/completion.el @@ -35,6 +35,29 @@ (list "~/.emacs.d/snippets") yas-indent-line 'fixed) (yas-global-mode)) +(use-package orderless + :ensure t + :custom + (completion-styles '(orderless basic)) + (completion-category-overrides '((file (styles partial-completion)))) + (completion-pcm-leading-wildcard t) + :config + (setq ivy-re-builders-alist '((t . orderless-ivy-re-builder))) + (add-to-list 'ivy-highlight-functions-alist '(orderless-ivy-re-builder . orderless-ivy-highlight))) + +(defun just-one-face (fn &rest args) + (let ((orderless-match-faces [completions-common-part])) + (apply fn args))) + +(advice-add 'company-capf--candidates :around #'just-one-face) + +(use-package smartparens + :ensure smartparens ;; install the package + :hook (prog-mode text-mode markdown-mode) ;; add `smartparens-mode` to these hooks + :config + ;; load default config + (require 'smartparens-config)) + (provide 'completion) ;;; completion.el ends here diff --git a/emacs/.emacs.d/recentf b/emacs/.emacs.d/recentf new file mode 100644 index 0000000..4f11fba --- /dev/null +++ b/emacs/.emacs.d/recentf @@ -0,0 +1,10 @@ +;;; Automatically generated by ‘recentf’ on Fri Jan 2 14:42:01 2026. + +(setq recentf-list 'nil) + +(setq recentf-filter-changer-current 'nil) + + +;; Local Variables: +;; coding: utf-8-emacs +;; End: