mirror of
				https://github.com/larstvei/dot-emacs.git
				synced 2025-11-04 01:20:11 +00:00 
			
		
		
		
	Remove diminish, and use parts of elegant emacs instead
This commit is contained in:
		
							parent
							
								
									e4dc5ed901
								
							
						
					
					
						commit
						98aee32e44
					
				
							
								
								
									
										49
									
								
								init.org
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								init.org
									
									
									
									
									
								
							@ -188,7 +188,6 @@
 | 
				
			|||||||
             company-coq          ; A collection of extensions PG's Coq mode
 | 
					             company-coq          ; A collection of extensions PG's Coq mode
 | 
				
			||||||
             define-word          ; display the definition of word at point
 | 
					             define-word          ; display the definition of word at point
 | 
				
			||||||
             diff-hl              ; Highlight uncommitted changes using VC
 | 
					             diff-hl              ; Highlight uncommitted changes using VC
 | 
				
			||||||
             diminish             ; Diminished modes from modeline
 | 
					 | 
				
			||||||
             doom-themes          ; An opinionated pack of modern color-themes
 | 
					             doom-themes          ; An opinionated pack of modern color-themes
 | 
				
			||||||
             erlang               ; Erlang major mode
 | 
					             erlang               ; Erlang major mode
 | 
				
			||||||
             expand-region        ; Increase selected region by semantic units
 | 
					             expand-region        ; Increase selected region by semantic units
 | 
				
			||||||
@ -416,25 +415,39 @@
 | 
				
			|||||||
          (set-face-attribute 'default nil :font "Inconsolata-14")))
 | 
					          (set-face-attribute 'default nil :font "Inconsolata-14")))
 | 
				
			||||||
   #+END_SRC
 | 
					   #+END_SRC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   [[http://www.eskimo.com/~seldon/diminish.el][diminish.el]] allows you to hide or abbreviate their presence in the
 | 
					   Let's pick out the my favorite elements from [[https://github.com/rougier/elegant-emacs][elegant emacs]]! It looks really
 | 
				
			||||||
   modeline. I rarely look at the modeline to find out what minor-modes are
 | 
					   nice.
 | 
				
			||||||
   enabled, so I disable every global minor-mode, and some for lisp editing.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   To ensure that the mode is loaded before diminish it, we should use
 | 
					 | 
				
			||||||
 ~with-eval-after-load~. To avoid typing this multiple times a small macro
 | 
					 | 
				
			||||||
   is provided.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
   #+BEGIN_SRC emacs-lisp
 | 
					   #+BEGIN_SRC emacs-lisp
 | 
				
			||||||
   (defmacro safe-diminish (file mode &optional new-name)
 | 
					   (add-to-list 'default-frame-alist '(internal-border-width . 24))
 | 
				
			||||||
     `(with-eval-after-load ,file
 | 
					 | 
				
			||||||
        (diminish ,mode ,new-name)))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
   (diminish 'auto-fill-function)
 | 
					   ;; simplified mode line
 | 
				
			||||||
   (safe-diminish "eldoc" 'eldoc-mode)
 | 
					   (define-key mode-line-major-mode-keymap [header-line]
 | 
				
			||||||
   (safe-diminish "flyspell" 'flyspell-mode)
 | 
					     (lookup-key mode-line-major-mode-keymap [mode-line]))
 | 
				
			||||||
   (safe-diminish "helm-mode" 'helm-mode)
 | 
					
 | 
				
			||||||
   (safe-diminish "projectile" 'projectile-mode)
 | 
					   (defun mode-line-render (left right)
 | 
				
			||||||
   (safe-diminish "paredit" 'paredit-mode "()")
 | 
					     (let* ((available-width (- (window-total-width) (length left))))
 | 
				
			||||||
 | 
					       (format (format "%%s %%%ds" available-width) left right)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   (setq-default
 | 
				
			||||||
 | 
					    header-line-format
 | 
				
			||||||
 | 
					    '((:eval
 | 
				
			||||||
 | 
					       (propertize
 | 
				
			||||||
 | 
					        (mode-line-render
 | 
				
			||||||
 | 
					         (format-mode-line
 | 
				
			||||||
 | 
					          (list (propertize "☰" 'face `(:inherit mode-line-buffer-id)
 | 
				
			||||||
 | 
					                            'help-echo "Mode(s) menu"
 | 
				
			||||||
 | 
					                            'mouse-face 'mode-line-highlight
 | 
				
			||||||
 | 
					                            'local-map   mode-line-major-mode-keymap)
 | 
				
			||||||
 | 
					                " %b "
 | 
				
			||||||
 | 
					                (if (and buffer-file-name (buffer-modified-p))
 | 
				
			||||||
 | 
					                    (propertize "(modified)" 'face `(:inherit font-lock-comment-face)))))
 | 
				
			||||||
 | 
					         (format-mode-line
 | 
				
			||||||
 | 
					          (propertize "%4l:%2c  " 'face
 | 
				
			||||||
 | 
					                      `(:inherit font-lock-comment-face))))
 | 
				
			||||||
 | 
					        'face `(:underline ,(face-foreground 'font-lock-comment-face))))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   (setq-default mode-line-format nil)
 | 
				
			||||||
   #+END_SRC
 | 
					   #+END_SRC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat.
 | 
					   New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat.
 | 
				
			||||||
@ -461,7 +474,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
   #+BEGIN_SRC emacs-lisp
 | 
					   #+BEGIN_SRC emacs-lisp
 | 
				
			||||||
   (add-hook 'pdf-view-mode-hook
 | 
					   (add-hook 'pdf-view-mode-hook
 | 
				
			||||||
             (lambda () (setq mode-line-format nil)))
 | 
					             (lambda () (setq header-line-format nil)))
 | 
				
			||||||
   #+END_SRC
 | 
					   #+END_SRC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
** Completion
 | 
					** Completion
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user