(Emacs/config)~Some minor changes

This commit is contained in:
2024-07-03 04:27:21 +01:00
parent ea232f3110
commit 04977729c2

View File

@@ -7,6 +7,7 @@
#+latex_header:\usepackage[margin=1.0in]{geometry} #+latex_header:\usepackage[margin=1.0in]{geometry}
#+latex_class: article #+latex_class: article
#+latex_class_options: [a4paper,12pt] #+latex_class_options: [a4paper,12pt]
* Introduction * Introduction
:PROPERTIES: :PROPERTIES:
:header-args:emacs-lisp: :tangle config.el :results none :header-args:emacs-lisp: :tangle config.el :results none
@@ -77,7 +78,7 @@ Let's setup a few things:
save-buffer-coding-system 'utf-8-unix save-buffer-coding-system 'utf-8-unix
backup-directory-alist `(("." . ,(no-littering-expand-var-file-name "saves/"))) backup-directory-alist `(("." . ,(no-littering-expand-var-file-name "saves/")))
global-auto-revert-non-file-buffers t global-auto-revert-non-file-buffers t
auto-revert-verbose t auto-revert-verbose nil
auto-revert-use-notify nil auto-revert-use-notify nil
select-enable-clipboard t) select-enable-clipboard t)
:config :config
@@ -185,7 +186,6 @@ essentially a copy of the solarized theme (from the ~solarized-themes~
package) with a few personal changes. package) with a few personal changes.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package custom (use-package custom
:demand t
:init :init
(setq custom-theme-directory (concat user-emacs-directory "elisp/")) (setq custom-theme-directory (concat user-emacs-directory "elisp/"))
:config :config
@@ -313,44 +313,40 @@ the first character of the evil state capitalised"
0 1)) 0 1))
""))) "")))
(setq better-mode-line/left-segment ;; LEFT SEGMENT (setq better-mode-line/left-segment
'(" " '(" "
(:eval (:eval
(when (mode-line-window-selected-p) (when (mode-line-window-selected-p)
'("%l:%c" ;; Line and column count '("%l:%c" ;; Line and column count
" " " "
"%p" ;; Percentage into buffer "%p" ;; Percentage into buffer
("[" ;; Evil state ("[" ;; Evil state
(:eval (:eval
(+mode-line/evil-state)) (+mode-line/evil-state))
"]"))))) "]")
better-mode-line/centre-segment ;; CENTRE SEGMENT ))))
'("%+" ;; Buffer state (changed or not) better-mode-line/centre-segment
"%b" ;; Buffer name '("%+" ;; Buffer state (changed or not)
("(" ;; Major mode "%b" ;; Buffer name
("(" ;; Major mode
(:eval (format "%s" major-mode)) (:eval (format "%s" major-mode))
")") ")")
" " " ")
"%I" ;; Buffer size (in bytes) better-mode-line/right-segment
) '((:eval
better-mode-line/right-segment ;; RIGHT SEGMENT (when (mode-line-window-selected-p)
'(:eval (if (project-current) ;; Name of current project (if any)
(when (mode-line-window-selected-p) (concat
'((:eval (if (project-current) ;; Name of current project (if any) (project-name (project-current))
(concat (project-name " "
(project-current)) vc-mode ;; Git branch
vc-mode) ;; ... with git branch ))))
"")) mode-line-misc-info ;; Any other information
(:eval ;; LSP information (:eval ;; Compilation mode errors
(with-eval-after-load "eglot" (if (eq major-mode 'compilation-mode)
(if eglot--managed-mode compilation-mode-line-errors))
(concat " " ;; Extra padding
" " ))
(eglot--mode-line-format)))))
mode-line-misc-info ;; Any other information
" "
)))
)
:config :config
(better-mode-line/setup-mode-line)) (better-mode-line/setup-mode-line))
#+end_src #+end_src
@@ -568,8 +564,8 @@ Setup the evil package, with some opinionated keybindings:
can... can...
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil (use-package evil
:demand t
:straight t :straight t
:demand t
:general :general
(leader (leader
"w" '(evil-window-map :which-key "Window") "w" '(evil-window-map :which-key "Window")
@@ -713,8 +709,8 @@ Setup vim-like bindings for the minibuffer ("M-(j|k)" for down|up the
selection list). selection list).
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ivy (use-package ivy
:demand t
:straight t :straight t
:demand t
:general :general
(general-def (general-def
:keymaps 'ivy-minibuffer-map :keymaps 'ivy-minibuffer-map
@@ -794,7 +790,7 @@ looking for a command.
:straight t :straight t
:defer 2 :defer 2
:init :init
(setq amx-backend 'ivy) (setq amx-backend 'auto)
:config :config
(amx-mode)) (amx-mode))
#+end_src #+end_src
@@ -806,6 +802,9 @@ things ever.
:straight t :straight t
:after (ivy ido) :after (ivy ido)
:config :config
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion))))
(setf (alist-get t ivy-re-builders-alist) 'orderless-ivy-re-builder)) (setf (alist-get t ivy-re-builders-alist) 'orderless-ivy-re-builder))
#+end_src #+end_src
*** Completions-list *** Completions-list
@@ -3700,7 +3699,7 @@ Here I just setup Sly to use ~sbcl~.
("mapcar" . "")) ("mapcar" . ""))
:general :general
(:states '(normal motion visual) (:states '(normal motion visual)
:keymaps '(emacs-lisp-mode-map lisp-mode-map) :keymaps '(emacs-lisp-mode-map lisp-mode-map lisp-interaction-mode-map)
")" #'sp-next-sexp ")" #'sp-next-sexp
"(" #'sp-previous-sexp) "(" #'sp-previous-sexp)
(nmmap (nmmap