2024-02-15 08:18:41 +00:00
#+title : UI Config
#+author : Evie Litherland-Smith
#+email : evie@xenia.me.uk
#+filetags : :emacs:config:org:
2024-02-15 08:45:37 +00:00
#+property : header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(setq use-dialog-box nil
2024-03-01 11:03:22 +00:00
minibuffer-follows-selected-frame nil
2024-02-15 08:18:41 +00:00
truncate-lines nil
truncate-partial-width-windows nil)
(menu-bar-mode +1)
(global-prettify-symbols-mode +1)
(global-display-line-numbers-mode -1)
(tool-bar-mode -1)
(add-hook 'prog-mode-hook #'(lambda () (display-line-numbers-mode +1)))
(use-package which-key
:ensure t
:diminish
:config (which-key-mode +1))
(use-package page-break-lines
:ensure t
:diminish
:config (global-page-break-lines-mode +1))
2024-02-15 13:52:07 +00:00
(electric-pair-mode +1)
(show-paren-mode +1)
2024-02-15 08:18:41 +00:00
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
#+end_src
2024-02-15 12:01:36 +00:00
* Theme, font and nerd-icons
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(add-to-list 'initial-frame-alist '(width . 120))
(add-to-list 'initial-frame-alist '(height . 80))
2024-02-29 15:22:00 +00:00
#+end_src
** catppuccin-theme
#+begin_src emacs-lisp
(use-package catppuccin-theme
:ensure t
:demand
:custom
(catppuccin-flavour 'mocha)
(catppuccin-italic-blockquotes t)
(catppuccin-italic-comments t)
2024-03-01 18:02:35 +00:00
(catppuccin-italic-variables nil)
2024-02-29 15:22:00 +00:00
:config
(load-theme 'catppuccin t))
#+end_src
** modus-vivendi-tinted
Removed in favour of [[https://github.com/catppuccin/emacs ][Catppuccin (emacs) ]] theme, keeping here for the config options though in case I want to use it again for anything.
#+begin_src emacs-lisp
2024-02-15 08:18:41 +00:00
;; Theme
(use-package modus-themes
2024-02-29 15:22:00 +00:00
:disabled t
2024-02-15 08:18:41 +00:00
:custom
(modus-themes-disable-other-themes t)
2024-02-29 10:32:07 +00:00
(modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted))
2024-02-15 08:18:41 +00:00
(modus-themes-bold-constructs t)
(modus-themes-italic-constructs t)
(modus-themes-org-blocks nil)
(modus-themes-completions '((matches . (extrabold underline))
(selection . (semibold italic))))
(modus-themes-headings '((1 . (1.4))
(2 . (1.3))
(3 . (1.2))
(agenda-date . (1.3))
(agenda-structure . (light 1.8))
(t . (1.1))))
:config
2024-02-29 10:32:07 +00:00
(modus-themes-load-theme 'modus-vivendi-tinted))
2024-02-29 15:22:00 +00:00
#+end_src
** nerd-icons
#+begin_src emacs-lisp
2024-02-15 08:18:41 +00:00
(use-package nerd-icons
:ensure t
:diminish
:config (nerd-icons-set-font "Symbols Nerd Font Mono-12"))
(use-package nerd-icons-dired
:ensure t
:after nerd-icons
:diminish
:hook (dired-mode))
(use-package nerd-icons-ibuffer
:ensure t
:after nerd-icons
:diminish
:hook (ibuffer-mode))
(use-package nerd-icons-completion
:ensure t
:after nerd-icons
:diminish
:config (nerd-icons-completion-mode +1))
(use-package nerd-icons-corfu
:ensure t
:after (corfu nerd-icons)
:diminish
:config (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(keymap-global-set "C-c i n" #'nerd-icons-insert)
#+end_src
2024-02-15 12:01:36 +00:00
** Font ligatures
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(use-package ligature
:ensure t
:diminish
:config
(ligature-set-ligatures
'(text-mode prog-mode org-mode)
2024-03-02 12:56:12 +00:00
'("-<<" "-<" "-<-" "<--" "<---" "<<-" "<-" "- >" "->>" "-->" "--->" "->-" ">-" ">>-"
"=<<" "= <" "=<= " "<==" "<= ==" "<<= " "<=" "= >" "=>>" "= =>" "= ==>" "= >=" ">= " ">>="
"<- >" "<-- >" "<--- >" "<---- >" "<= >" "<== >" "<=== >" "<==== >" "::" ":::" "__"
"<~~" "</" "</>" "/>" "~ ~>" "==" "!=" "/=" "~ =" "<>" "= ==" "!= =" "!= ==" "= /=" "= !="
"<:" ":=" "*= " "*+" "<* " "<* >" "*>" "<|" "<|>" "|>" "<." "<.>" ".>" "+* " "=*" "= :" ":>"
"(*" "* )" "/*" "*/ " "[|" "|]" "{|" "|}" "++" "+ ++" "\\/" "/ \\" "|-" "-|" "<!--" "<!---"))
2024-02-15 08:18:41 +00:00
(global-ligature-mode +1))
#+end_src
2024-02-15 13:52:07 +00:00
** Whitespace mode
#+begin_src emacs-lisp
(use-package whitespace
:init
(global-whitespace-mode +1)
:custom
(whitespace-style '(face
empty
trailing
tab-mark
indentation::space))
(whitespace-action '(report-on-bogus
cleanup
auto-cleanup)))
#+end_src
2024-02-15 12:01:36 +00:00
* Window management
2024-03-07 15:45:20 +00:00
#+begin_src emacs-lisp
(setq split-height-threshold nil
2024-03-07 16:22:39 +00:00
split-width-threshold 120)
2024-03-07 15:45:20 +00:00
#+end_src
2024-02-15 12:01:36 +00:00
** windmove
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(use-package windmove
:ensure t
:demand
:diminish
:config (windmove-mode +1)
:bind (("C-c w k" . windmove-up)
("C-c w C-k" . windmove-display-up)
("C-c w K" . windmove-swap-states-up)
("C-c w j" . windmove-down)
("C-c w C-j" . windmove-display-down)
("C-c w J" . windmove-swap-states-down)
("C-c w h" . windmove-left)
("C-c w C-h" . windmove-display-left)
("C-c w H" . windmove-swap-states-left)
("C-c w l" . windmove-right)
("C-c w C-l" . windmove-display-right)
("C-c w L" . windmove-swap-states-right)))
#+end_src
2024-02-15 12:01:36 +00:00
** winner
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(use-package winner
:ensure t
:demand
:diminish
:bind (("C-c w u" . winner-undo)
("C-c w r" . winner-redo))
:config
(winner-mode))
#+end_src
2024-02-15 12:01:36 +00:00
** ediff
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp :tangle yes
(use-package ediff
:ensure t
:diminish
:bind (("C-c d f" . ediff-files)
("C-c d b" . ediff-buffers)
("C-c d 3 f" . ediff-files3)
("C-c d 3 b" . ediff-buffers3))
:custom
(ediff-window-setup-function #'ediff-setup-windows-plain))
#+end_src
2024-02-15 12:01:36 +00:00
* Notifications
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(use-package alert
:ensure t
:diminish
:custom
(alert-default-style 'libnotify))
#+end_src
2024-02-15 12:01:36 +00:00
* Modeline
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(line-number-mode -1)
(column-number-mode -1)
(size-indication-mode -1)
(display-battery-mode -1)
(display-time-mode -1)
(setq mode-line-compact 'long)
#+end_src
2024-02-29 14:37:49 +00:00
** doom-modeline
#+begin_src emacs-lisp
(use-package doom-modeline
:ensure t
2024-02-29 15:35:44 +00:00
:demand
2024-02-29 14:37:49 +00:00
:custom
(doom-modeline-checker-simple-format nil)
(doom-modeline-enable-word-count t)
2024-03-07 11:00:49 +00:00
(doom-modeline-env-version t)
2024-02-29 14:37:49 +00:00
(doom-modeline-github nil)
(doom-modeline-gnus t)
2024-03-07 11:00:49 +00:00
(doom-modeline-mu4e nil) ; Built-in implementation looks nicer
2024-02-29 14:37:49 +00:00
(doom-modeline-icon t)
(doom-modeline-irc t)
(doom-modeline-lsp t)
(doom-modeline-project-detection 'project)
(doom-modeline-continuous-word-count-modes '(org-mode
markdown-mode
gfm-mode))
:config
2024-02-29 15:35:44 +00:00
(doom-modeline-mode +1))
2024-02-29 14:37:49 +00:00
#+end_src
2024-03-13 16:58:52 +00:00
* Battery state for laptops
#+begin_src emacs-lisp
(require 'battery)
(when (and battery-status-function
(not ( string-match-p "unknown"
( battery-format "%B"
(funcall battery-status-function)))))
(display-battery-mode +1))
#+end_src
2024-02-15 12:01:36 +00:00
* Zone
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp :tangle yes
(use-package zone
:ensure t
:diminish
2024-02-17 09:43:36 +00:00
:config (zone-when-idle (* 60 60))) ; 1 hour
2024-02-15 08:18:41 +00:00
#+end_src
2024-02-15 12:01:36 +00:00
* Git status in fringe
2024-02-15 08:18:41 +00:00
#+begin_src emacs-lisp
(use-package diff-hl
:ensure t
:diminish
:init
(add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh)
:config
(global-diff-hl-mode)
:custom
(diff-hl-disable-on-remote t)
(diff-hl-draw-borders nil))
#+end_src