adding nyxt tricks

This commit is contained in:
Chris Cochrun 2021-09-25 07:00:55 -05:00
parent 03525d6c78
commit ede21c8cd9
2 changed files with 93 additions and 59 deletions

View file

@ -105,8 +105,8 @@ In order to have this config work on both my desktop with regular joe-schmoe mon
"Set the frame to be transparent on Wayland compositors" "Set the frame to be transparent on Wayland compositors"
(if (string-search "wayland" x-display-name) (if (string-search "wayland" x-display-name)
'((set-frame-parameter (selected-frame) 'alpha '(100 . 100)) '((set-frame-parameter (selected-frame) 'alpha '(100 . 100))
(set-frame-parameter (selected-frame) 'undecorated t) (set-frame-parameter (selected-frame) 'undecorated nil)
(add-to-list 'default-frame-alist '(undecorated . t)) (add-to-list 'default-frame-alist '(undecorated . nil))
(add-to-list 'default-frame-alist '(alpha . (100 . 100))) (add-to-list 'default-frame-alist '(alpha . (100 . 100)))
(add-to-list 'initial-frame-alist '(alpha . (100 . 100))) (add-to-list 'initial-frame-alist '(alpha . (100 . 100)))
(add-to-list 'initial-frame-alist '(undecorated . t))))) (add-to-list 'initial-frame-alist '(undecorated . t)))))
@ -1611,7 +1611,8 @@ If on a:
:query "mime:image/*" :query "mime:image/*"
:key 112))) :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu") (setq mu4e-mu-binary "/usr/bin/mu"
mu4e-view-prefer-html nil)
(setq mu4e-use-fancy-chars t (setq mu4e-use-fancy-chars t
mu4e-headers-draft-mark '("D" . "") mu4e-headers-draft-mark '("D" . "")
mu4e-headers-flagged-mark '("F" . "") mu4e-headers-flagged-mark '("F" . "")
@ -1640,8 +1641,17 @@ If on a:
(toggle-truncate-lines +1) (toggle-truncate-lines +1)
(display-line-numbers-mode -1)) (display-line-numbers-mode -1))
(defun chris/setup-mu4e-view ()
(display-line-numbers-mode -1)
(setq visual-fill-column-center-text t)
(setq visual-fill-column-width 100)
(visual-fill-column-mode +1))
(remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1))
(add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers)
(add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view)
(mu4e t) (mu4e t)
:general :general
@ -1869,7 +1879,14 @@ Let's add our own eshell prompt. and set the password cache to a significantly h
Using sly makes a lot better common-lisp interaction within emacs. Using sly makes a lot better common-lisp interaction within emacs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package sly (use-package sly
:mode ("\\.lisp\\'" . sly-mode)) :mode
("\\.lisp\\'" . sly-mode)
("\\.lisp\\'" . lisp-mode)
:config
(defun chris/start-nyxt-repl ()
"Start the repl and sly connection for nyxt"
(interactive)
(sly-connect "localhost" 4006)))
#+end_src #+end_src
** PDF-Tools ** PDF-Tools

127
init.el
View file

@ -2,9 +2,9 @@
(defun chris/display-startup-time () (defun chris/display-startup-time ()
(message "Emacs loaded in %s with %d garbage collections." (message "Emacs loaded in %s with %d garbage collections."
(format "%.2f seconds" (format "%.2f seconds"
(float-time (float-time
(time-subtract after-init-time before-init-time))) (time-subtract after-init-time before-init-time)))
gcs-done)) gcs-done))
(add-hook 'emacs-startup-hook #'chris/display-startup-time) (add-hook 'emacs-startup-hook #'chris/display-startup-time)
(setq inhibit-startup-message t) (setq inhibit-startup-message t)
@ -39,12 +39,12 @@
(defun chris/set-transparency () (defun chris/set-transparency ()
"Set the frame to be transparent on Wayland compositors" "Set the frame to be transparent on Wayland compositors"
(if (string-search "wayland" x-display-name) (if (string-search "wayland" x-display-name)
'((set-frame-parameter (selected-frame) 'alpha '(100 . 100)) '((set-frame-parameter (selected-frame) 'alpha '(100 . 100))
(set-frame-parameter (selected-frame) 'undecorated t) (set-frame-parameter (selected-frame) 'undecorated nil)
(add-to-list 'default-frame-alist '(undecorated . t)) (add-to-list 'default-frame-alist '(undecorated . nil))
(add-to-list 'default-frame-alist '(alpha . (100 . 100))) (add-to-list 'default-frame-alist '(alpha . (100 . 100)))
(add-to-list 'initial-frame-alist '(alpha . (100 . 100))) (add-to-list 'initial-frame-alist '(alpha . (100 . 100)))
(add-to-list 'initial-frame-alist '(undecorated . t))))) (add-to-list 'initial-frame-alist '(undecorated . t)))))
(if (daemonp) (if (daemonp)
(add-hook 'after-make-frame-functions (add-hook 'after-make-frame-functions
@ -69,7 +69,7 @@
;; ...especially on linux ;; ...especially on linux
(setq x-gtk-use-system-tooltips nil) (setq x-gtk-use-system-tooltips nil)
;; Favor vertical splits over horizontal ones. Screens are usually wide. ;; Favor vertical splits over horizontal ones. Screens are usually wide.
(setq split-width-threshold 160 (setq split-width-threshold 160
split-height-threshold nil) split-height-threshold nil)
@ -103,8 +103,8 @@
(straight-use-package 'use-package) (straight-use-package 'use-package)
(setq use-package-verbose t) (setq use-package-verbose t)
(use-package command-log-mode (use-package command-log-mode
:commands command-log-mode) :commands command-log-mode)
(use-package all-the-icons) (use-package all-the-icons)
@ -303,19 +303,19 @@
;; We need to fix selectrums minibuffer handling for Emacs 28 ;; We need to fix selectrums minibuffer handling for Emacs 28
(defun selectrum--set-window-height (window &optional height) (defun selectrum--set-window-height (window &optional height)
"Set window height of WINDOW to HEIGHT pixel. "Set window height of WINDOW to HEIGHT pixel.
If HEIGHT is not given WINDOW will be updated to fit its content If HEIGHT is not given WINDOW will be updated to fit its content
vertically." vertically."
(let* ((lines (length (let* ((lines (length
(split-string (split-string
(overlay-get selectrum--candidates-overlay 'after-string) (overlay-get selectrum--candidates-overlay 'after-string)
"\n" t))) "\n" t)))
(dheight (or height (dheight (or height
(* lines selectrum--line-height))) (* lines selectrum--line-height)))
(wheight (window-pixel-height window)) (wheight (window-pixel-height window))
(window-resize-pixelwise t)) (window-resize-pixelwise t))
(window-resize (window-resize
window (- dheight wheight) nil nil 'pixelwise))) window (- dheight wheight) nil nil 'pixelwise)))
:general :general
@ -497,7 +497,7 @@ vertically."
(use-package friar (use-package friar
:straight (:host github :repo "warreq/friar" :branch "master" :straight (:host github :repo "warreq/friar" :branch "master"
:files (:defaults "*.lua" "*.fnl")) :files (:defaults "*.lua" "*.fnl"))
:after fennel-mode) :after fennel-mode)
(use-package yaml-mode (use-package yaml-mode
@ -843,17 +843,17 @@ vertically."
:after org :after org
:init :init
(setq org-super-agenda-groups '((:name "Today" (setq org-super-agenda-groups '((:name "Today"
:time-grid t :time-grid t
:scheduled today) :scheduled today)
(:name "Due Today" (:name "Due Today"
:deadline today) :deadline today)
(:name "Important" (:name "Important"
:priority "A") :priority "A")
(:name "Overdue" (:name "Overdue"
:time-grid t :time-grid t
:scheduled today) :scheduled today)
(:name "Due soon" (:name "Due soon"
:deadline future))) :deadline future)))
:config :config
(org-super-agenda-mode) (org-super-agenda-mode)
(setq org-super-agenda-header-map nil)) (setq org-super-agenda-header-map nil))
@ -872,7 +872,7 @@ vertically."
org-roam-capture-templates org-roam-capture-templates
'(("d" "default" plain "%?" '(("d" "default" plain "%?"
:if-new (file+head "${slug}.org" :if-new (file+head "${slug}.org"
"#+TITLE: ${title}\n#+AUTHOR: Chris Cochrun\n#+CREATED: %<%D - %I:%M %p>\n\nj ") "#+TITLE: ${title}\n#+AUTHOR: Chris Cochrun\n#+CREATED: %<%D - %I:%M %p>\n\nj ")
:unnarrowed t) :unnarrowed t)
("b" "bible" plain "%?" ("b" "bible" plain "%?"
:if-new (file+head "${slug}.org" :if-new (file+head "${slug}.org"
@ -880,7 +880,7 @@ vertically."
:unnarrowed t) :unnarrowed t)
("l" "TFC Lesson" plain (file ".templates/lessontemplate.org") ("l" "TFC Lesson" plain (file ".templates/lessontemplate.org")
:if-new (file+head "lessons/${slug}.org" :if-new (file+head "lessons/${slug}.org"
"#+TITLE: ${title}\n#+AUTHOR: Chris Cochrun\n#+CREATED: %<%D - %I:%M %p>\n") "#+TITLE: ${title}\n#+AUTHOR: Chris Cochrun\n#+CREATED: %<%D - %I:%M %p>\n")
:unnarrowed t)) :unnarrowed t))
org-roam-dailies-capture-templates org-roam-dailies-capture-templates
'(("d" "daily" plain #'org-roam-capture--get-point "" '(("d" "daily" plain #'org-roam-capture--get-point ""
@ -1175,7 +1175,8 @@ If on a:
:query "mime:image/*" :query "mime:image/*"
:key 112))) :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu") (setq mu4e-mu-binary "/usr/bin/mu"
mu4e-view-prefer-html nil)
(setq mu4e-use-fancy-chars t (setq mu4e-use-fancy-chars t
mu4e-headers-draft-mark '("D" . "") mu4e-headers-draft-mark '("D" . "")
mu4e-headers-flagged-mark '("F" . "") mu4e-headers-flagged-mark '("F" . "")
@ -1204,8 +1205,17 @@ If on a:
(toggle-truncate-lines +1) (toggle-truncate-lines +1)
(display-line-numbers-mode -1)) (display-line-numbers-mode -1))
(defun chris/setup-mu4e-view ()
(display-line-numbers-mode -1)
(setq visual-fill-column-center-text t)
(setq visual-fill-column-width 100)
(visual-fill-column-mode +1))
(remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1))
(add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers)
(add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view)
(mu4e t) (mu4e t)
:general :general
@ -1380,18 +1390,18 @@ If on a:
(add-hook 'eshell-mode-hook '(display-line-numbers-mode -1)) (add-hook 'eshell-mode-hook '(display-line-numbers-mode -1))
(setq eshell-command-aliases-list (setq eshell-command-aliases-list
'(("q" "exit") '(("q" "exit")
("f" "find-file $1") ("f" "find-file $1")
("ff" "find-file $1") ("ff" "find-file $1")
("d" "dired $1") ("d" "dired $1")
("bd" "eshell-up $1") ("bd" "eshell-up $1")
("rg" "rg --color=always $*") ("rg" "rg --color=always $*")
("ll" "ls -lah $*") ("ll" "ls -lah $*")
("gg" "magit-status") ("gg" "magit-status")
("clear" "clear-scrollback") ("clear" "clear-scrollback")
("!c" "eshell-previous-input 2") ("!c" "eshell-previous-input 2")
("yay" "paru $1") ("yay" "paru $1")
("yeet" "paru -Rns $1"))) ("yeet" "paru -Rns $1")))
:general :general
(chris/leader-keys (chris/leader-keys
@ -1402,12 +1412,19 @@ If on a:
"C-d" 'kill-buffer-and-window)) "C-d" 'kill-buffer-and-window))
(use-package sly (use-package sly
:mode ("\\.lisp\\'" . sly-mode)) :mode
("\\.lisp\\'" . sly-mode)
("\\.lisp\\'" . lisp-mode)
:config
(defun chris/start-nyxt-repl ()
"Start the repl and sly connection for nyxt"
(interactive)
(sly-connect "localhost" 4006)))
(use-package pdf-tools (use-package pdf-tools
:straight (:host github :straight (:host github
:repo "flatwhatson/pdf-tools" :repo "flatwhatson/pdf-tools"
:branch "fix-macros") :branch "fix-macros")
:defer 1 :defer 1
:config :config
(pdf-tools-install) (pdf-tools-install)
@ -1419,7 +1436,7 @@ If on a:
:config :config
(defun chris/setup-nov-mode (defun chris/setup-nov-mode
(interactive) (interactive)
(visual-fill-column-mode) (visual-fill-column-mode)
(display-line-numbers-mode -1) (display-line-numbers-mode -1)
(variable-pitch-mode +1) (variable-pitch-mode +1)
@ -1585,11 +1602,11 @@ interfere with the default `bongo-playlist-buffer'."
transmission-files-mode transmission-files-mode
transmission-info-mode transmission-info-mode
transmission-peers-mode))) transmission-peers-mode)))
:general :general
(chris/leader-keys (chris/leader-keys
:states 'normal :states 'normal
:keymaps 'override :keymaps 'override
"ot" 'transmission)) "ot" 'transmission))
(use-package auth-source-pass (use-package auth-source-pass
:defer 1 :defer 1