From 417b846cbc8bf8a798bf7fdb6aeb7ba5a8a14111 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 8 Jun 2020 00:54:38 +0200 Subject: [PATCH 01/38] more gitignores --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1e3fb4c..5705b28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ auto-save-list backups +bookmarks +custom.el +games +ido.last irony projectile-bookmarks.eld +smex-items straight -custom.el transient -games From 47bab6f824fd2a58fd2bd8432c266f57fa5e9fa5 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 8 Jun 2020 00:55:35 +0200 Subject: [PATCH 02/38] emacs: a lot of packages removed Most of the packages are removed since quite unused. ivy/swiper/counsel combo is substituted by (built-in) ido and smex. Anything from the list may come back as needed. --- init.el | 73 ++++++++++++++------------------------------------------- 1 file changed, 18 insertions(+), 55 deletions(-) diff --git a/init.el b/init.el index 69f5396..711061d 100644 --- a/init.el +++ b/init.el @@ -74,9 +74,8 @@ (setq indent-tabs-mode t)) (defun tabs-nay () (setq indent-tabs-mode nil)) -;;wasteland of hooks regarding tabs behaviour -;;Remember how it "Just worked"™ in vim? -;;That's what you pay with for org mode +;; wasteland of hooks regarding tabs behavior Remember how it "Just +;; worked"™ in vim? That's what you pay with for org mode (add-hook 'prog-mode-hook 'tabs-yay) (add-hook 'lisp-mode-hook 'tabs-nay) (add-hook 'scheme-mode-hook 'tabs-nay) @@ -86,7 +85,6 @@ (setq show-paren-delay 0) (show-paren-mode 1) - ;; follow symlinks to version-controlled files (setq vc-follow-symlinks t) @@ -109,7 +107,15 @@ (straight-use-package 'leuven-theme) (straight-use-package 'zenburn-theme) -(load-theme 'gruvbox-dark-hard t) +(load-theme 'leuven t) + +;; better M-x +(straight-use-package 'smex) +(smex-initialize) +(global-set-key (kbd "M-x") 'smex) +(global-set-key (kbd "M-X") 'smex-major-mode-commands) +;; old M-x, just-in-case +(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) ;; healthy people weeks are starting on Monday (use-package calendar @@ -129,34 +135,11 @@ :mode ("\\.tex\\'" . latex-mode) :straight auctex :config - (setq TeX-parse-self t) -(use-package company-auctex - :straight t - :config - (company-auctex-init))) + (setq TeX-parse-self t)) (use-package latex-preview-pane :straight t) -(use-package flycheck - :straight t - :config (global-flycheck-mode)) - -(use-package ivy - :straight t - :demand - :bind (("\C-s" . swiper) - ("C-c C-r" . ivy-resume)) - :init - (setq ivy-display-style 'fancy) - :config - (ivy-mode 1)) - -(use-package counsel - :straight t - :config - (counsel-mode 1)) - (use-package rainbow-delimiters :straight t :hook ((emacs-lisp-mode . rainbow-delimiters-mode) @@ -219,34 +202,11 @@ :bind (("C-x C-g" . magit-dispatch) ("C-x g" . magit-status))) -(use-package gnuplot-mode - :straight t) - (use-package undo-tree :straight t :config (global-undo-tree-mode 1)) -(use-package elpy - :straight t - :after flycheck - :hook - (elpy-mode . flycheck-mode) - :config - (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) - (elpy-enable)) - -(use-package markdown-mode - :straight t - :mode (("README\\.md\\'" . gfm-mode) - ("\\.md\\'" . markdown-mode) - ("\\.markdown\\'" . markdown-mode)) - :init (setq markdown-command "multimarkdown")) - -(use-package company - :straight t - :hook ('prog-mode . 'company-mode)) - ;; I positively cannot spell :D (use-package ispell :config @@ -262,9 +222,6 @@ ('log-edit-mode . (lambda () (flyspell-mode -1))) ('prog-mode . 'flyspell-prog-mode))) -(use-package haskell-mode - :straight t) - (use-package comment-tags :straight t :hook (('prog-mode . 'comment-tags-mode) @@ -289,6 +246,12 @@ :init (setq geiser-active-implementations '(racket))) +(use-package ido + :config + (setq ido-enable-flex-matching t + ido-everywhere t) + (ido-mode 1)) + ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From af2d6382f3d37e89e178eb81bcc87ce010a94ce1 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 8 Jun 2020 01:03:54 +0200 Subject: [PATCH 03/38] do not use "use-package" for stuff we want to load unconditionally --- init.el | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/init.el b/init.el index 711061d..694e7bf 100644 --- a/init.el +++ b/init.el @@ -109,7 +109,14 @@ (load-theme 'leuven t) -;; better M-x +;; ido does most of what I need, and built in! +(require 'ido) +;; we want it everywhere and want fancy matching +(setq ido-enable-flex-matching t + ido-everywhere t) +(ido-mode 1) + +;; better M-x (ido based) (straight-use-package 'smex) (smex-initialize) (global-set-key (kbd "M-x") 'smex) @@ -121,14 +128,12 @@ (use-package calendar :init (setq calendar-week-start-day 1)) -;; CC mode -(use-package cc-mode - :init - (setq c-default-style '((java-mode . "java") - (awk-mode . "awk") - (c-mode . "linux") - (c++-mode . "stroustrup") - (other . "linux")))) +;; CC mode default styles +(setq c-default-style '((java-mode . "java") + (awk-mode . "awk") + (c-mode . "linux") + (c++-mode . "stroustrup") + (other . "linux"))) (use-package tex-site :defer t @@ -192,10 +197,9 @@ '((scheme . t) (emacs-lisp .t) (python . t) - (C . t)))) - -(use-package org-tempo - :after org) + (C . t))) + :config + (require 'org-tempo)) (use-package magit :straight t @@ -246,12 +250,6 @@ :init (setq geiser-active-implementations '(racket))) -(use-package ido - :config - (setq ido-enable-flex-matching t - ido-everywhere t) - (ido-mode 1)) - ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From f3abf4f485f8ccd4db1f75a649b3aebd703ac52a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 8 Jun 2020 18:44:26 +0200 Subject: [PATCH 04/38] move all use-package stuff to one place --- init.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 694e7bf..390ea76 100644 --- a/init.el +++ b/init.el @@ -124,10 +124,6 @@ ;; old M-x, just-in-case (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) -;; healthy people weeks are starting on Monday -(use-package calendar - :init (setq calendar-week-start-day 1)) - ;; CC mode default styles (setq c-default-style '((java-mode . "java") (awk-mode . "awk") @@ -135,6 +131,10 @@ (c++-mode . "stroustrup") (other . "linux"))) +;; healthy people weeks are starting on Monday +(use-package calendar + :init (setq calendar-week-start-day 1)) + (use-package tex-site :defer t :mode ("\\.tex\\'" . latex-mode) From fc573e22a4158e54f49a919f6da9ce528ae92129 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 8 Jun 2020 18:48:19 +0200 Subject: [PATCH 05/38] add swiper back way better default I-search --- init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.el b/init.el index 390ea76..cfc471c 100644 --- a/init.el +++ b/init.el @@ -131,6 +131,10 @@ (c++-mode . "stroustrup") (other . "linux"))) +;; swiper for search +(straight-use-package 'swiper) +(global-set-key "\C-s" 'swiper) + ;; healthy people weeks are starting on Monday (use-package calendar :init (setq calendar-week-start-day 1)) @@ -199,6 +203,7 @@ (python . t) (C . t))) :config + ;; abbrev expansion in org-mode (require 'org-tempo)) (use-package magit From bf0486e58672f8a283f39f978990bb6f98f85623 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Wed, 10 Jun 2020 18:32:41 +0200 Subject: [PATCH 06/38] ivy and counsel back to replace ido Seems way less fiddle-y and more fuzzy --- init.el | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/init.el b/init.el index cfc471c..5b54d8c 100644 --- a/init.el +++ b/init.el @@ -109,21 +109,6 @@ (load-theme 'leuven t) -;; ido does most of what I need, and built in! -(require 'ido) -;; we want it everywhere and want fancy matching -(setq ido-enable-flex-matching t - ido-everywhere t) -(ido-mode 1) - -;; better M-x (ido based) -(straight-use-package 'smex) -(smex-initialize) -(global-set-key (kbd "M-x") 'smex) -(global-set-key (kbd "M-X") 'smex-major-mode-commands) -;; old M-x, just-in-case -(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) - ;; CC mode default styles (setq c-default-style '((java-mode . "java") (awk-mode . "awk") @@ -134,6 +119,12 @@ ;; swiper for search (straight-use-package 'swiper) (global-set-key "\C-s" 'swiper) +;; ivy for completion +(straight-use-package 'ivy) +(ivy-mode 1) +;; counsel for ivy-powered alternatives +(straight-use-package 'counsel) +(counsel-mode 1) ;; healthy people weeks are starting on Monday (use-package calendar From 9a128f2ec906e687d25df0999165249f98788fe0 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sun, 14 Jun 2020 17:03:58 +0200 Subject: [PATCH 07/38] disable docview for pdf, and some minor cleanups --- init.el | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 5b54d8c..4805c55 100644 --- a/init.el +++ b/init.el @@ -41,6 +41,7 @@ ;; readline prevails (global-set-key "\C-w" 'backward-kill-word) (global-set-key "\C-x\C-k" 'kill-region) +(global-set-key "\C-h" 'delete-backward-char) (defadvice term-handle-exit (after term-kill-buffer-on-exit activate) @@ -54,7 +55,10 @@ (add-hook 'prog-mode-hook #'my-whitespace-hook) (add-hook 'text-mode-hook #'my-whitespace-hook) -;; let's try to fix the pile of burning garbage that emacs calls a tab +;; let's try to fix the pile of burning garbage that emacs calls a +;; tab. If anyone reading actually knows why mixing tabs and spaces or +;; deleting the tab one space at a time is a good idea, please drop me +;; an email. I want to know. (require 'whitespace) (setq whitespace-style '(face tabs tab-mark)) (setq whitespace-display-mappings @@ -81,6 +85,33 @@ (add-hook 'scheme-mode-hook 'tabs-nay) (add-hook 'emacs-lisp-mode-hook 'tabs-nay) +;; time to throw out this "DocView" abomination: full featured pdf +;; viewer of antiquity, that emacs uses today! +(defun ensc/mailcap-mime-data-filter (filter) + (mapcar (lambda(major) + (append (list (car major)) + (remove nil + (mapcar (lambda(minor) + (when (funcall filter (car major) (car minor) (cdr minor)) + minor)) + (cdr major))))) + mailcap-mime-data)) + +(defun ensc/no-pdf-doc-view-filter (major minor spec) + (if (and (string= major "application") + (string= minor "pdf") + (member '(viewer . doc-view-mode) spec)) + nil + t)) + +(eval-after-load 'mailcap + '(progn + (setq mailcap-mime-data + (ensc/mailcap-mime-data-filter 'ensc/no-pdf-doc-view-filter)))) + +;; and this seems to make xdg-open work +(setq process-connection-type nil) + ;; highlight the parens (setq show-paren-delay 0) (show-paren-mode 1) From fd5f002f9c5685d6b05a8a6f94af5ddc211349e8 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 15 Jun 2020 19:24:13 +0200 Subject: [PATCH 08/38] flycheck is back --- init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.el b/init.el index 4805c55..ad30894 100644 --- a/init.el +++ b/init.el @@ -277,6 +277,10 @@ :init (setq geiser-active-implementations '(racket))) +(use-package flycheck + :straight t + :init (global-flycheck-mode)) + ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From 5e87f019619aa2865fa1b27f063c2eed4f7faffe Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 15 Jun 2020 19:24:36 +0200 Subject: [PATCH 09/38] keep it dark in terminals most GUIs are light, so use light theme there most terminals are dark by default, so use dark theme here --- init.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index ad30894..4d2df7a 100644 --- a/init.el +++ b/init.el @@ -138,7 +138,9 @@ (straight-use-package 'leuven-theme) (straight-use-package 'zenburn-theme) -(load-theme 'leuven t) +(if (display-graphic-p) + (load-theme 'leuven t) + (load-theme 'zenburn t)) ;; CC mode default styles (setq c-default-style '((java-mode . "java") From 7ae3caf28e4fcbaf6de784bfbfd5ad4665a928fa Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 18 Jun 2020 21:35:52 +0200 Subject: [PATCH 10/38] on second thought, keep it dark everywhere --- init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 4d2df7a..2350561 100644 --- a/init.el +++ b/init.el @@ -138,9 +138,9 @@ (straight-use-package 'leuven-theme) (straight-use-package 'zenburn-theme) -(if (display-graphic-p) - (load-theme 'leuven t) - (load-theme 'zenburn t)) +(load-theme 'gruvbox-dark-hard t) +;; italic comments +(set-face-italic 'font-lock-comment-face t) ;; CC mode default styles (setq c-default-style '((java-mode . "java") From 7ae465581a6aa5e716e08824ccd7842137624b4a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 18 Jun 2020 22:33:18 +0200 Subject: [PATCH 11/38] company is back --- init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 2350561..5cfa3a5 100644 --- a/init.el +++ b/init.el @@ -159,6 +159,11 @@ (straight-use-package 'counsel) (counsel-mode 1) +;; completion by default - welcome to 2020 +(straight-use-package 'company) +(straight-use-package 'company-auctex) +(add-hook 'after-init-hook 'global-company-mode) + ;; healthy people weeks are starting on Monday (use-package calendar :init (setq calendar-week-start-day 1)) @@ -168,7 +173,11 @@ :mode ("\\.tex\\'" . latex-mode) :straight auctex :config - (setq TeX-parse-self t)) + (setq TeX-parse-self t) + ;; completion for LaTeX + (use-package company-auctex + :config + (company-auctex-init))) (use-package latex-preview-pane :straight t) From 9e01e5ef2bd0dd92f877f7cd2f4171d161faacea Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 22 Jun 2020 16:46:27 +0200 Subject: [PATCH 12/38] Revert "on second thought, keep it dark everywhere" This reverts commit 7ae3caf28e4fcbaf6de784bfbfd5ad4665a928fa. --- init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 5cfa3a5..ce42d56 100644 --- a/init.el +++ b/init.el @@ -138,9 +138,9 @@ (straight-use-package 'leuven-theme) (straight-use-package 'zenburn-theme) -(load-theme 'gruvbox-dark-hard t) -;; italic comments -(set-face-italic 'font-lock-comment-face t) +(if (display-graphic-p) + (load-theme 'leuven t) + (load-theme 'zenburn t)) ;; CC mode default styles (setq c-default-style '((java-mode . "java") From bc3d148c2653625d56e6e8eef0f32e61fffdc420 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 22 Jun 2020 16:47:34 +0200 Subject: [PATCH 13/38] precess-connection type mindfuck If we connect through pipes some repls are broken. If we connect through PHY's, xdg-open is broken... --- init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index ce42d56..f971f58 100644 --- a/init.el +++ b/init.el @@ -109,8 +109,8 @@ (setq mailcap-mime-data (ensc/mailcap-mime-data-filter 'ensc/no-pdf-doc-view-filter)))) -;; and this seems to make xdg-open work -(setq process-connection-type nil) +;; TODO: and this seems to make xdg-open work, but breaks python interpreter +;; (setq process-connection-type nil) ;; highlight the parens (setq show-paren-delay 0) From 42bdba6e1ad4b1a9661bebed6fa9db6e33fc2933 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 22 Jun 2020 16:50:04 +0200 Subject: [PATCH 14/38] modify bookmark capture template --- init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index f971f58..20a4ed9 100644 --- a/init.el +++ b/init.el @@ -222,8 +222,8 @@ (file+datetree "~/nextcloud/org/log.org.gpg") "**** %U %?\n") ("b" "Bookmark" entry - (file "~/nextcloud/org/bookmarks.org") - "* [[%x][%?]\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n"))) + (file+headline "~/nextcloud/org/bookmarks.org" "Inbox") + "** [[%x][%?]\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n"))) ;; autosave advices for agenda and org-capture (advice-add 'org-agenda-quit :before 'org-save-all-org-buffers) (advice-add 'org-capture-finalize :after 'org-save-all-org-buffers) From 9744acce57742011581da1cb686afe07eea2b8f4 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 22 Jun 2020 16:59:36 +0200 Subject: [PATCH 15/38] babel languages: sort and add dot (graphviz) --- init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 20a4ed9..49031c8 100644 --- a/init.el +++ b/init.el @@ -231,10 +231,11 @@ ;; babel stuff (org-babel-do-load-languages 'org-babel-load-languages - '((scheme . t) + '((C . t) + (dot . t) (emacs-lisp .t) (python . t) - (C . t))) + (scheme . t))) :config ;; abbrev expansion in org-mode (require 'org-tempo)) From 210868d628a3e2ffd3343832a37f99760c332452 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 22 Jun 2020 20:15:33 +0200 Subject: [PATCH 16/38] use zenburn as a theme --- init.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 49031c8..f2114bd 100644 --- a/init.el +++ b/init.el @@ -138,9 +138,8 @@ (straight-use-package 'leuven-theme) (straight-use-package 'zenburn-theme) -(if (display-graphic-p) - (load-theme 'leuven t) - (load-theme 'zenburn t)) +(load-theme 'zenburn t) +(set-face-italic 'font-lock-comment-face t) ;; CC mode default styles (setq c-default-style '((java-mode . "java") From f438e12ded6fb27da8e87d39ce956dd637a83aab Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Tue, 30 Jun 2020 21:47:51 +0200 Subject: [PATCH 17/38] better theme --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.el b/init.el index f2114bd..868e788 100644 --- a/init.el +++ b/init.el @@ -136,9 +136,8 @@ ;; color theme (straight-use-package 'gruvbox-theme) (straight-use-package 'leuven-theme) -(straight-use-package 'zenburn-theme) -(load-theme 'zenburn t) +(load-theme 'gruvbox-dark-hard t) (set-face-italic 'font-lock-comment-face t) ;; CC mode default styles From 175afd91c9cf63a7cadb154c0ad00ea348b1637b Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 13 Jul 2020 13:29:37 +0200 Subject: [PATCH 18/38] minor cleanup --- init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 868e788..e7a65f8 100644 --- a/init.el +++ b/init.el @@ -74,9 +74,12 @@ ;;helper functions to switch tab expansion on and off (defun tabs-yay () + "Function to enable tab indentation in buffer." ;;(local-set-key (kbd "TAB") 'tab-to-tab-stop) (setq indent-tabs-mode t)) -(defun tabs-nay () (setq indent-tabs-mode nil)) +(defun tabs-nay () + "Function to enable space indentation in buffer." + (setq indent-tabs-mode nil)) ;; wasteland of hooks regarding tabs behavior Remember how it "Just ;; worked"™ in vim? That's what you pay with for org mode From fecbd06b30d5b176dc4238924139597f8deb061d Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 13 Jul 2020 13:29:49 +0200 Subject: [PATCH 19/38] do not italicize comment delimiter --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index e7a65f8..dc440bf 100644 --- a/init.el +++ b/init.el @@ -142,6 +142,7 @@ (load-theme 'gruvbox-dark-hard t) (set-face-italic 'font-lock-comment-face t) +(set-face-italic 'font-lock-comment-delimiter-face nil) ;; CC mode default styles (setq c-default-style '((java-mode . "java") From a05abd85262ce76bfe178d5cb5ca20d6f6c831dc Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 13 Jul 2020 13:30:21 +0200 Subject: [PATCH 20/38] show menu bar on MacOS, since it doesn't clutter the menu thanks to globalmenu --- init.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index dc440bf..0144094 100644 --- a/init.el +++ b/init.el @@ -25,7 +25,9 @@ (require 'use-package) ;; essential config -(menu-bar-mode -1) +(if (eq system-type 'darwin) + (menu-bar-mode 1) ; if on a mac, there's global menu anyway + (menu-bar-mode -1)) (tool-bar-mode -1) (toggle-scroll-bar 1) (global-display-line-numbers-mode) From 60916d2c34d4f30d0dea45da62bc790bc3b15004 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 16 Jul 2020 22:48:46 +0200 Subject: [PATCH 21/38] add nix mode --- init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.el b/init.el index 0144094..b887a0a 100644 --- a/init.el +++ b/init.el @@ -89,6 +89,7 @@ (add-hook 'lisp-mode-hook 'tabs-nay) (add-hook 'scheme-mode-hook 'tabs-nay) (add-hook 'emacs-lisp-mode-hook 'tabs-nay) +(add-hook 'nix-mode-hook 'tabs-nay) ;; time to throw out this "DocView" abomination: full featured pdf ;; viewer of antiquity, that emacs uses today! @@ -297,6 +298,10 @@ :straight t :init (global-flycheck-mode)) +(use-package nix-mode + :straight t + :mode "\\.nix\\'") + ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From 15001ce8ca9edb7c125f1240e3755901f3b2bdd2 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 16 Jul 2020 22:49:20 +0200 Subject: [PATCH 22/38] vterm installation is now managed by nix --- init.el | 1 - 1 file changed, 1 deletion(-) diff --git a/init.el b/init.el index b887a0a..f1fc2d4 100644 --- a/init.el +++ b/init.el @@ -285,7 +285,6 @@ :bind ("C-=" . er/expand-region)) (use-package vterm - :straight t :init (setq vterm-kill-buffer-on-exit t)) From 9b8a7510381bec2c7d6cb6360497440a0aeb029a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 16 Jul 2020 22:50:21 +0200 Subject: [PATCH 23/38] add binding to vterm --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index f1fc2d4..88c6c38 100644 --- a/init.el +++ b/init.el @@ -285,6 +285,7 @@ :bind ("C-=" . er/expand-region)) (use-package vterm + :bind ("C-c C-t" . vterm) :init (setq vterm-kill-buffer-on-exit t)) From b0c37c7207fdd481f2f41d0e230df879bd07dfc9 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 3 Aug 2020 11:25:00 +0200 Subject: [PATCH 24/38] emacs: cleanup, add markdown mode and support for direnv --- init.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 88c6c38..409e228 100644 --- a/init.el +++ b/init.el @@ -85,7 +85,10 @@ ;; wasteland of hooks regarding tabs behavior Remember how it "Just ;; worked"™ in vim? That's what you pay with for org mode +;; yays: (need to make a list or something) (add-hook 'prog-mode-hook 'tabs-yay) + +;; nays (add-hook 'lisp-mode-hook 'tabs-nay) (add-hook 'scheme-mode-hook 'tabs-nay) (add-hook 'emacs-lisp-mode-hook 'tabs-nay) @@ -285,7 +288,7 @@ :bind ("C-=" . er/expand-region)) (use-package vterm - :bind ("C-c C-t" . vterm) + :bind ("C-c t" . vterm) :init (setq vterm-kill-buffer-on-exit t)) @@ -302,6 +305,17 @@ :straight t :mode "\\.nix\\'") +(use-package markdown-mode + :straight t + :mode (("README\\.md\\'" . gfm-mode) + ("\\.md\\'" . markdown-mode) + ("\\.markdown\\'" . markdown-mode))) + +(use-package direnv + :straight t + :config + (direnv-mode)) + ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From 146fe925334358412fb366b03c717d231bf84a0a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Wed, 26 Aug 2020 15:32:30 +0200 Subject: [PATCH 25/38] geiser: add support for mit-scheme --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 409e228..7591c58 100644 --- a/init.el +++ b/init.el @@ -295,7 +295,7 @@ (use-package geiser :straight t :init - (setq geiser-active-implementations '(racket))) + (setq geiser-active-implementations '(racket mit))) (use-package flycheck :straight t From 2b9d296d90b38cfda7e5e3466b7ab87557f1f2c6 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 10 Oct 2020 01:53:53 +0200 Subject: [PATCH 26/38] org-roam: init --- init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.el b/init.el index 7591c58..022527a 100644 --- a/init.el +++ b/init.el @@ -248,6 +248,11 @@ ;; abbrev expansion in org-mode (require 'org-tempo)) +(use-package org-roam + :straight t + :hook ('after-init-hook . 'org-roam-mode) + :init (setq org-roam-directory "~/nextcloud/org/notes")) + (use-package magit :straight t :bind (("C-x C-g" . magit-dispatch) From 8d58233973c2feb7828fa6d6f2ad7edf7f07e527 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 10 Oct 2020 01:54:14 +0200 Subject: [PATCH 27/38] use comment tags in markdown --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index 022527a..8d684d0 100644 --- a/init.el +++ b/init.el @@ -281,6 +281,7 @@ (use-package comment-tags :straight t :hook (('prog-mode . 'comment-tags-mode) + ('markdown-mode . 'comment-tags-mode) ('tex-mode . 'comment-tags-mode)) :init (setq comment-tags-require-colon 0)) From f03959d76e0f617f1f5b713f241a39d936c5737a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 10 Oct 2020 01:54:34 +0200 Subject: [PATCH 28/38] another attempt at fixing mixed tabs and spaces --- init.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/init.el b/init.el index 8d684d0..4d91b5c 100644 --- a/init.el +++ b/init.el @@ -74,6 +74,9 @@ (straight-use-package 'smart-tabs-mode) (smart-tabs-insinuate 'c 'c++) +;; radical way to fix emacs mixing tabs and spaces +(setq-default ident-tabs-mode nil) + ;;helper functions to switch tab expansion on and off (defun tabs-yay () "Function to enable tab indentation in buffer." @@ -86,13 +89,7 @@ ;; wasteland of hooks regarding tabs behavior Remember how it "Just ;; worked"™ in vim? That's what you pay with for org mode ;; yays: (need to make a list or something) -(add-hook 'prog-mode-hook 'tabs-yay) - -;; nays -(add-hook 'lisp-mode-hook 'tabs-nay) -(add-hook 'scheme-mode-hook 'tabs-nay) -(add-hook 'emacs-lisp-mode-hook 'tabs-nay) -(add-hook 'nix-mode-hook 'tabs-nay) +(add-hook 'cc-mode-hook 'tabs-yay) ;; time to throw out this "DocView" abomination: full featured pdf ;; viewer of antiquity, that emacs uses today! From f901c63f747c0c769dbae3c32520902c707d1711 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 7 Nov 2020 01:18:03 +0100 Subject: [PATCH 29/38] clean up color scheme --- init.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/init.el b/init.el index 4d91b5c..9fe2a8a 100644 --- a/init.el +++ b/init.el @@ -140,10 +140,7 @@ version-control t) ;; color theme -(straight-use-package 'gruvbox-theme) -(straight-use-package 'leuven-theme) - -(load-theme 'gruvbox-dark-hard t) +(load-theme 'wombat t) (set-face-italic 'font-lock-comment-face t) (set-face-italic 'font-lock-comment-delimiter-face nil) From 540a8de41a34a608e9962665501ec9fb72c6c9b3 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:18:29 +0100 Subject: [PATCH 30/38] init: bind lexically --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 9fe2a8a..4e4cc24 100644 --- a/init.el +++ b/init.el @@ -1,4 +1,4 @@ -;;; init.el --- emacs configuration +;;; init.el --- emacs configuration -*- lexical-binding: t; -*- ;;; Commentary: ;;; M-x 🦋 ;;; Code: From f280ea7878a70d7a71ba7b9c43e5f3eb1afd99fa Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:20:23 +0100 Subject: [PATCH 31/38] clean up statusline --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.el b/init.el index 4e4cc24..b83ae67 100644 --- a/init.el +++ b/init.el @@ -36,6 +36,9 @@ (setq auto-save-default nil) (setq visible-bell t) +;; declutter modeline with diminish +(straight-use-package 'diminish) + ;; magic in the world of idiotic defaults... (fset 'yes-or-no-p 'y-or-n-p) (setq confirm-nonexistent-file-or-buffer nil) @@ -66,6 +69,7 @@ (setq whitespace-display-mappings '((tab-mark 9 [187 9] [92 9]))) (add-hook 'prog-mode-hook #'whitespace-mode) +(diminish 'whitespace-mode) ;; let's delete a tab as a whole... (setq backward-delete-char-untabify-method 'nil) @@ -157,14 +161,18 @@ ;; ivy for completion (straight-use-package 'ivy) (ivy-mode 1) +(diminish 'ivy-mode) + ;; counsel for ivy-powered alternatives (straight-use-package 'counsel) (counsel-mode 1) +(diminish 'counsel-mode) ;; completion by default - welcome to 2020 (straight-use-package 'company) (straight-use-package 'company-auctex) (add-hook 'after-init-hook 'global-company-mode) +(diminish 'company-mode) ;; healthy people weeks are starting on Monday (use-package calendar @@ -254,6 +262,7 @@ (use-package undo-tree :straight t + :diminish :config (global-undo-tree-mode 1)) From cc35cd372e3720208e01ec2f11c92022ee87310a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:21:09 +0100 Subject: [PATCH 32/38] new theme: tomorrow night --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index b83ae67..89268d7 100644 --- a/init.el +++ b/init.el @@ -144,7 +144,8 @@ version-control t) ;; color theme -(load-theme 'wombat t) +(straight-use-package 'color-theme-sanityinc-tomorrow) +(load-theme 'sanityinc-tomorrow-night 1) (set-face-italic 'font-lock-comment-face t) (set-face-italic 'font-lock-comment-delimiter-face nil) From 945bab9fc56130e093c5cea03eff4afd0097fed3 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:22:00 +0100 Subject: [PATCH 33/38] minor cleanups and typos --- init.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 89268d7..0d70ea5 100644 --- a/init.el +++ b/init.el @@ -26,7 +26,7 @@ ;; essential config (if (eq system-type 'darwin) - (menu-bar-mode 1) ; if on a mac, there's global menu anyway + (menu-bar-mode 1) ; if on a mac, there's global menu anyway (menu-bar-mode -1)) (tool-bar-mode -1) (toggle-scroll-bar 1) @@ -67,7 +67,7 @@ (require 'whitespace) (setq whitespace-style '(face tabs tab-mark)) (setq whitespace-display-mappings - '((tab-mark 9 [187 9] [92 9]))) + '((tab-mark 9 [187 9] [92 9]))) (add-hook 'prog-mode-hook #'whitespace-mode) (diminish 'whitespace-mode) @@ -79,7 +79,7 @@ (smart-tabs-insinuate 'c 'c++) ;; radical way to fix emacs mixing tabs and spaces -(setq-default ident-tabs-mode nil) +(setq-default indent-tabs-mode nil) ;;helper functions to switch tab expansion on and off (defun tabs-yay () @@ -92,7 +92,6 @@ ;; wasteland of hooks regarding tabs behavior Remember how it "Just ;; worked"™ in vim? That's what you pay with for org mode -;; yays: (need to make a list or something) (add-hook 'cc-mode-hook 'tabs-yay) ;; time to throw out this "DocView" abomination: full featured pdf From cb39553030b5d468e84057445dcd400ea42aa85a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:22:41 +0100 Subject: [PATCH 34/38] which-key: init --- init.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.el b/init.el index 0d70ea5..0e661e9 100644 --- a/init.el +++ b/init.el @@ -325,6 +325,12 @@ :config (direnv-mode)) +(use-package which-key + :straight t + :diminish + :config + (which-key-mode)) + ;; throw away all the list-of-custom-shit! (setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror) From 7ca27dd31b358a9716187ab671be25ec33300202 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 17:27:26 +0100 Subject: [PATCH 35/38] org: change of the layout --- init.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 0e661e9..e277444 100644 --- a/init.el +++ b/init.el @@ -212,18 +212,18 @@ org-startup-folded 'content) ;; default agenda files (setq org-agenda-files '("~/nextcloud/org/" - "~/nextcloud/org-phone/" + "~/nextcloud/org/phone/" "~/Seafile/ORG/")) ;; templates (setq org-capture-templates '(("t" "TODO" entry - (file+headline "~/nextcloud/org/random.org" "Tasks") + (file+headline "~/nextcloud/org/inbox.org" "Tasks") "** TODO %?\n %i") ("T" "TODO+file" entry - (file+headline "~/nextcloud/org/random.org" "Tasks") + (file+headline "~/nextcloud/org/inbox.org" "Tasks") "** TODO %?\n %i\n %a") ("n" "note" entry - (file+headline "~/nextcloud/org/random.org" "Notes") + (file+headline "~/nextcloud/org/inbox.org" "Notes") "** %U\n%?\n") ("i" "IFW TODO" entry (file+headline "~/Seafile/ORG/ifw.org" "Tasks") @@ -238,6 +238,10 @@ (advice-add 'org-agenda-quit :before 'org-save-all-org-buffers) (advice-add 'org-capture-finalize :after 'org-save-all-org-buffers) + ;; refile everywhere where agenda lives + (setq org-refile-targets + '((nil :maxlevel . 1) + (org-agenda-files :maxlevel . 1))) ;; babel stuff (org-babel-do-load-languages 'org-babel-load-languages From c94a63599b3e3030f0bfed30278956e85cca03ee Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Fri, 13 Nov 2020 20:56:51 +0100 Subject: [PATCH 36/38] org: roam: new folder --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.el b/init.el index e277444..c88e315 100644 --- a/init.el +++ b/init.el @@ -200,7 +200,6 @@ (cc-mode . rainbow-delimiters-mode))) (use-package org - :straight org-plus-contrib :bind (("C-c a" . org-agenda) ("C-c c" . org-capture) ("C-c l" . org-store-link) @@ -257,7 +256,7 @@ (use-package org-roam :straight t :hook ('after-init-hook . 'org-roam-mode) - :init (setq org-roam-directory "~/nextcloud/org/notes")) + :init (setq org-roam-directory "~/nextcloud/org/roam")) (use-package magit :straight t From 5a9b0d43ccef12b5d2a8122c92abf05ca64bbf71 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 14 Nov 2020 22:11:59 +0100 Subject: [PATCH 37/38] update org config --- init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index c88e315..367fb5a 100644 --- a/init.el +++ b/init.el @@ -200,6 +200,7 @@ (cc-mode . rainbow-delimiters-mode))) (use-package org + :straight org-plus-contrib :bind (("C-c a" . org-agenda) ("C-c c" . org-capture) ("C-c l" . org-store-link) @@ -249,6 +250,8 @@ (emacs-lisp .t) (python . t) (scheme . t))) + ;; latex preview settings + (add-to-list 'org-latex-packages-alist '("" "braket" t)) :config ;; abbrev expansion in org-mode (require 'org-tempo)) @@ -256,7 +259,8 @@ (use-package org-roam :straight t :hook ('after-init-hook . 'org-roam-mode) - :init (setq org-roam-directory "~/nextcloud/org/roam")) + :init (setq org-roam-directory "~/nextcloud/org/roam" + org-roam-db-update-method 'immediate)) (use-package magit :straight t From e874687d19a005efb11323fa5bb06acefca1a23a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 14 Nov 2020 22:12:15 +0100 Subject: [PATCH 38/38] ivy: ignore substring order and don't prefill ^ --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index 367fb5a..eafd145 100644 --- a/init.el +++ b/init.el @@ -163,6 +163,14 @@ (ivy-mode 1) (diminish 'ivy-mode) +;; ignore substring order, except for swiper +(setq ivy-re-builders-alist + '((swiper . ivy--regex-plus) + (t . ivy--regex-ignore-order))) +;; do not use caret, quite often we want start typing from the middle +(eval-after-load 'counsel ;counsel modifies this var + (setq ivy-initial-inputs-alist nil)) + ;; counsel for ivy-powered alternatives (straight-use-package 'counsel) (counsel-mode 1)