From 8a0b76fa9de43857e2eb593995422b171c550b56 Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Thu, 12 Sep 2024 19:39:05 +0200 Subject: sorremacs: add corfu for completions and paredit --- pkgs/sorremacs/default.nix | 1 + pkgs/sorremacs/emacs.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'pkgs/sorremacs') diff --git a/pkgs/sorremacs/default.nix b/pkgs/sorremacs/default.nix index eea70f5..05774f5 100644 --- a/pkgs/sorremacs/default.nix +++ b/pkgs/sorremacs/default.nix @@ -9,4 +9,5 @@ emacsWithPackagesFromUsePackage { extraEmacsPackages = epkgs: [ epkgs.cask ]; + } diff --git a/pkgs/sorremacs/emacs.el b/pkgs/sorremacs/emacs.el index e903b10..b24424a 100644 --- a/pkgs/sorremacs/emacs.el +++ b/pkgs/sorremacs/emacs.el @@ -132,6 +132,36 @@ helm-completion-in-region-fuzzy-match t) (helm-mode 1)) +(use-package corfu + :custom + (corfu-cycle t) + (corfu-auto t) ;; Enable auto-completion + + :init + (global-corfu-mode)) + +(use-package emacs + :custom + + ;; Enable indentation+completion using the TAB key. + ;; `completion-at-point' is often bound to M-TAB. + (tab-always-indent 'complete) + + ;; Emacs 30 and newer: Disable Ispell completion function. As an alternative, + ;; try `cape-dict'. + (text-mode-ispell-word-completion nil) + + ;; Emacs 28 and newer: Hide commands in M-x which do not apply to the current + ;; mode. Corfu commands are hidden, since they are not used via M-x. This + ;; setting is useful beyond Corfu. + (read-extended-command-predicate #'command-completion-default-include-p)) + +(use-package paredit + :hook ((emacs-lisp-mode . enable-paredit-mode) + (lisp-mode . enable-paredit-mode) + (lisp-interaction-mode . enable-paredit-mode) + (ielm-mode . enable-paredit-mode))) + ;;; --- Various major modes --- ;;; (use-package nix-mode :mode "\\.nix\\'") -- cgit v1.3.1