From bd6117c8b40538f7d04d60e0e573db8760cb89ab Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Sun, 18 Apr 2021 19:26:17 +0300 Subject: [PATCH] emacs: steal nice things from tecosaur's config --- README.md | 4 ++- home/.config/doom/config.el | 64 +++++++++++++++++++++++++++++++---- home/.config/doom/packages.el | 5 +++ 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3ee9c1c..4dd11c3 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,9 @@ - [@hlissner](https://github.com/hlissner) for a detailed zsh config (and Doom Emacs) -- [@daviwil](https://github.com/daviwil) for his Emacs streams +- [@daviwil](https://github.com/daviwil)'s Emacs streams + +- [@tecosaur](https://tecosaur.github.io/emacs-config/config.html)'s Emacs configuration - My Waybar config is heavily inspired by [@begs](https://git.sr.ht/~begs/dotfiles) diff --git a/home/.config/doom/config.el b/home/.config/doom/config.el index 3d29f47..60d5519 100644 --- a/home/.config/doom/config.el +++ b/home/.config/doom/config.el @@ -11,9 +11,27 @@ ;; Secrets (setq auth-sources '("~/.config/doom/.authinfo.gpg")) +;; Better default settings +(setq-default + ;; Tab vs space + indent-tabs-mode nil + tab-width 2 + evil-shift-width 2 + standard-indent 2 + line-spacing 2 + ;; From @tecosaur + delete-by-moving-to-trash t + window-combination-resize t + x-stretch-cursor t) +(setq undo-limit 80000000 + evil-want-fine-undo t + auto-save-default t + truncate-string-ellipsis "…") +(global-subword-mode 1) ;; Use CamelCase words + ;; Font settings (setq doom-font (font-spec :family "Iosevka" :size 16) - doom-serif-font (font-spec :family "Iosevka Slab" :size 16) + doom-serif-font (font-spec :family "Iosevka Slab" :size 16 :weight 'light) doom-variable-pitch-font (font-spec :family "Iosevka Aile" :size 16) doom-big-font (font-spec :family "Iosevka" :size 24)) (after! unicode-fonts @@ -59,6 +77,12 @@ (setq doom-modeline-major-mode-icon t doom-modeline-major-mode-color-icon t doom-modeline-unicode-fallback t)) +(custom-set-faces! + '(doom-modeline-buffer-modified :foreground "orange")) + +;; Window split position +(setq evil-vsplit-window-right t + evil-split-window-below t) ;; Emoji (after! emojify @@ -95,12 +119,6 @@ (setq +vc-gutter-default-style nil)) ;; Indent -(setq-default - indent-tabs-mode nil - tab-width 2 - evil-shift-width 2 - standard-indent 2 - line-spacing 2) (after! highlight-indent-guides (setq highlight-indent-guides-method 'character highlight-indent-guides-responsive t)) @@ -119,6 +137,7 @@ projectile-auto-discover nil)) ;; Ivy / Counsel +(setq +ivy-buffer-preview t) (after! counsel (setq counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)) (map! "C-M-j" 'counsel-switch-buffer) @@ -134,6 +153,7 @@ ;; Company (after! company + ;;(add-hook 'evil-normal-state-entry-hook #'company-abort) (setq company-idle-delay 0.5 company-minimum-prefix-length 2 company-show-numbers nil)) @@ -292,6 +312,36 @@ :config (setq tldr-directory-path "~/.local/share/tldr")) +;; Keycast +(use-package! keycast + :commands keycast-mode + :config + (define-minor-mode keycast-mode + "Show current command and its key binding in the mode line." + :global t + (if keycast-mode + (progn + (add-hook 'pre-command-hook 'keycast--update t) + (add-to-list 'global-mode-string '("" mode-line-keycast " "))) + (remove-hook 'pre-command-hook 'keycast--update) + (setq global-mode-string (remove '("" mode-line-keycast " ") global-mode-string)))) + (custom-set-faces! + '(keycast-command :inherit doom-modeline-debug + :height 0.9) + '(keycast-key :inherit custom-modified + :height 1.1 + :weight bold))) + +;; To read big files +(use-package! vlf-setup + :defer-incrementally vlf-tune vlf-base vlf-write vlf-search vlf-occur vlf-follow vlf-ediff vlf) + +;; Nicer page break +(use-package! page-break-lines + :commands page-break-lines-mode + :init + (autoload 'turn-on-page-break-lines-mode "page-break-lines")) + ;; Here are some additional functions/macros that could help you configure Doom: ;; ;; - `load!' for loading external *.el files relative to this one diff --git a/home/.config/doom/packages.el b/home/.config/doom/packages.el index 424e10c..9531bd5 100644 --- a/home/.config/doom/packages.el +++ b/home/.config/doom/packages.el @@ -68,6 +68,11 @@ (package! tldr) (package! lice) (package! license-templates) +(package! keycast) +(package! vlf) +(package! page-break-lines) +;;(package! ox-gfm) +;;(package! gif-screencase) ;;(package! magit-delta) ;;(package! sudoku) ;;(package! mentor)