From 0465cc52e16e8b634922a22d4ae153120282fb67 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 13 Nov 2022 12:56:40 +0300 Subject: [PATCH] Doom modeline, centaur tabs, leader consult bindings, F# --- .emacs.bankruptcy/init.org | 96 +++++++++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 28 deletions(-) diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index f67097c..0a02f02 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -243,15 +243,31 @@ Setup other stuff (setq inhibit-startup-screen t) +;; Don’t compact font caches during GC, in case doom modeline gets laggy issue +(setq inhibit-compacting-font-caches t) + (straight-use-package 'ligature) (global-ligature-mode) (straight-use-package 'highlight-quoted) (add-hook 'emacs-lisp-mode-hook 'highlight-quoted-mode) -(straight-use-package 'nano-modeline) -(nano-modeline-mode) -(setq nano-modeline-prefix 'icon) +;; (straight-use-package 'nano-modeline) +;; (nano-modeline-mode) +;; (setq nano-modeline-prefix 'icon) +;; (straight-use-package 'mini-modeline) +(straight-use-package 'doom-modeline) +(doom-modeline-mode) +;; (straight-use-package 'mood-line) +;; (mood-line-mode 1) +(straight-use-package 'centaur-tabs) +(setq centaur-tabs-set-bar 'under) +;; Note: If you're not using Spacmeacs, in order for the underline to display +;; correctly you must add the following line: +(setq x-underline-at-descent-line t) +(setq centaur-tabs-set-close-button t) +(setq centaur-tabs-show-navigation-buttons t) + #+end_src ** Text @@ -727,7 +743,12 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i (straight-use-package 'undo-fu-session) (straight-use-package 'vundo) (global-undo-fu-session-mode) + (setq undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'")) + +(setq undo-limit 6710886400) ;; 64mb. +(setq undo-strong-limit 100663296) ;; 96mb. +(setq undo-outer-limit 1006632960) ;; 960mb. #+end_src ** Text Editor @@ -799,38 +820,48 @@ Emacs is an great operating system, if only it had a good text editor... (evil-define-key 'normal 'global (kbd "hg") 'helpful-at-point) (evil-define-key 'normal 'global (kbd "fb") 'bookmark-jump) (evil-define-key 'normal 'global (kbd "fr") 'consult-recent-file) -(evil-define-key 'normal 'global (kbd "ff") 'ffip) +(evil-define-key 'normal 'global (kbd "ff") 'project-find-file) (evil-define-key 'normal 'global (kbd "fi") 'joe/edit-init) (evil-define-key 'normal 'global (kbd "bl") 'mode-line-other-buffer) -(evil-define-key 'normal 'global (kbd "bb") 'switch-to-buffer) +(evil-define-key 'normal 'global (kbd "ba") 'consult-buffer) +(evil-define-key 'normal 'global (kbd "bb") 'consult-project-buffer) (evil-define-key 'normal 'global (kbd "bi") 'ibuffer) (evil-define-key 'normal 'global (kbd "bm") 'joe/toggle-buffer-mode) (evil-define-key 'normal 'global (kbd "br") 'joe/revert-buffer-no-confirm) -(evil-define-key 'normal 'global (kbd "bk") 'kill-this-buffer) (evil-define-key 'normal 'global (kbd "gg") 'magit-status) (evil-define-key 'normal 'global (kbd "gc") 'magit-clone) -(evil-define-key 'normal 'global (kbd "pi") 'package-install) -(evil-define-key 'normal 'global (kbd "pd") 'package-delete) -(evil-define-key 'normal 'global (kbd "pf") 'package-refresh-contents) -(evil-define-key 'normal 'global (kbd "pl") 'package-list-packages) -(evil-define-key 'normal 'global (kbd "pr") 'package-reinstall) (evil-define-key 'normal 'global (kbd "ss") 'joe/vterm-here) (evil-define-key 'normal 'global (kbd "sv") 'vterm) (evil-define-key 'normal 'global (kbd "tv") 'vterm-other-window) (evil-define-key 'normal 'global (kbd "Ba") 'joe/bookmark-set-and-save) (evil-define-key 'normal 'global (kbd "Bd") 'bookmark-delete) -(evil-define-key 'normal 'global (kbd "cr") 'joe/compile-run) -(evil-define-key 'normal 'global (kbd "cc") 'joe/compile-comp) +(evil-define-key 'normal 'global (kbd "mr") 'joe/compile-run) +(evil-define-key 'normal 'global (kbd "mc") 'joe/compile-comp) (evil-define-key 'normal 'global (kbd "ct") 'consult-theme) +(evil-define-key 'normal 'global (kbd "cl") 'consult-line) +(evil-define-key 'normal 'global (kbd "ci") 'consult-imenu) +(evil-define-key 'normal 'global (kbd "cy") 'consult-yank-from-kill-ring) +(evil-define-key 'normal 'global (kbd "cg") 'consult-ripgrep) +(evil-define-key 'normal 'global (kbd "cF") 'consult-find) +(evil-define-key 'normal 'global (kbd "co") 'consult-outline) (evil-define-key 'normal 'global (kbd "C-h") 'evil-window-left) (evil-define-key 'normal 'global (kbd "C-j") 'evil-window-down) (evil-define-key 'normal 'global (kbd "C-k") 'evil-window-up) (evil-define-key 'normal 'global (kbd "C-l") 'evil-window-right) -(evil-define-key 'normal 'global (kbd "M-h") 'tab-previous) -(evil-define-key 'normal 'global (kbd "M-l") 'tab-next) +(evil-define-key 'normal 'global (kbd "C-p") 'tab-previous) +(evil-define-key 'normal 'global (kbd "C-n") 'tab-next) (evil-define-key 'normal 'global (kbd "tn") 'tab-new) (evil-define-key 'normal 'global (kbd "tc") 'tab-close) +(evil-define-key 'normal 'global (kbd "tr") 'tab-rename) + +(evil-define-key 'normal 'global (kbd "q") 'avy-goto-word-0) + +;; (define-prefix-command 'evil-consult-map) +;; (define-key evil-consult-map "b" 'evil-window-bottom-right) +;; (define-key evil-consult-map "c" 'evil-window-delete) + +;; (define-key evil-normal-state-map "," 'evil-consult-map) (defvar global-evil-leader-map (make-sparse-keymap)) (evil-define-key 'normal 'global-evil-leader-map (kbd "SPC") 'evil-send-leader) @@ -866,17 +897,18 @@ Emacs is an great operating system, if only it had a good text editor... (setq which-key-idle-delay 0.3) (add-hook 'after-init-hook (lambda () (which-key-mode))) -;; (which-key-add-keymap-based-replacements evil-normal-state-map -;; "f" '("Files") -;; "b" '("Buffers") -;; "B" '("Bookmarks") -;; "c" '("Compile") -;; "d" '("Dired") -;; "g" '("Git") -;; "t" '("Tabs") -;; "p" '("Packages") -;; "s" '("Shell (vterm)") -;; "h" '("Help")) +(which-key-add-keymap-based-replacements evil-normal-state-map + "f" '("Files") + "b" '("Buffers") + "B" '("Bookmarks") + "c" '("Consult") + "d" '("Dired") + "g" '("Git") + "m" '("Make") + "t" '("Tabs") + "p" '("Packages") + "s" '("Shell (vterm)") + "h" '("Help")) #+end_src ** IDE Features @@ -885,9 +917,10 @@ Emacs is an great operating system, if only it had a good text editor... #+begin_src emacs-lisp ;; (straight-use-package 'yasnippet) (straight-use-package 'markdown-mode) -(straight-use-package 'lsp-mode) +;; (straight-use-package 'lsp-mode) -(setq lsp-keymap-prefix "C-c c") + +;; (setq lsp-keymap-prefix "C-c c") ;; (lsp-enable-which-key-integration t) ;; (require 'lsp) ;; (straight-use-package 'eglot) @@ -1012,6 +1045,13 @@ it doesn't close it. #+begin_src emacs-lisp (straight-use-package 'go-mode) ;; (straight-use-package 'go-imports) +#+end_src +*** FSharp +#+begin_src emacs-lisp +;; (straight-use-package 'eglot) +(straight-use-package 'fsharp-mode) +;; (straight-use-package 'eglot-fsharp) + #+end_src ** Magit