From 1b7dacecd394a2654e043397c19ccc0f7b1f0542 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 4 Jun 2020 14:32:40 -0400 Subject: [PATCH] [emacs] Cleaning up so I get my tools back --- emacs/.config/doom/config.org | 105 ++----------------- emacs/.config/doom/init.el | 183 +++++++++++++-------------------- emacs/.config/doom/packages.el | 20 +--- 3 files changed, 89 insertions(+), 219 deletions(-) diff --git a/emacs/.config/doom/config.org b/emacs/.config/doom/config.org index 2611e85..e4e6560 100644 --- a/emacs/.config/doom/config.org +++ b/emacs/.config/doom/config.org @@ -34,7 +34,6 @@ border. ** Fringe #+BEGIN_SRC emacs-lisp (nyan-mode) ;; progress in the form of a rainbow cat. -(beacon-mode) ;; show me the cursor! (add-hook 'after-init-hook #'global-emojify-mode) ;; emojis?! (add-hook 'prog-mode-hook #'goto-address-mode) ;; linify links! #+END_SRC @@ -104,9 +103,8 @@ Right now, just make sure I can connect to my local Mopidy server via MPDel. :desc "MPD Next track" "n" #'libmpdel-playback-next :desc "MPD Previous track" "p" #'libmpdel-playback-previous)) #+END_SRC -* RSS (elfeed) -** Setup feeds -Here we’re going to use Tiny Tiny RSS as a backend store for our RSS feeds. +* RSS +Here we’re going to use TinyTinyRSS as a backend store for our RSS feeds. #+BEGIN_SRC emacs-lisp (setq elfeed-protocol-ttrss-maxsize 200) ;; bigger than 200 is invalid (setq elfeed-feeds '("ttrss+https://powellc:hT7nPKAHa^fYwXZ*@reader.unbl.ink")) @@ -115,7 +113,7 @@ Here we’re going to use Tiny Tiny RSS as a backend store for our RSS feeds. (elfeed-protocol-enable) ;; Schedule feed update for every day at 3PM -(run-at-time "15:00" nil 'elfeed-update) +(run-at-time "15 min" nil 'elfeed-update) #+END_SRC Then wel’ll setup some nice defaults and font settings for viewing feeds in Elfeed. @@ -128,27 +126,19 @@ Then wel’ll setup some nice defaults and font settings for viewing feeds in El (add-hook! 'elfeed-mode-hook 'variable-pitch-mode) (add-hook! 'elfeed-show-mode-hook (text-scale-set 1.2)) #+END_SRC -** Key bindings -#+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix "r" - :desc "Update Elfeed" "u" #'elfeed-update)) -#+END_SRC * Formatting +Here we define the opposite function to fill-paragraph and then map it to Meta-z, which helps when undoing fill paragraph moves. #+BEGIN_SRC emacs-lisp -;;; It is the opposite of fill-paragraph (defun unfill-paragraph () "Takes a multi-line paragraph and makes it into a single line of text." (interactive) (let ((fill-column (point-max))) (fill-paragraph nil))) -;; Handy key definition (define-key global-map "\M-z" 'unfill-paragraph) #+END_SRC -PlantUML is pretty fantastic. This enables a mode for editing plantUML files in -Emacs. +PlantUML is pretty fantastic. This enables a mode for editing plantuml files in Emacs. #+BEGIN_SRC emacs-lisp ;; PlantUML is awesome for quick diagrams (add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode)) @@ -166,39 +156,10 @@ Handy clock to look up what timezone my co-workers are in! #+END_SRC * Org-mode ** Basic configuration - -Do I use deft? Not really. Every once in a while I think I will. This makes sure -it works when I get an impulse. -#+BEGIN_SRC emacs-lisp -(setq deft-extensions '("org")) -(setq deft-directory "~/org") -#+END_SRC - -A handful of mods here clean up org mode. Line numbers don’t mean much when -you’re folding and unfolding all the time. I also really enjoy the typography of -a serif font when I’m writing a lot of words. - +A handful of mods here clean up org mode. Line numbers don’t mean much when you’re folding and unfolding all the time. I also really enjoy the typography of a serif font when I’m writing a lot of words. #+BEGIN_SRC emacs-lisp (add-hook 'org-mode-hook #'doom-disable-line-numbers-h) -;;(add-hook 'org-mode-hook 'typo-mode) -; For org mode serif -;(add-hook 'org-mode-hook 'variable-pitch-mode) -;(add-hook 'org-mode-hook -; '(lambda () -; (mapc -; (lambda (face) ;; Other fonts with fixed-pitch. -; (set-face-attribute face nil :inherit 'fixed-pitch)) -; (list 'org-link -; 'org-block -; 'org-table -; 'org-block-begin-line -; 'org-block-end-line)))) -(add-hook 'org-mode-hook #'auto-fill-mode) -(remove-hook 'org-mode-hook #'word-wrap-mode) -#+END_SRC - -#+BEGIN_SRC emacs-lisp (after! org (setq org-directory (expand-file-name "~/org/") org-agenda-files (list org-directory) @@ -235,8 +196,8 @@ a serif font when I’m writing a lot of words. #+END_SRC ** Key bindings +I add only two custom mappings to the default org mode maps, a shortcut to my Inbox file and a quick way to save all open org mode files. #+BEGIN_SRC emacs-lisp -;; org-set-tags-command (setq +inbox-file "~/org/inbox.org") (defun +open-inbox-file () (interactive) @@ -246,15 +207,11 @@ a serif font when I’m writing a lot of words. (map! :leader :desc "Open inbox" "I" #'+open-inbox-file - :desc "Open today" "T" #'org-roam-today - :desc "Open today" "Y" #'org-roam-yesterday - :desc "Open tomorrow" "N" #'org-roam-tomorrow) -(map! :leader - (:prefix "f" :desc "Save all org buffers" "a" #'org-save-all-org-buffers)) + :desc "Save all org buffers" "A" #'org-save-all-org-buffers) #+END_SRC ** Agenda configuration #+BEGIN_SRC emacs-lisp -(setq org-agenda-span 5 +(setq org-agenda-span 3 org-agenda-start-day "1d") (defun +show-agenda () (interactive) @@ -268,27 +225,9 @@ a serif font when I’m writing a lot of words. (find-file +todo-file)) #+END_SRC ** Org-roam -I am absolutely in love with [[https://org-roam.readthedocs.io/en/develop/][Org-roam]]. Everything about it makes taking notes -easier. I just need to level up with Zettels and web publishing of my notes. - +I am absolutely in love with [[https://org-roam.readthedocs.io/en/develop/][Org-roam]]. Everything about it makes taking notes easier. I just need to level up with Zettels and web publishing of my notes. #+BEGIN_SRC emacs-lisp -(use-package! org-roam - :commands (org-roam-insert org-roam-find-file org-roam) - :init - (setq org-roam-directory "~/org/") - (map! :leader - :prefix "n" - :desc "Org-Roam-Insert" "i" #'org-roam-insert - :desc "Org-Roam-Find" "/" #'org-roam-find-file - :desc "Org-Roam-Buffer" "r" #'org-roam) - :config - (org-roam-mode +1)) - -(with-eval-after-load 'org-roam - (with-eval-after-load 'company - (with-eval-after-load 'org - (require 'company-org-roam) - (company-org-roam-init)))) +(setq org-roam-directory "~/org/") #+END_SRC * Novel @@ -377,32 +316,10 @@ Handful of fun aliases to make working in Eshell almost like a /real/ shell :smi "f" "(other-window 1) && find-file $1" "l" "ls -lh" "d" "dired $1" - "ff" "cd ~/src/ff/fifteen5" - "djtest" "cd ~/src/ff/fifteen5 & django-admin test -k $*" - "djsh" "cd ~/src/ff/fifteen5/ & django-admin shell_plus" - "djrun" "cd ~/src/ff/fifteen5/ & django-admin runserver_plus" - "dj" "cd ~/src/ff/fifteen5/ & django-admin $*" "gl" "(call-interactively 'magit-log-current)" "gs" "magit-status" "gc" "magit-commit")) #+END_SRC -* Ranger -Trick out ranger a bit. - -#+BEGIN_SRC emacs-lisp -(use-package! ranger - :commands (ranger deer ranger-override-dired-fn) - :config - (set-popup-rule! "^\\*ranger" :ignore t)) - -(map! - (:leader - (:prefix "a" - :desc "Ranger" "r" #'ranger - :desc "Deer" "d" #'deer))) - -(add-hook! dired-mode #'ranger-override-dired-fn) ;; Override dired-mode so it uses deer -#+END_SRC * Mastodon There's gotta be a way to get the token out of password-store for this. diff --git a/emacs/.config/doom/init.el b/emacs/.config/doom/init.el index b22ffac..b73d569 100644 --- a/emacs/.config/doom/init.el +++ b/emacs/.config/doom/init.el @@ -1,5 +1,18 @@ ;;; init.el -*- lexical-binding: t; -*- -;; Copy me to ~/.doom.d/init.el or ~/.config/doom/init.el, then edit me! + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find information about all of Doom's +;; modules and what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c g k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c g d') on a module to browse its +;; directory (for easy access to its source code). (doom! :input ;;chinese @@ -7,33 +20,32 @@ :completion company ; the ultimate code completion backend - (ivy ; a search engine for love and life - +icons - +fuzzy) - ;;helm ; the *other* search engine for love and life - ;;ido ; the other *other* search engine... + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + (ivy +fuzzy +icons) ; a search engine for love and life :ui ;;deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does - doom-dashboard ; a nifty spash screen for Emacs + doom-dashboard ; a nifty splash screen for Emacs doom-quit ; DOOM quit-message prompts when you quit Emacs - ;;fill-column ; a `fill-column' indicator + ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra - ;;indent-guides ; highlighted indent columns + ;;indent-guides ; highlighted indent columns minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API - nav-flash ; blink the current line after jumping - ;;neotree ; a project drawer, like NERDTree for vim + nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on (popup +defaults) ; tame sudden yet inevitable temporary windows - pretty-code ; replace bits of code with pretty symbols - ;; tabs ; an tab bar for Emacs + ;;pretty-code ; ligatures or substitute text with pretty symbols + ;;tabs ; an tab bar for Emacs treemacs ; a project drawer, like neotree but cooler unicode ; extended unicode support for various languages vc-gutter ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces zen ; distraction-free coding or writing @@ -42,27 +54,27 @@ file-templates ; auto-snippets for empty files fold ; (nigh) universal code folding (format +onsave) ; automated prettiness - ;;lispy ; vim for lisp, for people who dont like vim + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim multiple-cursors ; editing in many places at once ;;objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of ;;rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to - ;;word-wrap ; soft wrapping with language-aware indent + word-wrap ; soft wrapping with language-aware indent :emacs - (dired - +icons) + dired ; making dired pretty [functional] electric ; smarter, keyword-based electric-indent - ibuffer ; interactive buffer management + ibuffer ; interactive buffer management undo ; persistent, smarter undo for your inevitable mistakes vc ; version-control and Emacs, sitting in a tree :term - eshell ; a consistent, cross-platform shell (WIP) - ;;shell ; a terminal REPL for Emacs - term ; terminals in Emacs - ;;vterm ; another terminals in Emacs + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs :checkers syntax ; tasing you for every semicolon you forget @@ -75,10 +87,10 @@ direnv ;;docker editorconfig ; let someone else argue about tabs vs spaces - ein ; tame Jupyter notebooks with emacs - (eval +overlay) ; run code, run (also, repls) + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) gist ; interacting with github gists - lookup ; helps you navigate your code and documentation + lookup ; navigate your code and its documentation lsp ;;macos ; MacOS-specific commands magit ; a git porcelain for Emacs @@ -87,45 +99,49 @@ pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux ;;upload ; map local to remote projects via ssh/ftp - ;;wakatime :lang ;;agda ; types of types of types of types... - ;;assembly ; assembly for fun or debugging ;;cc ; C/C++/Obj-C madness - ;;clojure ; java with a lisp + ;;clojure ; java with a lisp ;;common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs - (crystal +lsp) ; ruby at the speed of c + ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - data ; config/data formats + ;;data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses ;;erlang ; an elegant language for a more civilized age - (elixir +lsp) ; erlang done right - elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses ;;ess ; emacs speaks statistics - ;;fsharp ; ML stands for Microsoft's Language - (go +lsp) ; the hipster dialect - ;;(haskell +intero) ; a language that's lazier than I am + ;;faust ; dsp, but you get to keep your soul + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + (go +lsp) ; the hipster dialect + ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; + ;;json ; At least it ain't XML ;;(java +meghanada) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) - julia ; a better, faster MATLAB + ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) ;;latex ; writing papers in Emacs has never been so fun - ledger ; an accounting system in Emacs + ;;lean + ;;factor + ledger ; an accounting system in Emacs ;;lua ; one-based indices? one-based indices - markdown ; writing docs for people to ignore - (nim +lsp) ; python + lisp at the speed of c + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org ; organize your plain life in plain text - +brain ; an org brain? - +dragndrop ; file drag & drop support +hugo +gnuplot +ipython ; ipython support for babel @@ -136,31 +152,30 @@ +present) ; using Emacs for presentations ;;perl ; write code no one else can comprehend ;;php ; perl's insecure younger brother - plantuml ; diagrams for confusing people more + plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - (python +lsp) ; beautiful is better than ugly + (python +lsp) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever - ;;racket ; a DSL for DSLs - rest ; Emacs as a REST client - (ruby +lsp) ; 1.step do {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() - ;;scala ; java, but good - scheme ; a fully conniving family of lisps - (sh +fish) ; she sells (ba|z|fi)sh shells on the C xor + ;;racket ; a DSL for DSLs + rest ; Emacs as a REST client + rst ; ReST in peace + (ruby +lsp +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;scheme ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - ;;web ; the tubes - ;;vala ; GObjective-C + web ; the tubes + yaml ; JSON, but readable :email - ;;(mu4e +gmail) ; WIP - notmuch ; WIP - ;;(wanderlust +gmail) ; WIP + ;;(mu4e +gmail) + notmuch + ;;(wanderlust +gmail) - ;; Applications are complex and opinionated modules that transform Emacs - ;; toward a specific purpose. They may have additional dependencies and - ;; should be loaded late. :app ;;calendar irc ; how neckbeards socialize @@ -168,55 +183,5 @@ ;;twitter ; twitter client https://twitter.com/vnought :config - ;; For literate config users. This will tangle+compile a config.org - ;; literate config in your `doom-private-dir' whenever it changes. literate - - ;; The default module sets reasonable defaults for Emacs. It also - ;; provides a Spacemacs-inspired keybinding scheme and a smartparens - ;; config. Use it as a reference for your own modules. (default +bindings +smartparens)) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(ansi-color-names-vector - ["#2b2a27" "#ff5d38" "#98be65" "#bcd42a" "#51afef" "#c678dd" "#46D9FF" "#ede0ce"]) - '(custom-safe-themes - (quote - ("2d1fe7c9007a5b76cea4395b0fc664d0c1cfd34bb4f1860300347cdad67fb2f9" "bd6ced8badda12f95e16e641d76d861de096c691720ede6388a226914e97cf23" "528d0ed2f87187406f4db88879555f03f1c9478018a49e2e35c84b666c97d44a" "a70b47c87e9b0940f6fece46656200acbfbc55e129f03178de8f50934ac89f58" "1f36ca86913068b7d8377a327394eecfff71be34119619f779cb229875ceec0c" "0eb3c0868ff890b0c4ee138069ce2a8936a8a69ba150efa6bfb9fb7c05af5ec3" "001c2ff8afde9c3e707a2eb3e810a0a36fb2b466e96377ac95968e7f8930a7c5" "2a3ffb7775b2fe3643b179f2046493891b0d1153e57ec74bbe69580b951699ca" "0fe9f7a04e7a00ad99ecacc875c8ccb4153204e29d3e57e9669691e6ed8340ce" "f951343d4bbe5a90dba0f058de8317ca58a6822faa65d8463b0e751a07ec887c" "423435c7b0e6c0942f16519fa9e17793da940184a50201a4d932eafe4c94c92d" "cdb3e7a8864cede434b168c9a060bf853eeb5b3f9f758310d2a2e23be41a24ae" "70cc30fd9d27a8d0d3ae82974ac2c409fd2cd5746470e2246778c6bec2d4857c" "5e96177f8bd6762e3f167fb7f5b6199fbff81704f654c66c772cd326d4fb78e3" "2878517f049b28342d7a360fd3f4b227086c4be8f8409f32e0f234d129cee925" "f30aded97e67a487d30f38a1ac48eddb49fdb06ac01ebeaff39439997cbdd869" default))) - '(fci-rule-color "#5B6268") - '(jdee-db-active-breakpoint-face-colors (cons "#2b2a27" "#ff5d38")) - '(jdee-db-requested-breakpoint-face-colors (cons "#2b2a27" "#98be65")) - '(jdee-db-spec-breakpoint-face-colors (cons "#2b2a27" "#3f444a")) - '(objed-cursor-color "#ff5d38") - '(safe-local-variable-values (quote ((url-max-redirections . 0)))) - '(vc-annotate-background "#2b2a27") - '(vc-annotate-color-map - (list - (cons 20 "#98be65") - (cons 40 "#a4c551") - (cons 60 "#b0cc3d") - (cons 80 "#bcd42a") - (cons 100 "#c1a623") - (cons 120 "#c5781c") - (cons 140 "#cb4b16") - (cons 160 "#c95a58") - (cons 180 "#c7699a") - (cons 200 "#c678dd") - (cons 220 "#d96fa6") - (cons 240 "#ec666f") - (cons 260 "#ff5d38") - (cons 280 "#cf563c") - (cons 300 "#9f5041") - (cons 320 "#6f4a45") - (cons 340 "#5B6268") - (cons 360 "#5B6268"))) - '(vc-annotate-very-old-color nil)) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el index 672a250..ab57aff 100644 --- a/emacs/.config/doom/packages.el +++ b/emacs/.config/doom/packages.el @@ -1,7 +1,6 @@ ;; -*- no-byte-compile: t; -*- -;;; ~/.config/doom/packages.el +;;; $DOOMDIR/packages.el ;;; - ;; Snippets! From hlissner! (package! emacs-snippets :recipe (:host github @@ -20,7 +19,7 @@ :recipe (:host github :repo "Fuco1/justify-kp")) -(package! eglot) +;;(package! eglot) ;; python stuffs (package! w3m) @@ -28,10 +27,6 @@ (package! pylint) (package! py-isort) (package! importmagic) -(package! flycheck-mypy) - -;; weather? -(package! wttrin) ;; slack ... okay one more time (package! slack) @@ -48,7 +43,6 @@ ;; handy tools (package! nov) (package! git-link) -(package! atomic-chrome) (package! auth-source-pass) (package! ivy-todo) (package! ivy-explorer) @@ -56,26 +50,20 @@ (package! web-search) (package! mpdel) (package! ivy-mpdel) -(package! org-caldav) -(package! elfeed-goodies) (package! elfeed-protocol) (package! deadgrep) (package! mastodon) (package! magit-circleci) (package! smog) -(package! writeroom-mode) ;; pretty tings up (package! srcery-theme) (package! kaolin-themes) (package! nyan-mode) (package! emojify) -(package! beacon) ; provides typographical replacements (package! typo) -;; modes! -(package! terraform-mode) - -(package! exec-path-from-shell :disable t) +;; TODO Remove when nose shows up on github again +(disable-packages! nose)