08/09 commit
This commit is contained in:
parent
44aacc124c
commit
3d73ac99f6
5 changed files with 222 additions and 111 deletions
|
|
@ -1,9 +1,10 @@
|
|||
#+TITLE: Hane's GNU Emacs Config
|
||||
#+AUTHOR: Hane
|
||||
#+DESCRIPTION: Hane's personal Emacs config made with love by Haibane <3.
|
||||
#+DESCRIPTION: Hane's personal Emacs config made with love alongside Haibane <3.
|
||||
#+STARTUP: showeverything
|
||||
#+OPTIONS: toc:2
|
||||
* TABLE OF CONTENTS :toc:
|
||||
- [[#Hot reload][Hot reload]]
|
||||
- [[#load-first][LOAD FIRST]]
|
||||
- [[#startup-time][Startup Time]]
|
||||
- [[#package-management][Package management]]
|
||||
|
|
@ -69,6 +70,23 @@
|
|||
- [[#yeetube][Yeetube]]
|
||||
- [[#dired][dired]]
|
||||
- [[#marginalia][Marginalia]]
|
||||
|
||||
* Hot reload
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun reload-config ()
|
||||
"Run a shell command asynchronously."
|
||||
(interactive)
|
||||
(org-babel-load-file
|
||||
(expand-file-name
|
||||
"config.org"
|
||||
user-emacs-directory)))
|
||||
#+end_src
|
||||
|
||||
* Always follow symlinks
|
||||
#+begin_src emacs-lisp
|
||||
(setq vc-follow-symlinks t)
|
||||
#+end_src
|
||||
* LOAD FIRST
|
||||
|
||||
** Startup Time
|
||||
|
|
@ -130,21 +148,29 @@
|
|||
|
||||
** Dashboard
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dashboard
|
||||
:ensure t
|
||||
:config
|
||||
(dashboard-setup-startup-hook)
|
||||
;;Logo image
|
||||
(setq dashboard-startup-banner (cons "~/.emacs.d/logo.jpg" "~/.emacs.d/logo.txt"))
|
||||
;; Content is not centered by default. To center, set
|
||||
(setq dashboard-center-content t)
|
||||
;; vertically center content
|
||||
(setq dashboard-vertically-center-content nil))
|
||||
|
||||
(setq initial-buffer-choice 'dashboard-open)
|
||||
(defun no-line-numbers-mode ()
|
||||
(display-line-numbers-mode 0))
|
||||
|
||||
(use-package dashboard
|
||||
:ensure t
|
||||
:config
|
||||
;;Logo image
|
||||
(setq dashboard-startup-banner (cons "~/.emacs.d/logo.jpg" "~/.emacs.d/logo.txt"))
|
||||
;; Content is not centered by default. To center, set
|
||||
(setq dashboard-center-content t)
|
||||
(setq dashboard-center-content t)
|
||||
(setq dashboard-image-banner-max-height 350)
|
||||
(setq dashboard-image-banner-max-width 350)
|
||||
;; vertically center content
|
||||
(setq dashboard-vertically-center-content nil)
|
||||
(add-hook 'dashboard-mode-hook 'no-line-numbers-mode)
|
||||
(dashboard-setup-startup-hook))
|
||||
|
||||
(add-hook 'server-after-make-frame-hook 'dashboard-open)
|
||||
#+end_src
|
||||
|
||||
**
|
||||
|
||||
** Line wrap and line number
|
||||
#+begin_src emacs-lisp
|
||||
(global-visual-line-mode t)
|
||||
|
|
@ -168,6 +194,7 @@ Nice font try it
|
|||
** Startup screen
|
||||
#+begin_src emacs-lisp
|
||||
(setq inhibit-startup-screen t)
|
||||
(setq initial-buffer-choice nil)
|
||||
#+end_src
|
||||
|
||||
** Themes
|
||||
|
|
@ -187,89 +214,91 @@ I look down on for not using modus-vivendi-tinted
|
|||
|
||||
*** Modus
|
||||
#+begin_src emacs-lisp
|
||||
(use-package modus-themes
|
||||
:after ef-themes
|
||||
:ensure nil
|
||||
:demand t
|
||||
:init
|
||||
;; Starting with version 5.0.0 of the `modus-themes', other packages
|
||||
;; can be built on top to provide their own "Modus" derivatives.
|
||||
;; For example, this is what I do with my `ef-themes' and
|
||||
;; `standard-themes' (starting with versions 2.0.0 and 3.0.0,
|
||||
;; respectively).
|
||||
;;
|
||||
;; The `modus-themes-include-derivatives-mode' makes all Modus
|
||||
;; commands that act on a theme consider all such derivatives, if
|
||||
;; their respective packages are available and have been loaded.
|
||||
;;
|
||||
;; Note that those packages can even completely take over from the
|
||||
;; Modus themes such that, for example, `modus-themes-rotate' only
|
||||
;; goes through the Ef themes (to this end, the Ef themes provide
|
||||
;; the `ef-themes-take-over-modus-themes-mode' and the Standard
|
||||
;; themes have the `standard-themes-take-over-modus-themes-mode'
|
||||
;; equivalent).
|
||||
;;
|
||||
;; If you only care about the Modus themes, then (i) you do not need
|
||||
;; to enable the `modus-themes-include-derivatives-mode' and (ii) do
|
||||
;; not install and activate those other theme packages.
|
||||
(modus-themes-include-derivatives-mode 1)
|
||||
:bind
|
||||
(("<f5>" . modus-themes-load-random-dark)
|
||||
("C-<f5>" . modus-themes-select)
|
||||
("M-<f5>" . modus-themes-load-random-light))
|
||||
:config
|
||||
;; Your customizations here:
|
||||
(setq modus-themes-to-toggle '(modus-operandi modus-vivendi)
|
||||
modus-themes-to-rotate modus-themes-items
|
||||
modus-themes-mixed-fonts t
|
||||
modus-themes-variable-pitch-ui t
|
||||
modus-themes-italic-constructs t
|
||||
modus-themes-bold-constructs t
|
||||
modus-themes-completions '((t . (bold)))
|
||||
modus-themes-prompts '(bold)
|
||||
modus-themes-headings
|
||||
'((agenda-structure . (variable-pitch light 2.2))
|
||||
(agenda-date . (variable-pitch regular 1.3))
|
||||
(t . (regular 1.15))))
|
||||
(use-package modus-themes
|
||||
:after ef-themes
|
||||
:ensure nil
|
||||
:defer t
|
||||
;; :demand t
|
||||
:init
|
||||
;; Starting with version 5.0.0 of the `modus-themes', other packages
|
||||
;; can be built on top to provide their own "Modus" derivatives.
|
||||
;; For example, this is what I do with my `ef-themes' and
|
||||
;; `standard-themes' (starting with versions 2.0.0 and 3.0.0,
|
||||
;; respectively).
|
||||
;;
|
||||
;; The `modus-themes-include-derivatives-mode' makes all Modus
|
||||
;; commands that act on a theme consider all such derivatives, if
|
||||
;; their respective packages are available and have been loaded.
|
||||
;;
|
||||
;; Note that those packages can even completely take over from the
|
||||
;; Modus themes such that, for example, `modus-themes-rotate' only
|
||||
;; goes through the Ef themes (to this end, the Ef themes provide
|
||||
;; the `ef-themes-take-over-modus-themes-mode' and the Standard
|
||||
;; themes have the `standard-themes-take-over-modus-themes-mode'
|
||||
;; equivalent).
|
||||
;;
|
||||
;; If you only care about the Modus themes, then (i) you do not need
|
||||
;; to enable the `modus-themes-include-derivatives-mode' and (ii) do
|
||||
;; not install and activate those other theme packages.
|
||||
(modus-themes-include-derivatives-mode 1)
|
||||
:bind
|
||||
;;(("<f5>" . modus-themes-load-random-dark)
|
||||
;; ("C-<f5>" . modus-themes-select)
|
||||
;; ("M-<f5>" . modus-themes-load-random-light))
|
||||
:config
|
||||
;; Your customizations here:
|
||||
(setq modus-themes-to-toggle '(modus-operandi modus-vivendi)
|
||||
modus-themes-to-rotate modus-themes-items
|
||||
modus-themes-mixed-fonts t
|
||||
modus-themes-variable-pitch-ui t
|
||||
modus-themes-italic-constructs t
|
||||
modus-themes-bold-constructs t
|
||||
modus-themes-completions '((t . (bold)))
|
||||
modus-themes-prompts '(bold)
|
||||
modus-themes-headings
|
||||
'((agenda-structure . (variable-pitch light 2.2))
|
||||
(agenda-date . (variable-pitch regular 1.3))
|
||||
(t . (regular 1.15))))
|
||||
|
||||
(setq modus-themes-common-palette-overrides nil)
|
||||
(setq modus-themes-common-palette-overrides nil)
|
||||
|
||||
;; Finally, load your theme of choice (or a random one with
|
||||
;; `modus-themes-load-random', `modus-themes-load-random-dark',
|
||||
;; `modus-themes-load-random-light').
|
||||
;; (modus-themes-load-theme 'modus-operandi)
|
||||
;; (modus-themes-load-random-dark)
|
||||
)
|
||||
;; Finally, load your theme of choice (or a random one with
|
||||
;; `modus-themes-load-random', `modus-themes-load-random-dark',
|
||||
;; `modus-themes-load-random-light').
|
||||
;; (modus-themes-load-theme 'modus-operandi)
|
||||
;; (modus-themes-load-random-dark)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
**** ef-themes
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ef-themes
|
||||
:defer nil
|
||||
:ensure t
|
||||
:init
|
||||
;; This makes the Modus commands listed below consider only the Ef
|
||||
;; themes. For an alternative that includes Modus and all
|
||||
;; derivative themes (like Ef), enable the
|
||||
;; `modus-themes-include-derivatives-mode' instead. The manual of
|
||||
;; the Ef themes has a section that explains all the possibilities:
|
||||
;;
|
||||
;; - Evaluate `(info "(ef-themes) Working with other Modus themes or taking over Modus")'
|
||||
;; - Visit <https://protesilaos.com/emacs/ef-themes#h:6585235a-5219-4f78-9dd5-6a64d87d1b6e>
|
||||
(ef-themes-take-over-modus-themes-mode 1)
|
||||
:config
|
||||
;; All customisations here.
|
||||
(setq modus-themes-mixed-fonts t)
|
||||
(setq modus-themes-italic-constructs t)
|
||||
(use-package ef-themes
|
||||
:defer t
|
||||
:ensure t
|
||||
:init
|
||||
;; This makes the Modus commands listed below consider only the Ef
|
||||
;; themes. For an alternative that includes Modus and all
|
||||
;; derivative themes (like Ef), enable the
|
||||
;; `modus-themes-include-derivatives-mode' instead. The manual of
|
||||
;; the Ef themes has a section that explains all the possibilities:
|
||||
;;
|
||||
;; - Evaluate `(info "(ef-themes) Working with other Modus themes or taking over Modus")'
|
||||
;; - Visit <https://protesilaos.com/emacs/ef-themes#h:6585235a-5219-4f78-9dd5-6a64d87d1b6e>
|
||||
(ef-themes-take-over-modus-themes-mode 1)
|
||||
:config
|
||||
;; All customisations here.
|
||||
(setq modus-themes-mixed-fonts t)
|
||||
(setq modus-themes-italic-constructs t)
|
||||
|
||||
;; Finally, load your theme of choice (or a random one with
|
||||
;; `modus-themes-load-random', `modus-themes-load-random-dark',
|
||||
;; `modus-themes-load-random-light').
|
||||
;;(modus-themes-load-theme 'ef-day)
|
||||
;;(modus-themes-load-theme 'ef-kassio)
|
||||
(modus-themes-load-theme 'ef-summer)
|
||||
;;(modus-themes-load-theme 'ef-tritanopia-light)
|
||||
)
|
||||
;; Finally, load your theme of choice (or a random one with
|
||||
;; `modus-themes-load-random', `modus-themes-load-random-dark',
|
||||
;; `modus-themes-load-random-light').
|
||||
;;(modus-themes-load-theme 'ef-day)
|
||||
;;(modus-themes-load-theme 'ef-kassio)
|
||||
;;(modus-themes-load-theme 'ef-tritanopia-light)
|
||||
)
|
||||
|
||||
(modus-themes-load-theme 'ef-summer)
|
||||
#+end_src
|
||||
|
||||
** Selection overwrite
|
||||
|
|
@ -769,29 +798,89 @@ install hunspell for spell checking to work
|
|||
#+end_src
|
||||
* Dokuwiki
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dokuwiki
|
||||
:defer t
|
||||
:custom
|
||||
(dokuwiki-xml-rpc-url "https://wiki.roboces.dev/lib/exe/xmlrpc.php")
|
||||
(dokuwiki-login-user-name "superuser"))
|
||||
(use-package dokuwiki
|
||||
:defer t
|
||||
:custom
|
||||
(dokuwiki-xml-rpc-url "https://wiki.roboces.dev/lib/exe/xmlrpc.php")
|
||||
(dokuwiki-login-user-name "hane"))
|
||||
|
||||
(defun dokuwiki-custom-open (page)
|
||||
"Auto dokuwiki-mode buffer created by dokuwiki-open"
|
||||
(interactive "sPage to open: ")
|
||||
(dokuwiki-open-page page)
|
||||
(switch-to-buffer (concat page ".dwiki"))
|
||||
(dokuwiki-mode))
|
||||
#+end_src
|
||||
|
||||
** Dokuwiki Mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dokuwiki-mode
|
||||
:after dokuwiki)
|
||||
(use-package dokuwiki-mode
|
||||
:after dokuwiki
|
||||
:config
|
||||
(add-to-list 'auto-mode-alist '("\\.dwiki\\'" . dokuwiki-mode)))
|
||||
|
||||
(defun dokuwiki-code-tag (b e)
|
||||
"simple wrapper"
|
||||
(interactive "r")
|
||||
(save-restriction
|
||||
(narrow-to-region b e)
|
||||
(goto-char (point-min))
|
||||
(insert "<code>")
|
||||
(goto-char (point-max))
|
||||
(insert "</code>")))
|
||||
|
||||
(defun dokuwiki-code-inline-tag (b e)
|
||||
"simple wrapper"
|
||||
(interactive "r")
|
||||
(save-restriction
|
||||
(narrow-to-region b e)
|
||||
(goto-char (point-min))
|
||||
(insert "''%%")
|
||||
(goto-char (point-max))
|
||||
(insert "%%''")))
|
||||
|
||||
(eval-after-load "dokuwiki-mode"
|
||||
'(progn
|
||||
(define-key dokuwiki-mode-map (kbd "C-c C-w") 'dokuwiki-code-inline-tag)
|
||||
(define-key dokuwiki-mode-map (kbd "C-c C-e") 'dokuwiki-code-tag)
|
||||
))
|
||||
|
||||
;; (append '(let ((map (make-sparse-keymap)))
|
||||
;; (define-key dokuwiki-mode-map )
|
||||
;; map) 'dokuwiki-mode-map)
|
||||
#+end_src
|
||||
* ETC
|
||||
Deferred builtin package loads and confing fn calls alongside various variables
|
||||
#+begin_src emacs-lisp
|
||||
(setq back-directory-alist '(("." . "~/.config/emacs/backups/"))) ;; so you dont get backup files ending with ~ in the same folder as the file NOTE:maybe there is a way to use the $EMACSDIR instead of Specifying it here
|
||||
(setq use-dialog-box nil) ;; Don't pop up UI dialogs when prompting
|
||||
(global-auto-revert-mode 1) ;; Revert buffers when the underlying file has changed
|
||||
(setq global-auto-revert-non-file-buffers t ) ;; Revert Dired and other buffers
|
||||
(context-menu-mode 1) ;; right click menu
|
||||
(xterm-mouse-mode 1) ;; mouse support in the terminal
|
||||
(setq echo-keystrokes 0.001) ;; make keybinds appear faster after the echo area however overwritten by which-key-idle-delay
|
||||
;; (global-subword-mode 1) ;; for SubWords!!
|
||||
(auto-save-visited-mode 1) ;; read the documentation to get the behavior you want to be exact both auto-save-visited-interval and auto-save-visited-predicate
|
||||
(use-package autorevert
|
||||
:defer t
|
||||
:config
|
||||
(global-auto-revert-mode 1) ;; Revert buffers when the underlying file has changed
|
||||
:custom
|
||||
(global-auto-revert-non-file-buffers t));; Revert Dired and other buffers
|
||||
|
||||
;;(use-package mouse
|
||||
;; :defer t
|
||||
;; :config
|
||||
(context-menu-mode 1)
|
||||
;;);; right click menu
|
||||
|
||||
(use-package xt-mouse
|
||||
:defer t
|
||||
:config
|
||||
(xterm-mouse-mode 1)) ;; mouse support in the terminal
|
||||
|
||||
;;(use-package files
|
||||
;; :defer t
|
||||
;;:config
|
||||
(auto-save-visited-mode 1)
|
||||
;;) ;; read the documentation to get the behavior you want to be exact both auto-save-visited-interval and auto-save-visited-predicate
|
||||
|
||||
|
||||
(setq back-directory-alist '(("." . "~/.config/emacs/backups/"))) ;; so you dont get backup files ending with ~ in the same folder as the file NOTE:maybe there is a way to use the $EMACSDIR instead of Specifying it here
|
||||
(setq use-dialog-box nil) ;; Don't pop up UI dialogs when prompting
|
||||
(setq echo-keystrokes 0.001) ;; make keybinds appear faster after the echo area however overwritten by which-key-idle-delay
|
||||
;; (global-subword-mode 1) ;; for SubWords!!
|
||||
#+end_src
|
||||
|
||||
* Custom file
|
||||
|
|
@ -843,6 +932,7 @@ bind repeat to a better key
|
|||
|
||||
;; Map inverse transpose
|
||||
(define-key map (kbd "C-S-t") (lambda () (interactive) (transpose-chars -1)))
|
||||
(define-key map (kbd "M-S-t") (lambda () (interactive) (transpose-words -1)))
|
||||
|
||||
;; Use regex search tools
|
||||
(define-key map (kbd "C-s") 'isearch-forward-regexp)
|
||||
|
|
@ -852,7 +942,7 @@ bind repeat to a better key
|
|||
(define-key map (kbd "C-z") 'kill-whole-line)
|
||||
|
||||
;;Function key shenanigans
|
||||
(define-key map [f5] 'eval-buffer)
|
||||
(define-key map [f5] 'reload-config)
|
||||
(define-key map [f6] 'comment-region)
|
||||
(define-key map [f9] (lambda () (interactive) (find-file user-init-file)) )
|
||||
(define-key map [f8] 'projectile-find-file)
|
||||
|
|
@ -886,6 +976,10 @@ bind repeat to a better key
|
|||
(define-key map (kbd "C-c n") 'previous-buffer)
|
||||
(define-key map (kbd "C-c m") 'next-buffer)
|
||||
|
||||
;; Maximize/minimize window
|
||||
(define-key map (kbd "C-c r") 'maximize-window)
|
||||
(define-key map (kbd "C-c R") 'minimize-window)
|
||||
|
||||
;; On-home-row point movement
|
||||
;; (define-key map (kbd "C-; j") 'next-line)
|
||||
;; (define-key map (kbd "C-; l") 'previous-line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue