aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-03-13 02:43:54 +0800
committerGuangxiong Lin <[email protected]>2022-03-13 02:43:54 +0800
commit52663428184b2f13611bcbdae8431fd9605b1d7e (patch)
tree111f3ad8721267d827c1b3abe83e1fe4ab87d8f7
parent1957e46551dfd1acfcd53fec17fd9630304a11db (diff)
downloaddotfiles-52663428184b2f13611bcbdae8431fd9605b1d7e.tar.gz
dotfiles-52663428184b2f13611bcbdae8431fd9605b1d7e.tar.bz2
dotfiles-52663428184b2f13611bcbdae8431fd9605b1d7e.zip
Add diminish package (emacs)
-rw-r--r--.emacs.d/init.el1
-rw-r--r--.emacs.d/lisp/init-company.el3
-rw-r--r--.emacs.d/lisp/init-evil.el6
-rw-r--r--.emacs.d/lisp/init-ivy.el3
-rw-r--r--.emacs.d/lisp/init-misc.el7
-rw-r--r--.emacs.d/lisp/init-org.el14
-rw-r--r--.emacs.d/lisp/init-projectile.el3
-rw-r--r--.emacs.d/lisp/init-utils.el5
8 files changed, 36 insertions, 6 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 559b598..21e5d01 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -14,6 +14,7 @@
(defconst *is-a-linux* (eq system-type 'gnu/linux))
(require 'init-package)
+(require 'init-utils)
(require 'init-evil)
(require 'init-ivy)
(require 'init-company)
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 "<leader>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)