diff --git a/init.org b/init.org index d219945..70fe5d2 100644 --- a/init.org +++ b/init.org @@ -50,8 +50,8 @@ one to use. ;; ;; it is possible there are more so probably the most recent one is the one to use. - (if emacs-build-time - (setq elpaca-core-date (format-time-string "%Y%m%d" emacs-build-time))) + (when emacs-build-time + (setq elpaca-core-date (format-time-string "%Y%m%d" emacs-build-time))) (defvar elpaca-installer-version 0.8) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) @@ -196,8 +196,6 @@ Needs to load early so the ~:general~ keyword is available for ~use-package~. #+BEGIN_SRC emacs-lisp (use-package general :ensure t :demand t) - - #+END_SRC #+RESULTS: @@ -209,7 +207,6 @@ Needs to load early so the ~:general~ keyword is available for ~use-package~. #+BEGIN_SRC emacs-lisp (elpaca-wait) - #+END_SRC @@ -276,7 +273,6 @@ Ensures UTF-8 is the default coding system everywhere. (setq locale-coding-system 'utf-8) (prefer-coding-system 'utf-8) - ;; Treat clipboard input as UTF-8 string first; compound text next, etc. (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) #+END_SRC @@ -402,7 +398,6 @@ up, which a totally different can of worms). A function (minibuffer . t) (menu-bar-lines . t) ))) - #+END_SRC #+RESULTS: @@ -444,7 +439,6 @@ up, which a totally different can of worms). A function (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt)) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)) - #+END_SRC ** Enable undo-tree @@ -491,7 +485,6 @@ One of the two obvious things to do are to tell Emacs to save all its undo histo undo-limit (* 800 1024) undo-strong-limit (* 12 1024 1024) undo-outer-limit (* 128 1024 1024))) - #+END_SRC #+RESULTS: @@ -507,7 +500,6 @@ In the visualizer you can navigate the undo/redo state with: - M-{ or C- : undo to X where X is a stored register or a branch point - M-} or C- : redo to X where X is a stored register or a branch point - ** Save history over sessions Persist history over Emacs restarts. Vertico sorts by history @@ -519,7 +511,6 @@ position. (savehist-mode)) #+END_SRC - ** Completion Configuration *** Use Vertico for better selection lists @@ -691,63 +682,65 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c #+RESULTS: : [nil 26434 3705 536018 nil elpaca-process-queues nil nil 266000 nil] - ** Evil Vim Keybindings #+BEGIN_SRC emacs-lisp - (setq snm-enable-evil nil) - (if snm-enable-evil - ;; load evil - (use-package evil - :ensure t ;; install the evil package if not installed - :init ;; tweak evil's configuration before loading it - (setq evil-search-module 'evil-search) - (setq evil-ex-complete-emacs-commands nil) - (setq evil-vsplit-window-right t) - (setq evil-split-window-below t) - (setq evil-shift-round nil) - (setq evil-want-C-u-scroll nil) - :config - (evil-mode) - ;; set leader keys - (evil-set-leader nil (kbd "C-SPC")) - (evil-set-leader 'normal (kbd "SPC")) - (evil-set-leader 'normal "," t) ;; set localleader + (when snm-enable-evil + ;; load evil + (use-package evil + :ensure t ;; install the evil package if not installed + :init ;; tweak evil's configuration before loading it + (setq evil-search-module 'evil-search) + (setq evil-ex-complete-emacs-commands nil) + (setq evil-vsplit-window-right t) + (setq evil-split-window-below t) + (setq evil-shift-round nil) + (setq evil-want-C-u-scroll nil) + :config + (evil-mode) + ;; set leader keys + (evil-set-leader nil (kbd "C-SPC")) + (evil-set-leader 'normal (kbd "SPC")) + (evil-set-leader 'normal "," t) ;; set localleader - ;; make vc commands available via leader key - (evil-define-key 'normal 'global - (kbd "v") vc-prefix-map) - (keymap-global-set "C-c v" vc-prefix-map) - ;; make project commands available via leader key - (evil-define-key 'normal 'global - (kbd "p") project-prefix-map) - (keymap-global-set "C-c p" project-prefix-map) + ;; make vc commands available via leader key + (evil-define-key 'normal 'global + (kbd "v") vc-prefix-map) + (keymap-global-set "C-c v" vc-prefix-map) + ;; make project commands available via leader key + (evil-define-key 'normal 'global + (kbd "p") project-prefix-map) + (keymap-global-set "C-c p" project-prefix-map) - (evil-define-key 'normal 'global - (kbd "ff") #'find-file - (kbd "fo") #'recentf - (kbd "fr") #'revert-buffer - (kbd "fd") #'diff-buffer-with-file) - (keymap-global-set "C-c f f" #'find-file) - (keymap-global-set "C-c f o" #'recentf) - (keymap-global-set "C-c f r" #'revert-buffer) - (keymap-global-set "C-c f d" #'diff-buffer-with-file) - )) + (evil-define-key 'normal 'global + (kbd "ff") #'find-file + (kbd "fo") #'recentf + (kbd "fr") #'revert-buffer + (kbd "fd") #'diff-buffer-with-file) + )) +#+END_SRC +** Frequently used File Operations + +#+BEGIN_SRC emacs-lisp + (keymap-global-set "C-c f f" #'find-file) + (keymap-global-set "C-c f o" #'recentf) + (keymap-global-set "C-c f r" #'revert-buffer) + (keymap-global-set "C-c f d" #'diff-buffer-with-file) #+END_SRC ** Load Evil Collection for comprehensive evil support #+BEGIN_SRC emacs-lisp - (if snm-enable-evil - ;; load evil-collection - (use-package evil-collection - :ensure t - :after evil - :init - (evil-collection-init))) + (when snm-enable-evil + ;; load evil-collection + (use-package evil-collection + :ensure t + :after evil + :init + (evil-collection-init))) #+END_SRC ** User Interface @@ -972,7 +965,6 @@ Enables and configures Yasnippet, a template system for Emacs: #+RESULTS: : [nil 26481 25510 926111 nil elpaca-process-queues nil nil 690000 nil] - ** Enable LLM access with Ellama Configures access to language models using Ellama. I don't know whether to put it under writing, comms or programming as it is equally @@ -1136,10 +1128,16 @@ This enables direnv globally. :config (setq prefix-help-command #'embark-prefix-help-command)) + ;; Consult users will also want the embark-consult package. + (use-package embark-consult + :ensure t ; only need to install it, embark loads it after consult if found + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + #+END_SRC #+RESULTS: -: [nil 26482 38660 809617 nil elpaca-process-queues nil nil 672000 nil] +: [nil 26502 58499 164859 nil elpaca-process-queues nil nil 179000 nil] ** Configure Helpful @@ -1222,6 +1220,22 @@ Avy is supported by evil and setup in the *evil-integration* package. #+RESULTS: +** Command Log Mode + +Sometimes it is useful to check what the fingers were up to when some +surprising sequence of events happened. Command Log Mode is a package +that records all the commands that are executed in the buffer and +provides a way to replay them. + +#+BEGIN_SRC emacs-lisp + (use-package command-log-mode + :ensure t + :commands (command-log-mode)) +#+END_SRC + +#+RESULTS: +: [nil 26503 37477 396927 nil elpaca-process-queues nil nil 128000 nil] + * Programming #+BEGIN_SRC emacs-lisp