mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Organize the section on visual stuff
This commit is contained in:
parent
c30e1f28e1
commit
4f5e1d9420
169
init.org
169
init.org
@ -395,104 +395,113 @@
|
|||||||
|
|
||||||
** Visual
|
** Visual
|
||||||
|
|
||||||
I am using a lot from [[https://github.com/rougier/nano-emacs][rougier's N Λ N O Emacs]], starting with the theme. For
|
I am using a lot from [[https://github.com/rougier/nano-emacs][rougier's N Λ N O Emacs]], starting with the theme.
|
||||||
the white theme, I keep the light background toned down a touch.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
*** Theme
|
||||||
(setq nano-light-background "#fafafa")
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
The theme is set according to the system appearance (on macOS) if that is
|
For the light theme, I keep the light background toned down a touch.
|
||||||
available, defaulting to a light theme.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(let* ((variant (if (boundp 'ns-system-appearance) ns-system-appearance 'light))
|
(setq nano-light-background "#fafafa")
|
||||||
(theme (intern (concat "nano-" (symbol-name variant)))))
|
#+END_SRC
|
||||||
(load-theme theme t))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
This is the default setup for [[https://github.com/rougier/nano-modeline][N Λ N O Modeline]] after version 1.0.0:
|
The theme is set according to the system appearance (on macOS) if that is
|
||||||
|
available, defaulting to a light theme.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(require 'nano-modeline)
|
(let* ((variant (if (boundp 'ns-system-appearance) ns-system-appearance 'light))
|
||||||
(add-hook 'prog-mode-hook #'nano-modeline-prog-mode)
|
(theme (intern (concat "nano-" (symbol-name variant)))))
|
||||||
(add-hook 'text-mode-hook #'nano-modeline-text-mode)
|
(load-theme theme t))
|
||||||
(add-hook 'org-mode-hook #'nano-modeline-org-mode)
|
#+END_SRC
|
||||||
(add-hook 'pdf-view-mode-hook #'nano-modeline-pdf-mode)
|
|
||||||
(add-hook 'mu4e-headers-mode-hook #'nano-modeline-mu4e-headers-mode)
|
|
||||||
(add-hook 'mu4e-view-mode-hook #'nano-modeline-mu4e-message-mode)
|
|
||||||
(add-hook 'elfeed-show-mode-hook #'nano-modeline-elfeed-entry-mode)
|
|
||||||
(add-hook 'elfeed-search-mode-hook #'nano-modeline-elfeed-search-mode)
|
|
||||||
(add-hook 'term-mode-hook #'nano-modeline-term-mode)
|
|
||||||
(add-hook 'xwidget-webkit-mode-hook #'nano-modeline-xwidget-mode)
|
|
||||||
(add-hook 'messages-buffer-mode-hook #'nano-modeline-message-mode)
|
|
||||||
(add-hook 'org-capture-mode-hook #'nano-modeline-org-capture-mode)
|
|
||||||
(add-hook 'org-agenda-mode-hook #'nano-modeline-org-agenda-mode)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
We set the ~nano-modeline-text-mode~ as default with:
|
I want to be able to quickly switch between a light and a dark theme.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(nano-modeline-text-mode 1)
|
(defun cycle-themes ()
|
||||||
#+END_SRC
|
"Returns a function that lets you cycle your themes."
|
||||||
|
(let ((themes '(nano-light nano-dark)))
|
||||||
|
(lambda ()
|
||||||
|
(interactive)
|
||||||
|
;; Rotates the thme cycle and changes the current theme.
|
||||||
|
(let ((rotated (nconc (cdr themes) (list (car themes)))))
|
||||||
|
(load-theme (car (setq themes rotated)) t))
|
||||||
|
(message (concat "Switched to " (symbol-name (car themes)))))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
And disable the default modeline.
|
*** Mode line
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
This is the default setup for [[https://github.com/rougier/nano-modeline][N Λ N O Modeline]] after version 1.0.0:
|
||||||
(setq-default mode-line-format nil)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
It looks best if we add a small margin around the edges of the frame.
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(require 'nano-modeline)
|
||||||
|
(add-hook 'prog-mode-hook #'nano-modeline-prog-mode)
|
||||||
|
(add-hook 'text-mode-hook #'nano-modeline-text-mode)
|
||||||
|
(add-hook 'org-mode-hook #'nano-modeline-org-mode)
|
||||||
|
(add-hook 'pdf-view-mode-hook #'nano-modeline-pdf-mode)
|
||||||
|
(add-hook 'mu4e-headers-mode-hook #'nano-modeline-mu4e-headers-mode)
|
||||||
|
(add-hook 'mu4e-view-mode-hook #'nano-modeline-mu4e-message-mode)
|
||||||
|
(add-hook 'elfeed-show-mode-hook #'nano-modeline-elfeed-entry-mode)
|
||||||
|
(add-hook 'elfeed-search-mode-hook #'nano-modeline-elfeed-search-mode)
|
||||||
|
(add-hook 'term-mode-hook #'nano-modeline-term-mode)
|
||||||
|
(add-hook 'xwidget-webkit-mode-hook #'nano-modeline-xwidget-mode)
|
||||||
|
(add-hook 'messages-buffer-mode-hook #'nano-modeline-message-mode)
|
||||||
|
(add-hook 'org-capture-mode-hook #'nano-modeline-org-capture-mode)
|
||||||
|
(add-hook 'org-agenda-mode-hook #'nano-modeline-org-agenda-mode)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
We set the ~nano-modeline-text-mode~ as default with:
|
||||||
(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
|
||||||
|
(nano-modeline-text-mode 1)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
And disable the default modeline.
|
||||||
(defun cycle-themes ()
|
|
||||||
"Returns a function that lets you cycle your themes."
|
|
||||||
(let ((themes '(nano-light nano-dark)))
|
|
||||||
(lambda ()
|
|
||||||
(interactive)
|
|
||||||
;; Rotates the thme cycle and changes the current theme.
|
|
||||||
(let ((rotated (nconc (cdr themes) (list (car themes)))))
|
|
||||||
(load-theme (car (setq themes rotated)) t))
|
|
||||||
(message (concat "Switched to " (symbol-name (car themes)))))))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
Pick the first of the following fonts that is installed on the system.
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq-default mode-line-format nil)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
It looks best if we add a small margin around the edges of the frame.
|
||||||
(cond ((member "Source Code Pro" (font-family-list))
|
|
||||||
(set-face-attribute 'default nil :font "Source Code Pro-15"))
|
|
||||||
((member "Roboto Mono" (font-family-list))
|
|
||||||
(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))
|
|
||||||
(set-face-attribute 'default nil :font "Inconsolata-14")))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat.
|
#+begin_src emacs-lisp
|
||||||
|
(add-to-list 'default-frame-alist '(internal-border-width . 24))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
*** Font
|
||||||
(setq-default prettify-symbols-alist '(("lambda" . ?λ)
|
|
||||||
("delta" . ?Δ)
|
|
||||||
("gamma" . ?Γ)
|
|
||||||
("phi" . ?φ)
|
|
||||||
("psi" . ?ψ)))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
[[https://github.com/rnkn/olivetti][Olivetti]] is a package that simply centers the text of a buffer. It is very
|
Pick the first of the following fonts that is installed on the system.
|
||||||
simple and beautiful. The default width is just a bit short.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(with-eval-after-load 'olivetti
|
(cond ((member "Source Code Pro" (font-family-list))
|
||||||
(setq-default olivetti-body-width (+ fill-column 3))
|
(set-face-attribute 'default nil :font "Source Code Pro-15"))
|
||||||
(remove-hook 'olivetti-mode-on-hook 'visual-line-mode))
|
((member "Roboto Mono" (font-family-list))
|
||||||
#+END_SRC
|
(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))
|
||||||
|
(set-face-attribute 'default nil :font "Inconsolata-14")))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq-default prettify-symbols-alist '(("lambda" . ?λ)
|
||||||
|
("delta" . ?Δ)
|
||||||
|
("gamma" . ?Γ)
|
||||||
|
("phi" . ?φ)
|
||||||
|
("psi" . ?ψ)))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
*** Centering with Olivetti
|
||||||
|
|
||||||
|
[[https://github.com/rnkn/olivetti][Olivetti]] is a package that simply centers the text of a buffer. It is very
|
||||||
|
simple and beautiful. The default width is just a bit short.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(with-eval-after-load 'olivetti
|
||||||
|
(setq-default olivetti-body-width (+ fill-column 3))
|
||||||
|
(remove-hook 'olivetti-mode-on-hook 'visual-line-mode))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Dashboard
|
** Dashboard
|
||||||
|
|
||||||
@ -1075,7 +1084,7 @@
|
|||||||
** Python
|
** Python
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq python-shell-interpreter "python3")
|
(setq python-shell-interpreter "python3.10")
|
||||||
(add-hook 'python-mode-hook
|
(add-hook 'python-mode-hook
|
||||||
(lambda () (setq forward-sexp-function nil)))
|
(lambda () (setq forward-sexp-function nil)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
Loading…
Reference in New Issue
Block a user