From 25eee02381ef00c7a6c9aedafea0c32b9e9a7c60 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Sun, 18 Sep 2022 18:03:26 -0700 Subject: [PATCH] Custom emacs config v0.01 --- TODO.org | 2 + thoom-emacs/.gitignore | 6 ++ thoom-emacs/early-init.el | 2 + thoom-emacs/init.el | 142 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 thoom-emacs/.gitignore create mode 100644 thoom-emacs/early-init.el create mode 100644 thoom-emacs/init.el diff --git a/TODO.org b/TODO.org index bd91390..36441f3 100644 --- a/TODO.org +++ b/TODO.org @@ -15,6 +15,8 @@ figure out interactions with Doom ** configure evil-surround to not put spaces in ** Fira Code glyphs in vterm https://www.reddit.com/r/DoomEmacs/comments/qqqbon/wrong_icons_in_the_vterm/ +** Emacs everywhere +https://github.com/tecosaur/emacs-everywhere * Kitty ** Cheatsheet popup shortcuts *** fzf -> tldr diff --git a/thoom-emacs/.gitignore b/thoom-emacs/.gitignore new file mode 100644 index 0000000..2141eca --- /dev/null +++ b/thoom-emacs/.gitignore @@ -0,0 +1,6 @@ +auto-save-list +recentf +eln-cache +straight +history +*~ diff --git a/thoom-emacs/early-init.el b/thoom-emacs/early-init.el new file mode 100644 index 0000000..384d208 --- /dev/null +++ b/thoom-emacs/early-init.el @@ -0,0 +1,2 @@ +;; Disable package.el in favor of straight.el +(setq package-enable-at-startup nil) diff --git a/thoom-emacs/init.el b/thoom-emacs/init.el new file mode 100644 index 0000000..d7248fb --- /dev/null +++ b/thoom-emacs/init.el @@ -0,0 +1,142 @@ +;; Install straight.el +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 6)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + +(setq inhibit-startup-message t + use-dialog-box nil) + + +(setq custom-file (locate-user-emacs-file "custom-vars.el")) +(load custom-file 'noerror 'nomessage) + +;; Revert buffers when the underlying file has changed +(global-auto-revert-mode 1) +(setq global-auto-revert-non-file-buffers t) + +;; Remember recent files +(recentf-mode 1) +;; TODO - bind recentf-open-files + +;; Save what you enter into minibuffer prompts +(setq history-length 25) +(savehist-mode 1) + + +(straight-use-package + '(nano-emacs :type git :host github :repo "rougier/nano-emacs")) + +(require 'nano-layout) +(require 'nano-theme-dark) +(require 'nano-faces) +(require 'nano-theme) +(require 'nano-modeline) +(require 'nano-defaults) + +(nano-faces) +(nano-theme) + +(hl-line-mode 1) + + +(straight-use-package 'meow) +(defun meow-setup () + (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty) + (meow-motion-overwrite-define-key + '("j" . meow-next) + '("k" . meow-prev) + '("" . ignore)) + (meow-leader-define-key + ;; SPC j/k will run the original command in MOTION state. + '("j" . "H-j") + '("k" . "H-k") + ;; Use SPC (0-9) for digit arguments. + '("1" . meow-digit-argument) + '("2" . meow-digit-argument) + '("3" . meow-digit-argument) + '("4" . meow-digit-argument) + '("5" . meow-digit-argument) + '("6" . meow-digit-argument) + '("7" . meow-digit-argument) + '("8" . meow-digit-argument) + '("9" . meow-digit-argument) + '("0" . meow-digit-argument) + '("/" . meow-keypad-describe-key) + '("?" . meow-cheatsheet)) + (meow-normal-define-key + '("0" . meow-expand-0) + '("9" . meow-expand-9) + '("8" . meow-expand-8) + '("7" . meow-expand-7) + '("6" . meow-expand-6) + '("5" . meow-expand-5) + '("4" . meow-expand-4) + '("3" . meow-expand-3) + '("2" . meow-expand-2) + '("1" . meow-expand-1) + '("-" . negative-argument) + '(";" . meow-reverse) + '("," . meow-inner-of-thing) + '("." . meow-bounds-of-thing) + '("[" . meow-beginning-of-thing) + '("]" . meow-end-of-thing) + '("a" . meow-append) + '("A" . meow-open-below) + '("b" . meow-back-word) + '("B" . meow-back-symbol) + '("c" . meow-change) + '("d" . meow-delete) + '("D" . meow-backward-delete) + '("e" . meow-next-word) + '("E" . meow-next-symbol) + '("f" . meow-find) + '("g" . meow-cancel-selection) + '("G" . meow-grab) + '("h" . meow-left) + '("H" . meow-left-expand) + '("i" . meow-insert) + '("I" . meow-open-above) + '("j" . meow-next) + '("J" . meow-next-expand) + '("k" . meow-prev) + '("K" . meow-prev-expand) + '("l" . meow-right) + '("L" . meow-right-expand) + '("m" . meow-join) + '("n" . meow-search) + '("o" . meow-block) + '("O" . meow-to-block) + '("p" . meow-yank) + '("q" . meow-quit) + '("Q" . meow-goto-line) + '("r" . meow-replace) + '("R" . meow-swap-grab) + '("s" . meow-kill) + '("t" . meow-till) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-visit) + '("w" . meow-mark-word) + '("W" . meow-mark-symbol) + '("x" . meow-line) + '("X" . meow-goto-line) + '("y" . meow-save) + '("Y" . meow-sync-grab) + '("z" . meow-pop-selection) + '("'" . repeat) + '("" . ignore) + '("C-[" . ignore)) +(require 'meow) +(meow-setup) +(meow-global-mode 1) + +;; TODO - make C-[ work as ESC for exiting insert mode