From 52663428184b2f13611bcbdae8431fd9605b1d7e Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 13 Mar 2022 02:43:54 +0800 Subject: Add diminish package (emacs) --- .emacs.d/lisp/init-company.el | 3 +++ .emacs.d/lisp/init-evil.el | 6 +++++- .emacs.d/lisp/init-ivy.el | 3 +++ .emacs.d/lisp/init-misc.el | 7 +++++++ .emacs.d/lisp/init-org.el | 14 +++++++++----- .emacs.d/lisp/init-projectile.el | 3 +++ .emacs.d/lisp/init-utils.el | 5 +++++ 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .emacs.d/lisp/init-utils.el (limited to '.emacs.d/lisp') diff --git a/.emacs.d/lisp/init-company.el b/.emacs.d/lisp/init-company.el index 6fc8cbc..cc83dbd 100644 --- a/.emacs.d/lisp/init-company.el +++ b/.emacs.d/lisp/init-company.el @@ -1,6 +1,9 @@ (when (gx/maybe-require-package 'company) (add-hook 'after-init-hook 'global-company-mode)) +(with-eval-after-load 'company + (gx/diminish 'company-mode)) + (setq company-global-modes '(emacs-lisp-mode go-mode ledger-mode sh-mode c++-mode)) (setq company-minimum-prefix-length 1 diff --git a/.emacs.d/lisp/init-evil.el b/.emacs.d/lisp/init-evil.el index c41296b..5402cd9 100644 --- a/.emacs.d/lisp/init-evil.el +++ b/.emacs.d/lisp/init-evil.el @@ -14,13 +14,17 @@ (kbd "C-【") 'evil-normal-state) (evil-define-key 'normal 'global (kbd "gj") 'evil-next-visual-line - (kbd "gk") 'evil-previous-visual-line)) + (kbd "gk") 'evil-previous-visual-line) + (gx/diminish 'evil-mode)) ;; evil-collection (when (gx/maybe-require-package 'evil-collection) (with-eval-after-load 'evil (evil-collection-init))) +(with-eval-after-load 'evil-collection-unimpaired + (gx/diminish 'evil-collection-unimpaired-mode)) + ;; evil-easymotion (when (gx/maybe-require-package 'evil-easymotion) (with-eval-after-load 'evil diff --git a/.emacs.d/lisp/init-ivy.el b/.emacs.d/lisp/init-ivy.el index 52c92ff..db59481 100644 --- a/.emacs.d/lisp/init-ivy.el +++ b/.emacs.d/lisp/init-ivy.el @@ -1,6 +1,9 @@ (when (gx/maybe-require-package 'counsel) (add-hook 'after-init-hook (lambda () (ivy-mode 1)))) +(with-eval-after-load 'ivy + (gx/diminish 'ivy-mode)) + (with-eval-after-load 'evil (evil-define-key 'normal ivy-mode-map (kbd "fb") 'ivy-switch-buffer diff --git a/.emacs.d/lisp/init-misc.el b/.emacs.d/lisp/init-misc.el index 74037ca..ef79d74 100644 --- a/.emacs.d/lisp/init-misc.el +++ b/.emacs.d/lisp/init-misc.el @@ -43,15 +43,22 @@ (show-paren-mode) (fset 'yes-or-no-p 'y-or-n-p))) +(with-eval-after-load 'hideshow + (gx/diminish 'hs-minor-mode)) + (gx/maybe-require-package 'avy) (gx/maybe-require-package 'rg) (gx/maybe-require-package 'esup) (when (gx/maybe-require-package 'which-key) (add-hook 'after-init-hook 'which-key-mode)) +(with-eval-after-load 'which-key + (gx/diminish 'which-key-mode)) (when (gx/maybe-require-package 'undo-tree) (add-hook 'after-init-hook 'global-undo-tree-mode)) +(with-eval-after-load 'undo-tree + (gx/diminish 'undo-tree-mode)) (setq exec-path-from-shell-arguments '("-l")) (when (gx/maybe-require-package 'exec-path-from-shell) diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el index 591f8b1..81b0935 100644 --- a/.emacs.d/lisp/init-org.el +++ b/.emacs.d/lisp/init-org.el @@ -67,6 +67,9 @@ (setq org-tags-column (- fill-column)) (setq org-agenda-tags-column org-tags-column) +(with-eval-after-load 'org-indent + (gx/diminish 'org-indent-mode)) + ;; todo (setq org-todo-keywords '((sequence "TODO(t)" ; to do later @@ -156,10 +159,10 @@ ;; evil (when (gx/maybe-require-package 'evil-org) (add-hook 'org-mode-hook 'evil-org-mode) - (add-hook 'org-agenda-mode-hook 'evil-org-mode) - (add-hook 'evil-org-mode-hook - (lambda () - (setq evil-want-C-i-jump nil)))) + (add-hook 'org-agenda-mode-hook 'evil-org-mode)) +(add-hook 'evil-org-mode-hook + (lambda () + (setq evil-want-C-i-jump nil))) (with-eval-after-load 'evil (evil-define-key 'motion org-agenda-mode-map (kbd "q") (lambda () @@ -169,7 +172,8 @@ (with-eval-after-load 'evil-org (require 'evil-org-agenda) (evil-org-set-key-theme '(navigation insert textobjects additional calendar todo)) - (evil-org-agenda-set-keys)) + (evil-org-agenda-set-keys) + (gx/diminish 'evil-org-mode)) ;; roam (when (gx/maybe-require-package 'org-roam) diff --git a/.emacs.d/lisp/init-projectile.el b/.emacs.d/lisp/init-projectile.el index f923924..08c1124 100644 --- a/.emacs.d/lisp/init-projectile.el +++ b/.emacs.d/lisp/init-projectile.el @@ -1,6 +1,9 @@ (when (gx/maybe-require-package 'projectile) (add-hook 'after-init-hook (lambda () (projectile-mode 1)))) +(with-eval-after-load 'projectile + (gx/diminish 'projectile-mode)) + (setq projectile-cache-file (expand-file-name ".cache/projectile" user-emacs-directory) projectile-require-project-root nil) diff --git a/.emacs.d/lisp/init-utils.el b/.emacs.d/lisp/init-utils.el new file mode 100644 index 0000000..2f4118c --- /dev/null +++ b/.emacs.d/lisp/init-utils.el @@ -0,0 +1,5 @@ +(defun gx/diminish (mode &optional to-what) + (when (gx/maybe-require-package 'diminish) + (diminish mode to-what))) + +(provide 'init-utils) -- cgit v1.2.3