(Emacs|Shell|SystemD)~Small changes

This commit is contained in:
2024-05-06 02:23:38 +05:30
parent 04a4f50daf
commit 2986c04c2f
9 changed files with 90 additions and 54 deletions

View File

@@ -158,8 +158,7 @@ integrate it into my workflow just a bit better.
(notmuch-tag-change-list '("-inbox" "+flagged") unflag) beg end) (notmuch-tag-change-list '("-inbox" "+flagged") unflag) beg end)
(when (eq beg end) (when (eq beg end)
(notmuch-search-next-thread))) (notmuch-search-next-thread)))
(advice-add #'notmuch-poll-and-refresh-this-buffer :before
#'+mail/sync-mail)
(advice-add #'notmuch-poll-and-refresh-this-buffer :after (advice-add #'notmuch-poll-and-refresh-this-buffer :after
#'+mail/trash-junk) #'+mail/trash-junk)
(with-eval-after-load "evil-collection" (with-eval-after-load "evil-collection"
@@ -194,7 +193,8 @@ are some corners I'd like to adjust).
:init :init
(setq-default dired-listing-switches "-AFBlu --group-directories-first" (setq-default dired-listing-switches "-AFBlu --group-directories-first"
dired-omit-files "^\\." dired-omit-files "^\\."
dired-dwim-target t) dired-dwim-target t
image-dired-external-viewer "nsxiv")
(with-eval-after-load "evil-collection" (with-eval-after-load "evil-collection"
(evil-collection-dired-setup)) (evil-collection-dired-setup))
:general :general
@@ -443,7 +443,7 @@ Pretty symbols and a display record.
:display :display
("\\*e?shell\\*" ; for general shells as well ("\\*e?shell\\*" ; for general shells as well
(display-buffer-at-bottom) (display-buffer-at-bottom)
(window-height . 0.30))) (window-height . 0.33)))
#+end_src #+end_src
** Eshell variables and aliases ** Eshell variables and aliases
Set some sane defaults, a banner and a prompt. The prompt checks for Set some sane defaults, a banner and a prompt. The prompt checks for

View File

@@ -159,8 +159,8 @@ In [[file:early-init.el][early-init.el]] I set the number of
native-workers to 4, which isn't necessarily optimal when native-workers to 4, which isn't necessarily optimal when
loading/compiling the rest of this file depending on the machine I loading/compiling the rest of this file depending on the machine I
use: use:
- On my laptop (=spiderboy=) I'd prefer to have it use 2-3 threads so I - On my laptop (=spiderboy=) I'd prefer to have it use 2-3 threads so
can actually use the rest of the laptop while waiting for I can actually use the rest of the laptop while waiting for
compilation compilation
- On my desktop (=oldboy=) I'd prefer to use 4-6 threads as I can - On my desktop (=oldboy=) I'd prefer to use 4-6 threads as I can
afford more, so I can get a faster load up. afford more, so I can get a faster load up.
@@ -253,7 +253,7 @@ Set font size to 140 if on my desktop (oldboy) or 175 if on my laptop
:straight nil :straight nil
:config :config
(+oreo/sys-name-cond (+oreo/sys-name-cond
("spiderboy" (set-face-attribute 'default nil :height 175)) ("spiderboy" (set-face-attribute 'default nil :height 145))
("oldboy" (set-face-attribute 'default nil :height 140)))) ("oldboy" (set-face-attribute 'default nil :height 140))))
#+end_src #+end_src
** Startup screen ** Startup screen
@@ -571,7 +571,9 @@ need to use it.
:keymaps 'override :keymaps 'override
"C-s" #'avy-goto-char-timer "C-s" #'avy-goto-char-timer
"M-s" #'isearch-forward "M-s" #'isearch-forward
"gl" #'avy-goto-line)) "gp" #'avy-move-region
"gl" #'avy-goto-line
"gw" #'avy-goto-word-1))
#+end_src #+end_src
** Ace window ** Ace window
Though evil provides a great many features in terms of window Though evil provides a great many features in terms of window
@@ -587,6 +589,16 @@ management of windows (closing, switching, etc).
(nmmap (nmmap
[remap evil-window-next] #'ace-window)) [remap evil-window-next] #'ace-window))
#+end_src #+end_src
** Ace link
Avy-style link following!
#+begin_src emacs-lisp
(use-package ace-link
:straight t
:general
(nmmap
:keymaps 'override
"gL" #'ace-link))
#+end_src
** Helpful ** Helpful
Helpful provides a modernised interface for some common help Helpful provides a modernised interface for some common help
commands. I replace ~describe-function~, ~describe-variable~ and commands. I replace ~describe-function~, ~describe-variable~ and
@@ -667,7 +679,8 @@ thing faster and within Emacs lisp. ~rgrep~ is useful though.
:keymaps 'grep-mode-map :keymaps 'grep-mode-map
"0" #'evil-beginning-of-line "0" #'evil-beginning-of-line
"q" #'quit-window "q" #'quit-window
"i" #'wgrep-change-to-wgrep-mode) "i" #'wgrep-change-to-wgrep-mode
"c" #'recompile)
(nmmap (nmmap
:keymaps 'wgrep-mode-map :keymaps 'wgrep-mode-map
"q" #'evil-record-macro "q" #'evil-record-macro
@@ -681,13 +694,22 @@ thing faster and within Emacs lisp. ~rgrep~ is useful though.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package rg (use-package rg
:after grep :after grep
:display
("^\\*\\*ripgrep\\*\\*"
(display-buffer-at-bottom display-buffer-reuse-window)
(window-height . 0.35)
(reusable-frames . t))
:general :general
(search-leader (search-leader
"R" #'rg) "R" #'rg)
(:keymaps 'rg-mode-map (nmmap
"]]" #'rg-next-file :keymaps 'rg-mode-map
"[[" #'rg-prev-file "c" #'rg-recompile
"q" #'quit-window) "C" #'rg-rerun-toggle-case
"]]" #'rg-next-file
"[[" #'rg-prev-file
"q" #'quit-window
"i" #'wgrep-change-to-wgrep-mode)
:init :init
(setq rg-group-result t (setq rg-group-result t
rg-hide-command t rg-hide-command t
@@ -695,7 +717,9 @@ thing faster and within Emacs lisp. ~rgrep~ is useful though.
rg-show-header t rg-show-header t
rg-custom-type-aliases nil rg-custom-type-aliases nil
rg-default-alias-fallback "all" rg-default-alias-fallback "all"
rg-buffer-name "*ripgrep*")) rg-buffer-name "*ripgrep*")
:config
(evil-set-initial-state 'rg-mode 'normal))
#+end_src #+end_src
*** Searching Lisp config *** Searching Lisp config
Using grep search all the elisp files. With ~wgrep~ this provides Using grep search all the elisp files. With ~wgrep~ this provides
@@ -730,10 +754,12 @@ focus on a buffer.
(mode-leader (mode-leader
"o" #'+olivetti-mode) "o" #'+olivetti-mode)
:init :init
(setq-default olivetti-body-width 0.7) (setq-default olivetti-body-width 0.6)
(setq olivetti-style nil) (setq olivetti-style 'fancy)
(add-hook 'olivetti-mode-on-hook (proc (interactive) (text-scale-increase 1))) (add-hook 'olivetti-mode-on-hook
(add-hook 'olivetti-mode-off-hook (proc (interactive) (text-scale-decrease 1))) (proc (interactive) (text-scale-increase 1)))
(add-hook 'olivetti-mode-off-hook
(proc (interactive) (text-scale-decrease 1)))
:config :config
(defun +olivetti-mode () (defun +olivetti-mode ()
(interactive) (interactive)
@@ -939,12 +965,14 @@ keymaps. Same with dictionary searching.
("\\*Dictionary\\*" ("\\*Dictionary\\*"
(display-buffer-reuse-window display-buffer-same-window) (display-buffer-reuse-window display-buffer-same-window)
(reusable-frames . t)) (reusable-frames . t))
:init
(setq dictionary-server "dict.org")
:general :general
(local-leader (search-leader
:keymaps 'override :infix "w"
"[" #'le-thesaurus-get-synonyms "s" #'le-thesaurus-get-synonyms
"]" #'le-thesaurus-get-antonyms "a" #'le-thesaurus-get-antonyms
"#" #'dictionary-search)) "d" #'dictionary-search))
#+end_src #+end_src
* Programming packages * Programming packages
Packages that help with programming in general, providing IDE like Packages that help with programming in general, providing IDE like
@@ -962,13 +990,19 @@ in the minibuffer. A lot cleaner.
:straight nil :straight nil
:hook (prog-mode-hook . eldoc-mode) :hook (prog-mode-hook . eldoc-mode)
:init :init
(global-eldoc-mode 1)) (global-eldoc-mode 1)
:general
(leader
"h>" #'eldoc-doc-buffer))
(use-package eldoc-box (use-package eldoc-box
:hook (eldoc-mode-hook . eldoc-box-hover-mode) :hook (eldoc-mode-hook . eldoc-box-hover-mode)
:init :init
(setq eldoc-box-position-function #'eldoc-box--default-upper-corner-position-function (setq eldoc-box-position-function #'eldoc-box--default-upper-corner-position-function
eldoc-box-clear-with-C-g t)) eldoc-box-clear-with-C-g t)
:general
(leader
"h." #'eldoc-box-help-at-point))
#+end_src #+end_src
** Flycheck ** Flycheck
Flycheck is the checking system for Emacs. I don't necessarily like Flycheck is the checking system for Emacs. I don't necessarily like
@@ -1047,7 +1081,7 @@ flymake]])
:after (flycheck eglot) :after (flycheck eglot)
:hook (eglot-managed-mode-hook . flycheck-eglot-mode)) :hook (eglot-managed-mode-hook . flycheck-eglot-mode))
#+end_src #+end_src
** Tabs and spaces ** Indentation
By default, turn off tabs and set the tab width to two. By default, turn off tabs and set the tab width to two.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq-default indent-tabs-mode nil (setq-default indent-tabs-mode nil
@@ -1056,7 +1090,7 @@ By default, turn off tabs and set the tab width to two.
However, if necessary later, define a function that may activate tabs locally. However, if necessary later, define a function that may activate tabs locally.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun +oreo/activate-tabs () (defun +oreo/use-tabs ()
(interactive) (interactive)
(setq-local indent-tabs-mode t)) (setq-local indent-tabs-mode t))
#+end_src #+end_src
@@ -1209,9 +1243,10 @@ for latex fragments.
(use-package org (use-package org
:defer t :defer t
:init :init
(setq org-format-latex-options '(:foreground default :background default :scale 2 (setq org-format-latex-options
:html-foreground "Black" :html-background "Transparent" '(:foreground default :background default :scale 2
:html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) :html-foreground "Black" :html-background "Transparent"
:html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
org-latex-src-block-backend 'minted org-latex-src-block-backend 'minted
org-latex-minted-langs '((emacs-lisp "common-lisp") org-latex-minted-langs '((emacs-lisp "common-lisp")
(ledger "text") (ledger "text")
@@ -1221,15 +1256,18 @@ for latex fragments.
(caml "ocaml")) (caml "ocaml"))
org-latex-packages-alist '(("" "minted")) org-latex-packages-alist '(("" "minted"))
org-latex-pdf-process org-latex-pdf-process
'("latexmk -f -bibtex -pdf -shell-escape -%latex -interaction=nonstopmode -output-directory=%o %f") (list (concat "latexmk -f -bibtex -pdf "
org-latex-minted-options '(("style" "colorful") "-shell-escape -%latex -interaction=nonstopmode "
("linenos") "-output-directory=%o %f"))
("frame" "single") org-latex-minted-options
("mathescape") '(("style" "colorful")
("fontfamily" "courier") ("linenos")
("samepage" "false") ("frame" "single")
("breaklines" "true") ("mathescape")
("breakanywhere" "true")))) ("fontfamily" "courier")
("samepage" "false")
("breaklines" "true")
("breakanywhere" "true"))))
#+end_src #+end_src
** Org Core Variables ** Org Core Variables
Tons of variables for org-mode, including a ton of latex ones. Can't Tons of variables for org-mode, including a ton of latex ones. Can't

View File

@@ -110,7 +110,7 @@ code.
(general-evil-setup t)) (general-evil-setup t))
#+end_src #+end_src
** Some binds in Emacs ** Some binds for Emacs
Some bindings that I couldn't fit elsewhere easily. Some bindings that I couldn't fit elsewhere easily.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package emacs (use-package emacs
@@ -126,6 +126,8 @@ Some bindings that I couldn't fit elsewhere easily.
"C-M-l" #'+move/word-forward) "C-M-l" #'+move/word-forward)
(nmmap (nmmap
"M-;" #'eval-expression
"g=" #'align-regexp
"C--" #'text-scale-decrease "C--" #'text-scale-decrease
"C-=" #'text-scale-increase "C-=" #'text-scale-increase
"C-+" #'text-scale-adjust) "C-+" #'text-scale-adjust)
@@ -140,7 +142,7 @@ Some bindings that I couldn't fit elsewhere easily.
"h" '(help-command :which-key "Help")) "h" '(help-command :which-key "Help"))
(mode-leader (mode-leader
"t" #'+oreo/switch-theme) "T" #'+oreo/switch-theme)
(code-leader (code-leader
"F" `(,(proc (interactive) (find-file "~/Code/")) "F" `(,(proc (interactive) (find-file "~/Code/"))

View File

@@ -35,5 +35,5 @@
(push '(menu-bar-lines . 0) default-frame-alist) (push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist) (push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist) (push '(vertical-scroll-bars) default-frame-alist)
(push '(alpha . (85 65)) default-frame-alist) (push '(alpha . (85 80)) default-frame-alist)
(advice-add #'x-apply-session-resources :override #'ignore) (advice-add #'x-apply-session-resources :override #'ignore)

View File

@@ -37,9 +37,8 @@
"Minor mode for haskell buffers generated by haskell-interactive-mode. "Minor mode for haskell buffers generated by haskell-interactive-mode.
Provides bindings to retrieve content back into the REPL with Provides bindings to retrieve content back into the REPL with
full multi-edit commands" full multi-edit commands"
nil :lighter nil
"" :keymap haskell-multiedit-mode-map)
haskell-multiedit-mode-map)
(with-eval-after-load "haskell" (with-eval-after-load "haskell"
(defun haskell-multiedit () (defun haskell-multiedit ()

View File

@@ -37,16 +37,11 @@
;;; Code: ;;; Code:
(defun +move/--normalise-arg (arg)
(if (or (null arg) (< arg 1))
1
arg))
(defmacro +move/create-move (name description &rest body) (defmacro +move/create-move (name description &rest body)
`(defun ,name (&optional arg) `(defun ,name (&optional arg)
,description ,description
(interactive "P") (interactive "P")
(let ((arg (+move/--normalise-arg arg))) (let ((arg (if (or (null arg) (< arg 1)) 1 arg)))
(while (not (= arg 0)) (while (not (= arg 0))
,@body ,@body
(setq arg (- arg 1)))))) (setq arg (- arg 1))))))

View File

@@ -15,7 +15,7 @@ change it for C++.
(("[mM]akefile\\'" . "Makefile skeleton") (("[mM]akefile\\'" . "Makefile skeleton")
"" ""
"CC=gcc "CC=gcc
CFLAGS=-Wall -Wextra -Werror -Wswitch-enum -ggdb -fsanitize=address -std=c11 CFLAGS=-Wall -Wextra -Werror -Wswitch-enum -ggdb -fsanitize=address -fsanitize=undefined -std=c11
LIBS= LIBS=
ARGS= ARGS=

View File

@@ -133,3 +133,5 @@ export SDKMAN_DIR="/home/oreo/.sdkman"
[[ -s "/home/oreo/.sdkman/bin/sdkman-init.sh" ]] && source "/home/oreo/.sdkman/bin/sdkman-init.sh" [[ -s "/home/oreo/.sdkman/bin/sdkman-init.sh" ]] && source "/home/oreo/.sdkman/bin/sdkman-init.sh"
eval $(opam env) eval $(opam env)
[ -f "/home/oreo/.ghcup/env" ] && . "/home/oreo/.ghcup/env" # ghcup-env

View File

@@ -1,9 +1,9 @@
[Unit] [Unit]
Description=Run mail sync every 3 hours Description=Run mail sync every hour
[Timer] [Timer]
OnBootSec=1min OnBootSec=1min
OnUnitActiveSec=10800 OnUnitActiveSec=3600
Unit=mail.service Unit=mail.service
[Install] [Install]