Migrate from elegant emacs to nano emacs

This commit is contained in:
larstvei 2022-09-17 13:06:07 +02:00
parent 9601785e0b
commit b49083213a

View File

@ -208,6 +208,8 @@
maude-mode ; Emacs mode for the programming language Maude maude-mode ; Emacs mode for the programming language Maude
minizinc-mode ; Major mode for MiniZinc code minizinc-mode ; Major mode for MiniZinc code
multiple-cursors ; Multiple cursors for Emacs multiple-cursors ; Multiple cursors for Emacs
nano-modeline ; N Λ N O modeline
nano-theme ; N Λ N O theme
olivetti ; Minor mode for a nice writing environment olivetti ; Minor mode for a nice writing environment
org ; Outline-based notes management and organizer org ; Outline-based notes management and organizer
org-bullets ; Show bullets in org-mode as UTF-8 characters org-bullets ; Show bullets in org-mode as UTF-8 characters
@ -390,19 +392,26 @@
** Visual ** Visual
Change the color-theme to =leuven=. Let's set things with [[https://github.com/rougier/nano-emacs][rougier's N Λ N O Emacs]].
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(load-theme 'doom-one-light t) (setq nano-light-background "#fafafa")
(load-theme 'nano-light t)
(nano-modeline-mode 1)
#+END_SRC #+END_SRC
=leuven= is my preferred light theme, but =monokai= makes a very nice It looks best if we add a small margin around the edges of the frame.
dark theme. I want to be able to cycle between these.
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(internal-border-width . 24))
#+end_src
I want to be able to quickly switch between a light and a dark theme.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun cycle-themes () (defun cycle-themes ()
"Returns a function that lets you cycle your themes." "Returns a function that lets you cycle your themes."
(let ((themes '#1=(doom-one-light doom-one . #1#))) (let ((themes '#1=(nano-light nano-dark . #1#)))
(lambda () (lambda ()
(interactive) (interactive)
;; Rotates the thme cycle and changes the current theme. ;; Rotates the thme cycle and changes the current theme.
@ -410,50 +419,17 @@
(message (concat "Switched to " (symbol-name (car themes))))))) (message (concat "Switched to " (symbol-name (car themes)))))))
#+END_SRC #+END_SRC
Use the [[http://www.levien.com/type/myfonts/inconsolata.html][Inconsolata]] font if it's installed on the system. Pick the first of the following fonts that is installed on the system.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(cond ((member "Hasklig" (font-family-list)) (cond ((member "Roboto Mono" (font-family-list))
(set-face-attribute 'default nil :font "Hasklig-14")) (set-face-attribute 'default nil :font "Roboto Mono-14"))
((member "Fira Code" (font-family-list))
(set-face-attribute 'default nil :font "Fira Code-15"))
((member "Inconsolata" (font-family-list)) ((member "Inconsolata" (font-family-list))
(set-face-attribute 'default nil :font "Inconsolata-14"))) (set-face-attribute 'default nil :font "Inconsolata-14")))
#+END_SRC #+END_SRC
Let's pick out the my favorite elements from [[https://github.com/rougier/elegant-emacs][elegant emacs]]! It looks really
nice.
#+BEGIN_SRC emacs-lisp
(add-to-list 'default-frame-alist '(internal-border-width . 24))
;; simplified mode line
(define-key mode-line-major-mode-keymap [header-line]
(lookup-key mode-line-major-mode-keymap [mode-line]))
(defun mode-line-render (left right)
(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
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.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp