diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index 6ace6c2..4435c89 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -108,13 +108,30 @@ need to benchmark slow init times later. ** Misc Stuff #+begin_SRC emacs-lisp +(setq default-directory "/home/joe/") (setq vc-follow-symlinks t) ; Visit real file when editing a symlink without prompting. (global-auto-revert-mode t) ; Revert buffer's file when the file changes on disk ;; (setq confirm-kill-emacs 'y-or-n-p) +#+end_src + +Don't let emacs add customised settings to init.el, which in our case is worse since we have a +literate file. + +#+begin_src emacs-lisp +(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) +#+end_src + +This avoids those annoying *#backup#* files that get added and eventually slow down loading the file again. + +#+begin_src emacs-lisp +(setq auto-save-default nil) +(setq create-lockfiles nil) +#+end_src + +#+begin_src emacs-lisp (setq use-dialog-box nil) (fset 'yes-or-no-p 'y-or-n-p) - (setq large-file-warning-threshold 100000000) (setq backup-directory-alist `((".*" . ,(expand-file-name "backups" user-emacs-directory)))) (setq backup-by-copying t @@ -129,12 +146,16 @@ Use Dashboard.el. First load `all-the-icons` for nicer rendering #+begin_src emacs-lisp (straight-use-package 'all-the-icons) (straight-use-package 'dashboard) +(require 'dashboard) (dashboard-setup-startup-hook) (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) +(setq dashboard-items '((recents . 8) + (bookmarks . 8))) (setq dashboard-startup-banner 'logo) (setq dashboard-center-content t) (setq dashboard-set-file-icons t) +(setq dashboard-set-navigator t) (setq dashboard-set-heading-icons t) (add-hook 'dashboard-mode-hook (lambda () (setq-local line-spacing 12))) #+end_src @@ -204,17 +225,17 @@ Setup other stuff ** Org Mode #+begin_src emacs-lisp +(straight-use-package 'org-bullets) (eval-after-load 'org (lambda () (setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG"))) (setq org-agenda-files '("~/todo.org")) - (straight-use-package 'org-bullets) - (org-bullets-mode) - (org-indent-mode) - (require 'org-tempo) (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) (setq org-edit-src-content-indentation 0))) +(add-hook 'org-mode-hook (defun joe/org-hook () + (org-bullets-mode) + (org-indent-mode)) #+end_src ** VEMCO (Vertico Embark Marginalia Consult Orderless) @@ -257,7 +278,7 @@ Setup other stuff "Use `exa' to generate directory preview." :require ("exa") ; tell Dirvish to check if we have the executable (when (file-directory-p file) ; we only interest in directories here - `(shell . ("exa" "--color=always" "-al" ,file)))) ; use the command output as preview + `(shell . ("exa" "-H" "--icons" "--color=always" "--no-user" "-al" "--group-directories-first" ,file)))) (add-to-list 'dirvish-preview-dispatchers 'exa) (setq dired-listing-switches "-l --almost-all --human-readable --time-style=long-iso --group-directories-first --no-group") (setq dirvish-preview-dispatchers (cl-substitute 'pdf-preface 'pdf dirvish-preview-dispatchers)) @@ -280,12 +301,52 @@ Setup other stuff (setq undo-tree-visualizer-diff t) (setq undo-tree-history-directory-alist `(("." . ,(expand-file-name "undo" user-emacs-directory)))) #+end_src +** Which Key +#+begin_src emacs-lisp +(straight-use-package 'which-key) +(setq which-key-idle-delay 0.3) +(which-key-mode) +#+end_src ** Text Editor Emacs is an amazing operating system, if only it had a good text editor... -Meow +*** Hydra +#+begin_src emacs-lisp +(require 'view) +(straight-use-package 'hydra) +(require 'hydra) +(defhydra hydra-zoom (global-map "") + "Window Manipulation" + ("g" text-scale-increase "in") + ("l" text-scale-decrease "out") + ("d" View-scroll-half-page-forward "half page down") + ("u" View-scroll-half-page-backward "half page up") + ("y" View-scroll-line-forward "line down") + ("e" View-scroll-line-backward "line up") +) +#+end_src +*** Avy +#+begin_src emacs-lisp +(straight-use-package 'avy) +(setq avy-case-fold-search nil) ;; case sensitive makes selection easier +(define-key global-map (kbd "C-;") 'avy-goto-char-2) ;; I use this most frequently +(define-key global-map (kbd "C-'") 'avy-goto-line) ;; Consistent with ivy-avy +(define-key global-map (kbd "M-g c") 'avy-goto-char) +(define-key global-map (kbd "M-g e") 'avy-goto-word-0) ;; lots of candidates +(define-key global-map (kbd "M-g g") 'avy-goto-line) ;; digits behave like goto-line +(define-key global-map (kbd "M-g w") 'avy-goto-word-1) ;; first character of the word +(define-key global-map (kbd "M-g (") 'avy-goto-open-paren) +(define-key global-map (kbd "M-g )") 'avy-goto-close-paren) +(define-key global-map (kbd "M-g P") 'avy-pop-mark) +#+end_src +*** Multiple Cursors +#+begin_src emacs-lisp +(straight-use-package 'multiple-cursors) +#+end_src + +*** Meow #+begin_src emacs-lisp :tangle no (straight-use-package 'meow) (require 'meow) @@ -378,16 +439,63 @@ Meow (meow-global-mode t) #+end_src -Boon -#+begin_src emacs-lisp -(straight-use-package boon) +*** Boon +#+begin_src emacs-lisp :tangle no +(straight-use-package 'boon) +(require 'boon-qwerty) +(boon-mode) #+end_src + +*** Kakoune.el + +#+begin_src emacs-lisp :tangle no +(straight-use-package 'kakoune) +(require 'kakoune) +(defun ryo-enter () "Enter normal mode" (interactive) (ryo-modal-mode 1)) +(defun my/kakoune-setup () + "Call kakoune-setup-keybinds and then add some personal config." + (kakoune-setup-keybinds) + (setq ryo-modal-cursor-type 'box) + (add-hook 'prog-mode-hook #'ryo-enter) + (define-key ryo-modal-mode-map (kbd "SPC h") 'help-command) + ;; Access all C-x bindings easily + (define-key ryo-modal-mode-map (kbd "z") ctl-x-map) + (ryo-modal-keys + ("," save-buffer) + ("P" counsel-yank-pop) + ("m" mc/mark-next-like-this) + ("M" mc/skip-to-next-like-this) + ("n" mc/mark-previous-like-this) + ("N" mc/skip-to-previous-like-this) + ("M-m" mc/edit-lines) + ("*" mc/mark-all-like-this) + ("v" er/expand-region) + ("C-v" set-rectangular-region-anchor) + ("M-s" mc/split-region) + (";" (("q" delete-window) + ("v" split-window-horizontally) + ("s" split-window-vertically))) + ("C-h" windmove-left) + ("C-j" windmove-down) + ("C-k" windmove-up) + ("C-l" windmove-right) + ("C-u" scroll-down-command :first '(deactivate-mark)) + ("C-d" scroll-up-command :first '(deactivate-mark)))) +(add-hook 'after-init-hook 'my/kakoune-setup) + +#+end_src + ** Magit + +The best git porcelain/client I've ever used + #+begin_src emacs-lisp (straight-use-package 'magit) #+end_src + ** Finish up + #+begin_src emacs-lisp #+end_src