rice

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 32f543f0527b99bf508e1ae2e212bab880dcd016
parent 309fed93b82cfca8810b77fb16e86f219ae5407f
Author: Mark Feller <mjfeller1992@gmail.com>
Date:   Sun, 27 Sep 2020 14:23:00 -0600

cleanup emacs modules and move for 27.1 release

Diffstat:
Ddots/.config/emacs/.gitignore | 12------------
Mdots/.config/emacs/core/core-bootstrap.el | 8++++----
Mdots/.config/emacs/core/core-defuns.el | 18++++--------------
Rdots/.emacs.d/core/core-macos.el -> dots/.config/emacs/core/core-macos.el | 0
Ddots/.config/emacs/core/core-osx.el | 69---------------------------------------------------------------------
Mdots/.config/emacs/core/core-packages.el | 293++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mdots/.config/emacs/core/core-paths.el | 39++++++++++-----------------------------
Mdots/.config/emacs/core/core-ui.el | 17++++++++++-------
Mdots/.config/emacs/init.el | 8+-------
Ddots/.config/emacs/lisp/.keep | 0
Rdots/.emacs.d/lisp/acme/acme-theme.el -> dots/.config/emacs/lisp/acme/acme-theme.el | 0
Ddots/.config/emacs/lisp/helm/LICENSE | 674-------------------------------------------------------------------------------
Ddots/.config/emacs/lisp/helm/helm.el | 372-------------------------------------------------------------------------------
Adots/.config/emacs/lisp/init-local.el | 40++++++++++++++++++++++++++++++++++++++++
Mdots/.config/emacs/lisp/init-preload-local.el | 2+-
Ddots/.config/emacs/lisp/kubel/LICENSE | 674-------------------------------------------------------------------------------
Ddots/.config/emacs/lisp/kubel/README.md | 78------------------------------------------------------------------------------
Ddots/.config/emacs/lisp/kubel/kubel.el | 487-------------------------------------------------------------------------------
Rdots/.config/emacs/theme/poet-fork/LICENSE -> dots/.config/emacs/lisp/poet/LICENSE | 0
Rdots/.config/emacs/theme/poet-fork/README.md -> dots/.config/emacs/lisp/poet/README.md | 0
Rdots/.emacs.d/lisp/poet/poet-theme.el -> dots/.config/emacs/lisp/poet/poet-theme.el | 0
Rdots/.config/emacs/theme/poet-fork/tests/test.md -> dots/.config/emacs/lisp/poet/tests/test.md | 0
Rdots/.config/emacs/theme/poet-fork/tests/test.org -> dots/.config/emacs/lisp/poet/tests/test.org | 0
Mdots/.config/emacs/modules/module-company.el | 24++++++++----------------
Mdots/.config/emacs/modules/module-css.el | 6++++--
Mdots/.config/emacs/modules/module-docker.el | 4+++-
Mdots/.config/emacs/modules/module-eldoc.el | 3++-
Rdots/.emacs.d/modules/module-elfeed.el -> dots/.config/emacs/modules/module-elfeed.el | 0
Mdots/.config/emacs/modules/module-eshell.el | 45++++++++++++++++++++++-----------------------
Mdots/.config/emacs/modules/module-evil.el | 72++++++++++++++++++++++++++++++------------------------------------------
Mdots/.config/emacs/modules/module-git.el | 40+++++++++++++++-------------------------
Mdots/.config/emacs/modules/module-go.el | 153+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mdots/.config/emacs/modules/module-kubernetes.el | 37++++++++++++++++++++++++++++++-------
Mdots/.config/emacs/modules/module-ledger.el | 35++++++++++++++++++++++++++++++++++-
Mdots/.config/emacs/modules/module-multiple-cursors.el | 2+-
Mdots/.config/emacs/modules/module-notmuch.el | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
Mdots/.config/emacs/modules/module-org.el | 138+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mdots/.config/emacs/modules/module-projectile.el | 10++++++----
Mdots/.config/emacs/modules/module-python.el | 60++++++++++++++++++++++++++----------------------------------
Mdots/.config/emacs/modules/module-rust.el | 71++++++++++++++++++++++++++++++++++++-----------------------------------
Mdots/.config/emacs/modules/module-undo-tree.el | 4+++-
Mdots/.config/emacs/modules/module-yasnippet.el | 6+++---
Ddots/.config/emacs/theme/poet-fork/poet-theme.el | 310-------------------------------------------------------------------------------
Ddots/.emacs.d/core/core-bootstrap.el | 50--------------------------------------------------
Ddots/.emacs.d/core/core-defuns.el | 198-------------------------------------------------------------------------------
Ddots/.emacs.d/core/core-packages.el | 251-------------------------------------------------------------------------------
Ddots/.emacs.d/core/core-paths.el | 48------------------------------------------------
Ddots/.emacs.d/core/core-ui.el | 87-------------------------------------------------------------------------------
Ddots/.emacs.d/lisp/init-local.el | 42------------------------------------------
Ddots/.emacs.d/lisp/init-pre-local.el | 5-----
Ddots/.emacs.d/lisp/poet/LICENSE | 21---------------------
Ddots/.emacs.d/lisp/poet/README.md | 68--------------------------------------------------------------------
Ddots/.emacs.d/lisp/poet/tests/test.md | 68--------------------------------------------------------------------
Ddots/.emacs.d/lisp/poet/tests/test.org | 33---------------------------------
Ddots/.emacs.d/modules/module-company.el | 38--------------------------------------
Ddots/.emacs.d/modules/module-css.el | 35-----------------------------------
Ddots/.emacs.d/modules/module-docker.el | 33---------------------------------
Ddots/.emacs.d/modules/module-eldoc.el | 30------------------------------
Ddots/.emacs.d/modules/module-eshell.el | 54------------------------------------------------------
Ddots/.emacs.d/modules/module-evil.el | 80-------------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-git.el | 52----------------------------------------------------
Ddots/.emacs.d/modules/module-go.el | 132-------------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-kubernetes.el | 33---------------------------------
Ddots/.emacs.d/modules/module-ledger.el | 65-----------------------------------------------------------------
Ddots/.emacs.d/modules/module-multiple-cursors.el | 10----------
Ddots/.emacs.d/modules/module-notmuch.el | 86-------------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-org.el | 118-------------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-projectile.el | 40----------------------------------------
Ddots/.emacs.d/modules/module-python.el | 73-------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-rust.el | 76----------------------------------------------------------------------------
Ddots/.emacs.d/modules/module-undo-tree.el | 8--------
Ddots/.emacs.d/modules/module-yasnippet.el | 34----------------------------------
72 files changed, 639 insertions(+), 5109 deletions(-)

diff --git a/dots/.config/emacs/.gitignore b/dots/.config/emacs/.gitignore @@ -1,11 +0,0 @@ -*.elc -/elpa/ -/etc/* -/games/ -/lisp/* -/src/ - -!.keep -!/lisp/kubel -!/lisp/helm -!/lisp/redeam.el- \ No newline at end of file diff --git a/dots/.config/emacs/core/core-bootstrap.el b/dots/.config/emacs/core/core-bootstrap.el @@ -26,9 +26,10 @@ (require 'package) +(setq package-user-dir "~/.cache/elpa") (setq package-archives - '(("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") - ("melpa" . "http://melpa.milkbox.net/packages/") + '(("melpa-stable" . "https://stable.melpa.org/packages/") + ("melpa" . "https://melpa.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/") ("org" . "http://orgmode.org/elpa/"))) @@ -39,8 +40,7 @@ (package-refresh-contents) (package-install 'use-package) (package-install 'diminish) - (package-install 'bind-key) - (package-install 'bind-chord)) + (package-install 'bind-key)) (require 'use-package) (setq use-package-always-ensure t) diff --git a/dots/.config/emacs/core/core-defuns.el b/dots/.config/emacs/core/core-defuns.el @@ -21,19 +21,6 @@ ;;; Code: -(defun server-shutdown () - "Save buffers, Quit, and Shutdown (kill) server" - (interactive) - (save-some-buffers) - (kill-emacs)) - -(defun iwb() - "Indent Whole Buffer" - (interactive) - (delete-trailing-whitespace) - (indent-region (point-min) (point-max) nil) - (untabify (point-min) (point-max))) - (defun transpose-words (arg) "[Override for default transpose-words in simple.el] Interchange words around point, leaving point at end of @@ -195,7 +182,7 @@ is already narrowed." (defun resize-wide () (interactive) - (set-frame-width (selected-frame) 200) + (set-frame-width (selected-frame) 180) (set-frame-height (selected-frame) 50)) (defun resize-big () @@ -203,6 +190,9 @@ is already narrowed." (set-frame-width (selected-frame) 240) (set-frame-height (selected-frame) 70)) +(defun disable-line-numbers () + (display-line-numbers-mode -1)) + (provide 'core-defuns) ;;; core-defuns.el ends here diff --git a/dots/.emacs.d/core/core-macos.el b/dots/.config/emacs/core/core-macos.el diff --git a/dots/.config/emacs/core/core-osx.el b/dots/.config/emacs/core/core-osx.el @@ -1,69 +0,0 @@ -;;; core-osx.el --- solarized module for my emacs - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. -;;; Commentary: - -;;; Code: - -;; transparent title bar -(use-package ns-auto-titlebar - :config (ns-auto-titlebar-mode)) - -(setq ns-use-srgb-colorspace t) -(setq ns-use-proxy-icon nil) ; hide icon in title bar -(setq frame-title-format nil) ; hide text in title bar -(menu-bar-mode t) ; use macos menu bar - -(setq mac-option-modifier 'meta) -(setq mac-command-modifier 'hyper) - -;; Enable emoji, and stop the UI from freezing when trying to display them. -(if (fboundp 'set-fontset-font) - (set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend)) - -(use-package exec-path-from-shell - :demand - :config (exec-path-from-shell-initialize)) - -(defun finder () - "Opens file directory in Finder." - (interactive) - (let ((file (buffer-file-name))) - (if file - (shell-command - (format "%s %s" (executable-find "open") (file-name-directory file))) - (error "Buffer is not attached to any file.")))) - -(when (not (display-graphic-p)) - (defun bw/copy-from-osx () - "Copies the current clipboard content using the `pbcopy` command" - (shell-command-to-string "pbpaste")) - - (defun bw/paste-to-osx (text &optional push) - "Copies the top of the kill ring stack to the OSX clipboard" - (let ((process-connection-type nil)) - (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) - (process-send-string proc text) - (process-send-eof proc)))) - - (setq interprogram-cut-function 'bw/paste-to-osx) - (setq interprogram-paste-function 'bw/copy-from-osx)) - -(provide 'core-osx) - -;;; core-osx.el ends here diff --git a/dots/.config/emacs/core/core-packages.el b/dots/.config/emacs/core/core-packages.el @@ -20,11 +20,6 @@ ;;; Code: -;; (use-package paradox -;; :config -;; (progn (paradox-enable) -;; (add-hook 'paradox-menu-mode-hook (lambda () (display-line-numbers-mode 0))))) - (use-package swiper :demand :delight (ivy-mode) @@ -35,17 +30,18 @@ ("C-c C-o" . ivy-occur) ("C-c C-b" . ivy-switch-buffer) ("C-c C-k" . kill-buffer)) + (:map ivy-minibuffer-map + ("TAB" . ivy-partial-or-done)) :config - (progn (ivy-mode 1) - (setq ivy-height 6) - (setq enable-recursive-minibuffers t) - (setq swiper-include-line-number-in-search t) - (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial-or-done))) + (setq ivy-height 6) + (setq enable-recursive-minibuffers t) + (setq swiper-include-line-number-in-search t) + + (ivy-mode 1)) -;; ivy sorted via smex (use-package smex :demand - :config (setq smex-save-file (concat persistent-dir "/smex-items"))) + :config (setq smex-save-file "~/.cache/smex-items")) (use-package counsel :after (ivy) @@ -61,106 +57,104 @@ (use-package saveplace :config - (progn (setq save-place-file (concat persistent-dir "/places") - backup-by-copying t - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t))) + (setq save-place-file "~/.cache/places" + backup-by-copying t + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t)) (use-package ibuffer :bind (("C-x C-b" . ibuffer) :map ibuffer-mode-map - ("/ m" . ibuffer-set-filter-groups-by-mode)) + ("/ p" . ibuffer-projectile-set-filter-groups)) :config - (progn (setq ibuffer-default-sorting-mode 'major-mode - ibuffer-display-summary nil) - - (defun ibuffer-get-major-modes-ibuff-rules-list (mm-list result-list) - (if mm-list - (let* ((cur-mm (car mm-list)) - (next-res-list-el `(,(symbol-name cur-mm) (mode . ,cur-mm)))) - (ibuffer-get-major-modes-ibuff-rules-list - (cdr mm-list) (cons next-res-list-el result-list))) - result-list)) - - (defun ibuffer-get-major-modes-list () - (mapcar - (function (lambda (buffer) - (buffer-local-value 'major-mode (get-buffer buffer)))) - (buffer-list (selected-frame)))) - - (defun ibuffer-create-buffs-group () - (interactive) - (let* ((ignore-modes '(Buffer-menu-mode - compilation-mode - minibuffer-inactive-mode - ibuffer-mode - magit-process-mode - messages-buffer-mode - fundamental-mode - completion-list-mode - help-mode - Info-mode)) - (cur-bufs - (list (cons "Home" - (ibuffer-get-major-modes-ibuff-rules-list - (cl-set-difference - (remove-duplicates - (ibuffer-get-major-modes-list)) - ignore-modes) '()))))) - (setq ibuffer-saved-filter-groups cur-bufs) - (ibuffer-switch-to-saved-filter-groups "Home"))) - - (autoload 'ibuffer "ibuffer" "List buffers." t) - - (defun ibuffer-group-by-modes () - "Group buffers by modes." - (ibuffer-create-buffs-group)) - - (add-hook 'ibuffer-hook 'ibuffer-group-by-modes) - - (setq ibuffer-expert t) - - ;; Environment Variables - (setq ibuffer-show-empty-filter-groups nil) - (setq ibuffer-marked-char ?-) - (add-hook 'ibuffer-mode-hook (lambda () (ibuffer-auto-mode 1))) - - (defadvice ibuffer-update-title-and-summary (after remove-column-titles) - (with-no-warnings - (save-excursion - (set-buffer "*Ibuffer*") - (toggle-read-only 0) - (goto-char 1) - (search-forward "-\n" nil t) - (delete-region 1 (point)) - ;; (let ((window-min-height 1)) - ;; ;; save a little screen estate - ;; (shrink-window-if-larger-than-buffer)) - (toggle-read-only)))) - - (ad-activate 'ibuffer-update-title-and-summary) - - ;; Use human readable Size column instead of original one - (define-ibuffer-column size-h - (:name "Size" :inline t) - (cond - ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0))) - ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0))) - ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0))) - (t (format "%8d" (buffer-size))))) - - ;; Modify the default ibuffer-formats - (setq ibuffer-formats - '((mark modified read-only " " - (name 18 18 :left :elide) - " " - (size-h 9 -1 :right) - " " - (mode 16 16 :left :elide) - " " - filename-and-process))))) + (setq ibuffer-default-sorting-mode 'major-mode) + (setq ibuffer-display-summary nil) + (setq ibuffer-expert t) + (setq ibuffer-show-empty-filter-groups nil) + (setq ibuffer-marked-char ?-) + + (add-hook 'ibuffer-mode-hook 'disable-line-numbers) + (add-hook 'ibuffer-mode-hook (lambda () (ibuffer-auto-mode 1))) + + (defun ibuffer-get-major-modes-ibuff-rules-list (mm-list result-list) + (if mm-list + (let* ((cur-mm (car mm-list)) + (next-res-list-el `(,(symbol-name cur-mm) (mode . ,cur-mm)))) + (ibuffer-get-major-modes-ibuff-rules-list + (cdr mm-list) (cons next-res-list-el result-list))) + result-list)) + + (defun ibuffer-get-major-modes-list () + (mapcar + (function (lambda (buffer) + (buffer-local-value 'major-mode (get-buffer buffer)))) + (buffer-list (selected-frame)))) + + (defun ibuffer-create-buffs-group () + (interactive) + (let* ((ignore-modes '(Buffer-menu-mode + compilation-mode + minibuffer-inactive-mode + ibuffer-mode + magit-process-mode + messages-buffer-mode + fundamental-mode + completion-list-mode + help-mode + Info-mode)) + (cur-bufs + (list (cons "Home" + (ibuffer-get-major-modes-ibuff-rules-list + (cl-set-difference + (remove-duplicates + (ibuffer-get-major-modes-list)) + ignore-modes) '()))))) + (setq ibuffer-saved-filter-groups cur-bufs) + (ibuffer-switch-to-saved-filter-groups "Home"))) + + (autoload 'ibuffer "ibuffer" "List buffers." t) + + (defun ibuffer-group-by-modes () + "Group buffers by modes." + (ibuffer-create-buffs-group)) + + + (defadvice ibuffer-update-title-and-summary (after remove-column-titles) + (with-no-warnings + (save-excursion + (set-buffer "*Ibuffer*") + (toggle-read-only 0) + (goto-char 1) + (search-forward "-\n" nil t) + (delete-region 1 (point)) + ;; (let ((window-min-height 1)) + ;; ;; save a little screen estate + ;; (shrink-window-if-larger-than-buffer)) + (toggle-read-only)))) + + (ad-activate 'ibuffer-update-title-and-summary) + + ;; Use human readable Size column instead of original one + (define-ibuffer-column size-h + (:name "Size" :inline t) + (cond + ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0))) + ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0))) + ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0))) + (t (format "%8d" (buffer-size))))) + + ;; Modify the default ibuffer-formats + (setq ibuffer-formats + '((mark modified read-only " " + (name 18 18 :left :elide) + " " + (size-h 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " + filename-and-process)))) (use-package autopair :delight (autopair-mode) @@ -174,40 +168,51 @@ (use-package dired :ensure nil :bind (("C-x C-j" . dired-jump)) - :config - (progn (setq wdired-use-dired-vertical-movement 'sometimes) - - (set-face-attribute 'dired-directory nil - :inherit 'default - :foreground "#839496" - :weight 'bold) - - (setq dired-listing-switches "-la") - - (defun dired-sort-dir-first () - "Sort dired listings with directories first." - (save-excursion - (let (buffer-read-only) - (forward-line 2) ;; beyond dir. header - (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max))) - (set-buffer-modified-p nil))) - (defadvice dired-readin - (after dired-after-updating-hook first () activate) - "Sort dired listings with directories first before adding marks." - (dired-sort-dir-first)))) + :config + (setq wdired-use-dired-vertical-movement 'sometimes) + (setq dired-listing-switches "-la") + + (set-face-attribute 'dired-directory nil + :inherit 'default + :foreground "#839496" + :weight 'bold) + + (add-hook 'dired-mode-hook 'disable-line-numbers) + + (defun dired-sort-dir-first () + "Sort dired listings with directories first." + (save-excursion + (let (buffer-read-only) + (forward-line 2) ;; beyond dir. header + (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max))) + (set-buffer-modified-p nil))) + + (defadvice dired-readin + (after dired-after-updating-hook first () activate) + "Sort dired listings with directories first before adding marks." + (dired-sort-dir-first))) + +(use-package dired-subtree + :after dired + :bind (:map dired-mode-map + ("<tab>" . dired-subtree-toggle) + ("C-<tab>" . dired-subtree-cycle) + ("<backtab>" . dired-subtree-remove))) ;; better describe (use-package helpful :bind (("C-h f" . helpful-function) ("C-h o" . helpful-symbol) ("C-h k" . helpful-key) - ("C-h v" . helpful-variable))) + ("C-h v" . helpful-variable)) + :config + (add-hook 'helpful-mode-hook 'disable-line-numbers)) (use-package rg :config - (progn (rg-enable-default-bindings (kbd "M-s")) - (setq rg-executable "/usr/local/bin/rg"))) + (rg-enable-default-bindings (kbd "M-s")) + (setq rg-executable "/usr/local/bin/rg")) ;; window management (bind-keys @@ -231,31 +236,15 @@ ;; Misc Window Commands ("H-a" . balance-windows) ("H-t" . toggle-window-split) - ("H-<return>". toggle-fullscreen)) - -(use-package bind-chord - :config - (progn - (key-chord-mode 1) - - (bind-chords - ("wh" . windmove-left) - ("wj" . windmove-down) - ("wk" . windmove-up) - ("wl" . windmove-right) - - ("wt" . split-window-horizontally) - ("wv" . split-window-vertically) - ("wq" . delete-window) - ("wa" . balance-windows)) + ("H-<return>". toggle-fullscreen) - (setq key-chord-two-key-delay 0.075))) + ("H-c" . mjf/center-window)) (delight 'subword-mode "" "subword") +(delight 'undo-tree-mode "" "undo-tree") -;; woman -(add-hook 'woman-mode-hook (lambda () (display-line-numbers-mode 0))) -(add-hook 'Man-mode-hook (lambda () (display-line-numbers-mode 0))) +(add-hook 'woman-mode-hook 'disable-line-numbers) +(add-hook 'Man-mode-hook 'disable-line-numbers) (provide 'core-packages) diff --git a/dots/.config/emacs/core/core-paths.el b/dots/.config/emacs/core/core-paths.el @@ -29,35 +29,16 @@ (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) -(setq auto-save-list-file-prefix - (concat persistent-dir "/auto-save-list/.saves-")) - -(setq bookmark-default-file - (concat persistent-dir "bookmarks.el")) - -(setq ede-project-placeholder-cache-file - (concat temporary-file-directory "/ede-projects.el")) - -(setq semanticdb-default-save-directory - (concat temporary-file-directory "/semanticdb")) - -(setq abbrev-file-name - (concat persistent-dir "/abbrev_defs.el")) - -(setq tramp-persistency-file-name - (concat persistent-dir "/tramp.el")) - -(setq recentf-save-file - (concat persistent-dir "/recentf")) - -(setq org-id-locations-file - (concat persistent-dir "/org-id-locations.el")) - -(setq nsm-settings-file - (concat persistent-dir "/network-security.data")) - -(setq url-configuration-directory - (concat persistent-dir "/url/")) +(setq auto-save-list-file-prefix "~/.cache/auto-save-list/.saves-") +(setq bookmark-default-file "~/.cache/bookmarks.el") +(setq ede-project-placeholder-cache-file "~/.cache/ede-projects.el") +(setq semanticdb-default-save-directory "~/.cache/semanticdb") +(setq abbrev-file-name "~/.cache/abbrev_defs.el") +(setq tramp-persistency-file-name "~/.cache/tramp.el") +(setq recentf-save-file "~/.cache/recentf") +(setq org-id-locations-file "~/.cache/org-id-locations.el") +(setq nsm-settings-file "~/.cache/network-security.data") +(setq url-configuration-directory "~/.cache/url/") (unless (file-exists-p custom-file) (write-region "" nil custom-file)) diff --git a/dots/.config/emacs/core/core-ui.el b/dots/.config/emacs/core/core-ui.el @@ -43,18 +43,18 @@ (line-number-mode 0) (column-number-mode t) -(delete-selection-mode t) ; Delete Marked regions -(show-paren-mode t) ; Show matching parenthesis +(delete-selection-mode t) ; Delete Marked regions +(show-paren-mode t) ; Show matching parenthesis (setq-default indent-tabs-mode nil) -(setq-default tab-width 4) +(setq-default tab-width 8) (setq-default indicate-empty-lines nil) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) -(setq-default fill-column 80) +(setq-default fill-column 72) (add-hook 'before-save-hook 'delete-tailing-whitespace) @@ -65,19 +65,22 @@ (defun on-after-init () (unless (display-graphic-p (selected-frame)) (set-face-background 'default "unspecified-bg" (selected-frame)))) + (add-hook 'window-setup-hook 'on-after-init) ;; line numbers -(setq-default display-line-numbers-width 4) +(setq-default display-line-numbers-width 3) (setq display-line-numbers-type 'relative display-line-numbers-current-absolute t display-line-numbers-widen nil) ; don't count narrowed regions +(setq-default line-spacing 5) + (global-display-line-numbers-mode) ;; add some padding around the entire frame and fringes -(set-fringe-mode 15) -(set-frame-parameter nil 'internal-border-width 10) +(set-fringe-mode 25) +(set-frame-parameter nil 'internal-border-width 0) (provide 'core-ui) diff --git a/dots/.config/emacs/init.el b/dots/.config/emacs/init.el @@ -25,12 +25,6 @@ ;; Init ;;--------------------------------------------------------------------- -;; Added by Package.el. This must come before configurations of -;; installed packages. Don't delete this line. If you don't want it, -;; just comment it out by adding a semicolon to the start of the line. -;; You may delete these explanatory comments. -(package-initialize) - (defvar current-user (getenv (if (equal system-type 'windows-nt) "USERNAME" "USER"))) @@ -56,7 +50,7 @@ ;; Variables and Load Paths ;;--------------------------------------------------------------------- -(defvar emacs-dir (file-name-directory "~/.emacs.d/") +(defvar emacs-dir (file-name-directory "~/.config/emacs/") "The root dir of the Emacs distribution.") (defvar core-dir (expand-file-name "core" emacs-dir) diff --git a/dots/.config/emacs/lisp/.keep b/dots/.config/emacs/lisp/.keep diff --git a/dots/.emacs.d/lisp/acme/acme-theme.el b/dots/.config/emacs/lisp/acme/acme-theme.el diff --git a/dots/.config/emacs/lisp/helm/LICENSE b/dots/.config/emacs/lisp/helm/LICENSE @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<https://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/dots/.config/emacs/lisp/helm/helm.el b/dots/.config/emacs/lisp/helm/helm.el @@ -1,372 +0,0 @@ -;;; helm.el --- extension for controlling Kubernetes with limited permissions -*- lexical-binding: t; -*- - -;; Copyright (C) 2019, Mark Feller - -;; This file is NOT part of Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -;; USA - -;; Version: 0.1 -;; Author: Mark Feller -;; Keywords: helm k8s tools processes -;; License: GNU General Public License >= 3 -;; Package-Requires: ((transient "0.1.0") (emacs "25.3")) - -;;; Commentary: - -;;; Usage: - -;; M-x helm - -;;; Code: - -(require 'transient) - -(defvar helm-command "helm" - "Helm binary") - -(defvar kubectl-command "kubectl" - "Kubectl binary") - -(defconst helm--list-format - [("Name" 30 t) - ("Revision" 10 t) - ("Updated" 30 t) - ("Status" 10 t) - ("Chart" 20 t) - ("AppVersion" 10 t) - ("Namespace" 10 t)] - "List format.") - -(defvar helm-context - (replace-regexp-in-string - "\n" "" (shell-command-to-string "kubectl config current-context")) - "current context. tries to smart default.") - -(defun helm-set-context () - "Set the context." - (interactive) - (setq helm-context - (completing-read - "Select context: " - (split-string (shell-command-to-string "kubectl config view -o jsonpath='{.contexts[*].name}'") " "))) - (helm)) - -(defconst helm--list-sort-key - '("Name" . nil) - "Sort table on this key.") - -(defun helm--get-context () - "Utility function to return the proper context and namespace arguments." - (unless (equal helm-context "") - (list "--kube-context" helm-context))) - -(defun helm--buffer-name () - "Return helm buffer name." - (concat "*helm [" helm-context "]*")) - -(defun helm--propertize-status (status) - "Return the status in proper font color. - -STATUS is the pod status string." - (let ((pair (cdr (assoc status helm--status-colors)))) - (if pair - (propertize status 'font-lock-face `(:foreground ,pair)) - status))) - -(defun helm--get-command-prefix () - "Utility function to prefix the kubectl command with proper context and namespace." - (mapconcat 'identity (append '("helm") (helm--get-context)) " ")) - -(defun helm--list-entries () - "Create the entries for the service list." - (let ((output (helm--exec-string '("ls --output json")))) - (mapcar (lambda (x) - (list (cdr (car x)) - (vconcat (mapcar (lambda (y) - (format "%s" (cdr y))) x)))) - (cdr (car (cdr (json-read-from-string output))))))) - -(defun helm--exec (buffer-name async args) - "Utility function to run commands in the proper context and namespace. - -\"BUFFER-NAME\" is the buffer-name. Default to *helm-command*. -ASYNC is a bool. If true will run async. -ARGS is a ist of arguments." - (when (equal buffer-name "") - (setq buffer-name "*helm-command*")) - (when (get-buffer buffer-name) - (kill-buffer buffer-name)) - (if async - (apply #'start-process buffer-name buffer-name "helm" (append (helm--get-context) args)) - (apply #'call-process "helm" nil buffer-name nil (append (helm--get-context) args))) - (pop-to-buffer buffer-name)) - -(defun helm--exec-string (args) - "" - (shell-command-to-string - (mapconcat 'identity (append '("helm") (helm--get-context) args) " "))) - -(defun helm--pop-to-buffer (name) - "Utility function to pop to buffer or create it. - -NAME is the buffer name." - (unless (get-buffer name) - (get-buffer-create name)) - (pop-to-buffer name)) - -(defun helm--get-chart-under-cursor () - "Utility function to get the name of the pod under the cursor." - (aref (tabulated-list-get-entry) 0)) - -(defun helm-get-values (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Values - %s*" chart))) - (helm--exec buffer-name nil `("get" "values" ,chart)))) - -(defun helm-get-notes (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Notes - %s*" chart))) - (helm--exec buffer-name nil `("get" "notes" ,chart)))) - -(defun helm-get-manifest (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Manifest - %s*" chart))) - (helm--exec buffer-name nil `("get" "manifest" ,chart)))) - -(defun helm-get-hooks (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Hooks - %s*" chart))) - (helm--exec buffer-name nil `("get" "hooks" ,chart)))) - -(defun helm-get-status (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Status - %s*" chart))) - (helm--exec buffer-name nil `("status" ,chart)))) - -(defun helm-get-history (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm History - %s*" chart))) - (helm--exec buffer-name nil `("history" ,chart)))) - -(defun helm-rollback (revision &optional args) - "test" - (interactive (list (read-string "Revision: ") - (transient-args 'helm-rollback-popup))) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm History - %s*" chart))) - (message "Revision:" revision) - (let ((arg (append '("rollback") args (list chart revision)))) - (helm--exec buffer-name nil arg)))) - -(defun helm-delete (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm History - %s*" chart))) - (helm--exec buffer-name nil `("delete" ,chart)))) - -(defun helm-search (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm History - %s*" chart))) - (helm--exec buffer-name nil (list "search")))) - -(defun helm-repo-list (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Repo Add - %s*" chart))) - (helm--exec buffer-name nil (list "repo" "list")))) - -(defun helm-repo-list (&optional args) - "test" - (interactive) - (let* ((chart (helm--get-chart-under-cursor)) - (buffer-name (format "*Helm Repo Add - %s*" chart))) - (helm--exec buffer-name nil (list "repo" "update")))) - -(defun helm-version (&optional args) - (interactive (list (transient-args 'helm-version-popup))) - (let ((buffer-name (format "*Helm Version*"))) - (if (member "--short" args) - (message (helm--exec-string (append '("version") args))) - (helm--exec buffer-name nil (append '("version") args))))) - -;; ---------------------------------------------------------------------- -;; popups -;; ---------------------------------------------------------------------- - -(define-transient-command helm-history-popup () - "Helm History Menu" - ["Arguments" - ("-y" "YAML" "-o yaml") - ("-j" "JSON" "-o json") - ("--max" "Max revisions" "--max=10")] - ["Actions" - ("h" "History" helm-get-history)]) - -(define-transient-command helm-get-popup () - "Helm Values Menu" - ["Arguments" - ("-r" "revision" "--revision=")] - ["Actions" - ("v" "Values" helm-get-values) - ("n" "Notes" helm-get-notes) - ("m" "Manifest" helm-get-manifest) - ("h" "Hooks" helm-get-hooks)]) - -(define-transient-command helm-repo-popup () - "Helm Values Menu" - ["Arguments" - ("-r" "revision" "--revision=")] - ["Actions" - ;; ("a" "Add" helm-repo-add) - ;; ("i" "Index" helm-repo-index) - ("l" "List" helm-repo-list) - ;; ("r" "Remove" helm-repo-remove) - ("u" "Update" helm-repo-update) - ]) - -(define-transient-command helm-rollback-popup () - "Helm Rollback Menu" - ["Arguments" - ("-d" "simulate a rollback" "--dry-run") - ("-f" "force resource update" "--force") - ("-r" "performs pods restart if applicable" "--recreate-pods") - ("-D" "specify a description for he release" "--description=")] - ["Actions" - ("r" "Rollback" helm-rollback)]) - -(define-transient-command helm-delete-popup () - "Helm Rollback Menu" - ["Arguments" - ("-d" "simulate a rollback" "--dry-run") - ("-p" "remove the release from the store and make its name free for later use" "--purge") - ("-D" "specify a description for he release" "--description=")] - ["Actions" - ("k" "Delete" helm-delete)]) - -(define-transient-command helm-values-popup () - "Helm Values Menu" - ["Arguments" - ("-y" "YAML" "-o yaml") - ("-j" "JSON" "-o json") - ("-a" "dump all (computed) values" "--all") - ("-r" "revision" "--revision=")] - ["Actions" - ("v" "Values" helm-get-values)]) - -(define-transient-command helm-status-popup () - "Helm Values Menu" - ["Arguments" - ("-y" "YAML" "-o yaml") - ("-j" "JSON" "-o json") - ("-r" "Revision" "--revision=")] - ["Actions" - ("s" "Status" helm-get-status)]) - -(define-transient-command helm-search-popup () - "Helm Search Packges Menu" - ["Arguments" - ("-y" "yaml output format" "-o yaml") - ("-j" "json output format" "-o json") - ("-l" "long listings with each version on it's own line" "--versions") - ("-r" "Regexp" "")] - ["Actions" - ("S" "Search" helm-search)]) - -(define-transient-command helm-version-popup () - "Helm Version Menu" - ["Arguments" - ("-c" "client version only" "--client") - ("-s" "server version only" "--server") - ("-S" "print the version number" "--short")] - ["Actions" - ("V" "Version" helm-version)]) - -(define-transient-command helm-help-popup () - "Helm Menu" - ["Transient Commands" - [("s" "Status" helm-status-popup) - ("v" "Values" helm-values-popup) - ("d" "Describe" helm-get-popup)] - [("h" "History" helm-history-popup) - ("R" "Rollback" helm-rollback-popup) - ("k" "Delete" helm-delete-popup)] - [("r" "Repo" helm-repo-popup) - ("S" "Search" helm-search-popup)]] - ["Config" - ("C" "set kubernetes context" helm-set-context) - ("V" "get helm version information" helm-version-popup)] - ["Essential commands" - ("g" "refresh current buffer" helm) - ("?" "helm menu" helm-help-popup)]) - -;; mode map -(setq helm-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C") 'helm-set-context) - (define-key map (kbd "d") 'helm-get-popup) - (define-key map (kbd "v") 'helm-values-popup) - (define-key map (kbd "r") 'helm-repo-popup) - (define-key map (kbd "R") 'helm-rollback-popup) - (define-key map (kbd "k") 'helm-delete-popup) - (define-key map (kbd "s") 'helm-status-popup) - (define-key map (kbd "S") 'helm-search-popup) - (define-key map (kbd "V") 'helm-version-popup) - (define-key map (kbd "h") 'helm-history-popup) - (define-key map (kbd "?") 'helm-help-popup) - map)) - -;;;###autoload -(defun helm () - "Invoke the helm buffer." - (interactive) - (helm--pop-to-buffer (helm--buffer-name)) - (helm-mode)) - -(define-derived-mode helm-mode tabulated-list-mode "Helm" - "Special mode for helm buffers." - (buffer-disable-undo) - (kill-all-local-variables) - (setq truncate-lines t) - (setq mode-name "Helm") - (setq major-mode 'helm-mode) - (use-local-map helm-mode-map) - (setq tabulated-list-format helm--list-format) - (setq tabulated-list-entries 'helm--list-entries) - (setq tabulated-list-sort-key helm--list-sort-key) - (tabulated-list-init-header) - (tabulated-list-print) - (hl-line-mode 1) - (run-mode-hooks 'helm-mode-hook)) - -(provide 'helm) -;;; helm.el ends here diff --git a/dots/.config/emacs/lisp/init-local.el b/dots/.config/emacs/lisp/init-local.el @@ -0,0 +1,40 @@ +(resize-small) +(mjf/center-window) + +(setq-default mode-line-format + '((:propertize " " face mode-line-height) + "%e" + evil-mode-line-tag + mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position + (vc-mode vc-mode) + " " mode-line-modes mode-line-misc-info mode-line-end-spaces)) + +(setq mode-line-format + '((:propertize " " face mode-line-height) + "%e" + evil-mode-line-tag + mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position + (vc-mode vc-mode) + " " mode-line-modes mode-line-misc-info mode-line-end-spaces)) + +(exec-path-from-shell-initialize) + +(setq elfeed-feeds + `("https://thume.ca/atom.xml" + "https://lukesmith.xyz/rss.xml" + "https://nullprogram.com/feed/" + ("https://notrelated.libsyn.com/rss" podcast) + ("http://mfeller.io/rss.xml" personal) + ("https://planet.emacslife.com/atom.xml" emacs community) + ,(mjf/yt-playlist-feed "PLkG-zhy1pVumXUC8e1vdfTciqZgNcpvdq") + ,(mjf/yt-channel-feed "UCBa659QWEk1AI4Tg--mrJ2A") ; Tom Scott + ,(mjf/yt-channel-feed "UC0uTPqBCFIpZxlz_Lv1tk_g") + ,(mjf/yt-channel-feed "UCdJdEguB1F1CiYe7OEi3SBg") ; Jon Tron + ,(mjf/yt-channel-feed "UCEOXxzW2vU0P-0THehuIIeg") ; Captian D + ,(mjf/yt-channel-feed "UCrTNhL_yO3tPTdQ5XgmmWjA") ; Red Letter Media + ,(mjf/yt-channel-feed "UCgXiTWrFg05fTPfw1YLb5Ug") ; Triforce! + )) + +(mjf/initialize-gmail) + +(provide 'init-local) diff --git a/dots/.config/emacs/lisp/init-preload-local.el b/dots/.config/emacs/lisp/init-preload-local.el @@ -1,6 +1,6 @@ (setq shell-file-name "/bin/zsh") -(load-file (expand-file-name "theme/poet-fork/poet-theme.el" emacs-dir)) +(load-file (expand-file-name "lisp/poet/poet-theme.el" emacs-dir)) (load-theme 'poet) (provide 'init-preload-local) diff --git a/dots/.config/emacs/lisp/kubel/LICENSE b/dots/.config/emacs/lisp/kubel/LICENSE @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<https://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/dots/.config/emacs/lisp/kubel/README.md b/dots/.config/emacs/lisp/kubel/README.md @@ -1,78 +0,0 @@ -[![MELPA](https://melpa.org/packages/kubel-badge.svg)](https://melpa.org/#/kubel) - -# kubel - -Emacs extension for controlling Kubernetes with limited permissions. - -## Features -This is mostly pod management for now. More may come. - -- switch context and namespace -- show pods -- get pod details -- tail container logs (possibly with `-f` follow flag) -- copy pod name to clipboard -- copy container log command to clipboard -- port forward a pod to your localhost - -## Installation - -Get it from Melpa, or copy and load the `kubel.el` file. - -## Usage - -To list the pods in your current context and namespace, call -``` -M-x kubel -``` -To set said namespace and context, respectively call -``` -M-x kubel-set-namespace -M-x kubel-set-context -``` -Note that namespace will autocomplete but not context, -this is because I interact with kubernetes through a user who -does not have permissions to list namespaces. - -## Shortcuts - -On the kubel screen, place your cursor on the pod -``` -enter => get pod details -h => help popup -C => set context -n => set namespace -g => refresh pods -p => port forward pod -e => exec into pod -d => describe popup -l => log popup -c => copy popup -k => delete pod -j => jab deployment to force rolling update -``` - -## Customize - -By default, kubel log tails from the last 100 lintes, you can change the `kubel-log-tail-n` variable to set another line number. - - -## TODO -- [x] Pods -- [x] Deployments -- [x] Services -- [x] Config map -- [x] Jobs -- [x] Ingress -- [ ] HPA -- [ ] Endpoints -- [ ] Accounts -- [ ] Secrets -- [x] Delete pods -- [x] View logs -- [x] Describe -- [ ] Edit -- [x] Switch clusters -- [ ] Apply manifest -- [x] exec -- [ ] logs for previous instance diff --git a/dots/.config/emacs/lisp/kubel/kubel.el b/dots/.config/emacs/lisp/kubel/kubel.el @@ -1,487 +0,0 @@ -;;; kubel.el --- extension for controlling Kubernetes with limited permissions -*- lexical-binding: t; -*- - -;; Copyright (C) 2018, Adrien Brochard - -;; This file is NOT part of Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -;; USA - -;; Version: 1.0 -;; Author: Adrien Brochard -;; Keywords: kubernetes k8s tools processes -;; URL: https://github.com/abrochard/kubel -;; License: GNU General Public License >= 3 -;; Package-Requires: ((transient "0.1.0") (emacs "25.3")) - -;;; Commentary: - -;; Emacs extension for controlling Kubernetes with limited permissions. -;; Mostly focuses on pod management for now. - -;;; Usage: - -;; To list the pods in your current context and namespace, call -;; -;; M-x kubel -;; -;; To set said namespace and context, respectively call -;; -;; M-x kubel-set-namespace -;; M-x kubel-set-context -;; -;; Note that namespace will autocomplete but not context, -;; this is because I interact with kubernetes through a user who -;; does not have permissions to list namespaces. - -;;; Shortcuts: - -;; On the kubel screen, place your cursor on the pod -;; -;; enter => get pod details -;; h => help popup -;; C => set context -;; n => set namespace -;; g => refresh pods -;; p => port forward pod -;; e => exec into pod -;; d => describe popup -;; l => log popup -;; c => copy popup -;; k => delete pod -;; j => jab deployment to force rolling update -;; - -;;; Customize: - -;; By default, kubel log tails from the last 100 lines, you can change the `kubel-log-tail-n` variable to set another line number. - -;;; Code: - -(require 'transient) - -(defconst kubel--list-format - [("Name" 50 t) - ("Ready" 10 t) - ("Status" 20 t) - ("Restarts" 10 t) - ("Age" 15 t)] - "List format.") - -(defconst kubel--list-sort-key - '("Name" . nil) - "Sort table on this key.") - -(defconst kubel--status-colors - (let ((warning 'DarkOrange) - (error "#bf360c") - (good "#388E3C")) - `(("Pending" . DarkOrange) - ("ContainerCreating" . DarkOrange) - ("Running" . ,good) - ("Completed" . ,good) - ("Error" . ,error) - ("CrashLoopBackOff" . ,error) - ("ImagePullBackOff" . ,error) - ("Terminating" . ,error))) - "Associative list of status to color.") - -(defvar kubel-namespace "" - "Current namespace.") -(defvar kubel-context - (replace-regexp-in-string - "\n" "" (shell-command-to-string "kubectl config current-context")) - "current context. tries to smart default.") - -(defvar kubel-log-tail-n "100" - "Number of lines to tail.") - -(defun kubel--buffer-name () - "Return kubel buffer name." - (concat "*kubel (" kubel-namespace ") [" kubel-context "]*")) - -(defun kubel--propertize-status (status) - "Return the status in proper font color. - -STATUS is the pod status string." - (let ((pair (cdr (assoc status kubel--status-colors)))) - (if pair - (propertize status 'font-lock-face `(:foreground ,pair)) - status))) - -(defun kubel--list-entries () - "Create the entries for the service list." - (let ((temp (list))) - (with-temp-buffer - (insert (shell-command-to-string (concat (kubel--get-command-prefix) " get pods --no-headers=true"))) - (goto-char (point-min)) - (while (re-search-forward "^\\([a-z0-9\-]+\\) +\\([0-9]+/[0-9]+\\) +\\(\\w+\\) +\\([0-9]+\\) +\\([0-9a-z]+\\)$" (point-max) t) - (setq temp (append temp (list (list (match-string 1) (vector (match-string 1) (match-string 2) (kubel--propertize-status (match-string 3)) (match-string 4) (match-string 5))))))) - ) - temp)) - -(defun kubel--pop-to-buffer (name) - "Utility function to pop to buffer or create it. - -NAME is the buffer name." - (unless (get-buffer name) - (get-buffer-create name)) - (pop-to-buffer name)) - -(defun kubel--exec (buffer-name async args) - "Utility function to run commands in the proper context and namespace. - -\"BUFFER-NAME\" is the buffer-name. Default to *kubel-command*. -ASYNC is a bool. If true will run async. -ARGS is a ist of arguments." - (when (equal buffer-name "") - (setq buffer-name "*kubel-command*")) - (when (get-buffer buffer-name) - (kill-buffer buffer-name)) - (if async - (apply #'start-process buffer-name buffer-name "kubectl" (append (kubel--get-context-namespace) args)) - (apply #'call-process "kubectl" nil buffer-name nil (append (kubel--get-context-namespace) args))) - (pop-to-buffer buffer-name)) - -(defun kubel--get-pod-under-cursor () - "Utility function to get the name of the pod under the cursor." - (aref (tabulated-list-get-entry) 0)) - -(defun kubel--get-context-namespace () - "Utility function to return the proper context and namespace arguments." - (append - (unless (equal kubel-context "") - (list "--context" kubel-context)) - (unless (equal kubel-namespace "") - (list "-n" kubel-namespace)))) - -(defun kubel--get-command-prefix () - "Utility function to prefix the kubectl command with proper context and namespace." - (mapconcat 'identity (append '("kubectl") (kubel--get-context-namespace)) " ")) - -(defun kubel--get-containers (pod-name) - "List the containers in a pod. - -POD-NAME is the name of the pod." - (split-string - (shell-command-to-string - (format "%s get pod %s -o jsonpath='{.spec.containers[*].name}'" (kubel--get-command-prefix) pod-name)) " ")) - -(defun kubel--select-resource (name) - "Prompt user to select an instance out of a list of resources. - -NAME is the string name of the resource." - (let ((cmd (format "%s get %s -o=jsonpath='{.items[*].metadata.name}'" - (kubel--get-command-prefix) name))) - (completing-read (concat (s-upper-camel-case name) ": ") - (split-string (shell-command-to-string cmd) " ")))) - -(defun kubel--describe-resource (name &optional yaml) - "Describe a specific resource. - -NAME is the string name of the resource to decribe. -YAML is boolean to show resource as yaml" - (let* ((resource (kubel--select-resource name)) - (buffer-name (format "*kubel - %s - %s*" name resource))) - (if yaml - (kubel--exec buffer-name nil (list "get" name "-o" "yaml" resource)) - (kubel--exec buffer-name nil (list "describe" name resource))) - (when yaml - (yaml-mode)) - (beginning-of-buffer))) - -;; interactive -(defun kubel-get-pod-details () - "Get the details of the pod under the cursor." - (interactive) - (let* ((pod (kubel--get-pod-under-cursor)) - (buffer-name (format "*kubel - pod - %s*" pod))) - (kubel--exec buffer-name nil (list "describe" "pod" (kubel--get-pod-under-cursor))) - (beginning-of-buffer))) - -(defun kubel--default-tail-arg (args) - "Ugly function to make sure that there is at least the default tail. - -ARGS is the arg list from transient." - (if (car (remove nil (mapcar (lambda (x) - (string-prefix-p "--tail=" x)) args))) - args - (append args (list (concat "--tail=" kubel-log-tail-n))))) - -(defun kubel-get-pod-logs (&optional args) - "Get the last N logs of the pod under the cursor. - -ARGS is the arguments list from transient." - (interactive - (list (transient-args 'kubel-log-popup))) - (let* ((pod (kubel--get-pod-under-cursor)) - (containers (kubel--get-containers pod)) - (container (if (equal (length containers) 1) - (car containers) - (completing-read "Select container: " containers))) - (buffer-name (format "*kubel - logs - %s - %s*" pod container)) - (async nil)) - (when (member "-f" args) - (setq async t)) - (kubel--exec buffer-name async - (append '("logs") (kubel--default-tail-arg args) (list pod container))))) - -(defun kubel-copy-pod-name () - "Copy the name of the pod under the cursor." - (interactive) - (kill-new (kubel--get-pod-under-cursor)) - (message "Pod name copied to kill-ring")) - -(defun kubel-copy-log-command () - "Copy the streaming log command of the pod under the cursor." - (interactive) - (kill-new (concat (kubel--get-command-prefix) - " logs -f --tail=" kubel-log-tail-n " " - (kubel--get-pod-under-cursor))) - (message "Log command copied to kill-ring")) - -(defun kubel-copy-command-prefix () - "Copy the kubectl command prefix." - (interactive) - (kill-new (kubel--get-command-prefix)) - (message "Command prefix copied to kill-ring")) - -(defun kubel-set-namespace (namespace) - "Set the namespace. - -NAMESPACE is the namespace." - (interactive "MNamespace: ") - (when (get-buffer (kubel--buffer-name)) - (kill-buffer (kubel--buffer-name))) - (setq kubel-namespace namespace) - (kubel)) - -(defun kubel-set-context () - "Set the context." - (interactive) - (setq kubel-context - (completing-read - "Select context: " - (split-string (shell-command-to-string "kubectl config view -o jsonpath='{.contexts[*].name}'") " "))) - (kubel)) - -(defun kubel-port-forward-pod (p) - "Port forward a pod to your local machine. - -P is the port as integer." - (interactive "nPort: ") - (let* ((port (format "%s" p)) - (pod (kubel--get-pod-under-cursor)) - (buffer-name (format "*kubel - port-forward - %s:%s*" pod port))) - (kubel--exec buffer-name t (list "port-forward" pod (format "%s:%s" port port))))) - -(defun kubel-describe-ingress (&optional arg) - "Show the ingress details. - -ARG is the optional param to see yaml." - (interactive "P") - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--describe-resource "ingress" t) - (kubel--describe-resource "ingress"))) - - -(defun kubel-describe-service (&optional arg) - "Descibe a service. - -ARG is the optional param to see yaml." - (interactive "P") - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--describe-resource "service" t) - (kubel--describe-resource "service"))) - -(defun kubel-describe-pod (&optional arg) - "Descibe a service. - -ARG is the optional param to see yaml." - (interactive "P") - (let* ((pod (kubel--get-pod-under-cursor)) - (buffer-name (format "*kubel - Pod - %s*" pod))) - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--exec buffer-name nil (list "describe" "pod" pod "-o" "yaml")) - (kubel--exec buffer-name nil (list "describe" "pod" pod))))) - -(defun kubel-describe-configmaps (&optional arg) - "Describe a configmap. - -ARG is the optional param to see yaml." - (interactive "P") - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--describe-resource "configmap" t) - (kubel--describe-resource "configmap"))) - -(defun kubel-describe-deployment (&optional arg) - "Describe a deployment. - -ARG is the optional param to see yaml." - (interactive "P") - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--describe-resource "deployment" t) - (kubel--describe-resource "deployment"))) - -(defun kubel-describe-job (&optional arg) - "Describe a job. - -ARG is the optional param to see yaml." - (interactive "P") - (if (or arg (transient-args 'kubel-describe-popup)) - (kubel--describe-resource "job" t) - (kubel--describe-resource "job"))) - -(defun kubel-exec-pod () - "Kubectl exec into the pod under the cursor." - (interactive) - (let* ((pod (kubel--get-pod-under-cursor)) - (containers (kubel--get-containers pod)) - (container (if (equal (length containers) 1) - (car containers) - (completing-read "Select container: " containers)))) - (eshell) - (insert (format "%s exec -it %s -c %s /bin/sh" (kubel--get-command-prefix) pod container)))) - -(defun kubel-delete-pod () - "Kubectl delete pod under cursor." - (interactive) - (let* ((pod (kubel--get-pod-under-cursor)) - (buffer-name (format "*kubel - delete pod -%s" pod)) - (args (list "delete" "pod" pod))) - (when (transient-args 'kubel-delete-popup) - (setq args (append args (list "--force" "--grace-period=0")))) - (kubel--exec buffer-name t args))) - -(defun kubel-jab-deployment () - "Make a trivial patch to force a new deployment. - -See https://github.com/kubernetes/kubernetes/issues/27081" - (interactive) - (let* ((deployment (kubel--select-resource "deployment")) - (buffer-name (format "*kubel - bouncing - %s*" deployment))) - (kubel--exec buffer-name nil (list "patch" "deployment" deployment "-p" - (format "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"%s\"}}}}}" - (round (time-to-seconds))))))) - -;; popups -;; (magit-define-popup kubel-log-popup -;; "Popup for kubel log menu" -;; 'kubel -;; :switches '((?f "Follow" "-f") (?p "Previous" "-p")) -;; :options '((?n "lines" "100")) -;; :actions '("Kubel Log Menu" -;; (?l "Tail logs for pod" kubel-get-pod-logs))) - -(define-infix-argument kubel-log-popup:--tail () - :description "Tail" - :class 'transient-option - :shortarg "-n" - :argument "--tail=") - -(define-transient-command kubel-log-popup () - "Kubel Log Menu" - ["Arguments" - ("-f" "Follow" "-f") - ("-p" "Previous" "-p") - (kubel-log-popup:--tail)] - ["Actions" - ("l" "Tail pod logs" kubel-get-pod-logs)]) - -(define-transient-command kubel-copy-popup () - "Kubel Copy Menu" - ["Actions" - ("c" "Copy pod name" kubel-copy-pod-name) - ("l" "Copy pod log command" kubel-copy-log-command) - ("p" "Copy command prefix" kubel-copy-command-prefix)]) - -(define-transient-command kubel-delete-popup () - "Kubel Delete menu" - ["Arguments" - ("-f" "Force" "--force --grace-period=0")] - ["Actions" - ("k" "Delete pod" kubel-delete-pod)]) - -(define-transient-command kubel-describe-popup () - "Kubel Describe Menu" - ["Arguments" - ("-y" "Yaml" "-o yaml")] - ["Actions" - ("d" "Deployment" kubel-describe-deployment) - ("s" "Service" kubel-describe-service) - ("p" "Pod" kubel-describe-pod) - ("j" "Job" kubel-describe-job) - ("i" "Ingress" kubel-describe-ingress) - ("c" "Configmap" kubel-describe-configmaps)]) - -(define-transient-command kubel-help-popup () - "Kubel Menu" - ["Actions" - ("ENTER" "Pod details" kubel-get-pod-details) - ("C" "Set context" kubel-set-context) - ("n" "Set namespace" kubel-set-namespace) - ("g" "Refresh" kubel-mode) - ("p" "Port forward" kubel-port-forward-pod) - ("l" "Logs" kubel-log-popup) - ("c" "Copy" kubel-copy-popup) - ("d" "Describe" kubel-describe-popup) - ("e" "Exec" kubel-exec-pod) - ("k" "Delete" kubel-delete-popup) - ("j" "Jab" kubel-jab-deployment)]) - -;; mode map -(setq kubel-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "RET") 'kubel-get-pod-details) - (define-key map (kbd "C") 'kubel-set-context) - (define-key map (kbd "n") 'kubel-set-namespace) - (define-key map (kbd "g") 'kubel-mode) - (define-key map (kbd "p") 'kubel-port-forward-pod) - (define-key map (kbd "l") 'kubel-log-popup) - (define-key map (kbd "c") 'kubel-copy-popup) - (define-key map (kbd "h") 'kubel-help-popup) - (define-key map (kbd "d") 'kubel-describe-popup) - (define-key map (kbd "e") 'kubel-exec-pod) - (define-key map (kbd "k") 'kubel-delete-popup) - (define-key map (kbd "j") 'kubel-jab-deployment) - map) -) - -;;;###autoload -(defun kubel () - "Invoke the kubel buffer." - (interactive) - (kubel--pop-to-buffer (kubel--buffer-name)) - (kubel-mode) - (message (concat "Namespace: " kubel-namespace))) - -(define-derived-mode kubel-mode tabulated-list-mode "Kubel" - "Special mode for kubel buffers." - (buffer-disable-undo) - (kill-all-local-variables) - (setq truncate-lines t) - (setq mode-name "Kubel") - (setq major-mode 'kubel-mode) - (use-local-map kubel-mode-map) - (setq tabulated-list-format kubel--list-format) - (setq tabulated-list-entries 'kubel--list-entries) - (setq tabulated-list-sort-key kubel--list-sort-key) - (tabulated-list-init-header) - (tabulated-list-print) - (hl-line-mode 1) - (run-mode-hooks 'kubel-mode-hook)) - -(provide 'kubel) -;;; kubel.el ends here diff --git a/dots/.config/emacs/theme/poet-fork/LICENSE b/dots/.config/emacs/lisp/poet/LICENSE diff --git a/dots/.config/emacs/theme/poet-fork/README.md b/dots/.config/emacs/lisp/poet/README.md diff --git a/dots/.emacs.d/lisp/poet/poet-theme.el b/dots/.config/emacs/lisp/poet/poet-theme.el diff --git a/dots/.config/emacs/theme/poet-fork/tests/test.md b/dots/.config/emacs/lisp/poet/tests/test.md diff --git a/dots/.config/emacs/theme/poet-fork/tests/test.org b/dots/.config/emacs/lisp/poet/tests/test.org diff --git a/dots/.config/emacs/modules/module-company.el b/dots/.config/emacs/modules/module-company.el @@ -22,24 +22,16 @@ ;;; Code: (use-package company - :ensure t - :demand :delight (company-mode nil "company") + :demand :config - (progn (setq company-idle-delay 0) - (setq company-tooltip-limit 10) - (setq company-echo-delay 0) - (setq company-tooltip-flip-when-above t) - (setq company-begin-commands '(self-insert-command)) - - ;; Face Configuration - (set-face-attribute 'company-tooltip-selection nil :background "#ddffdd") - (set-face-attribute 'company-tooltip-selection nil :background "#cee7cf") - (set-face-attribute 'company-tooltip-common nil :inherit 'fixed-pitch :foreground nil :underline nil :weight 'bold) - (set-face-attribute 'company-scrollbar-fg nil :background "#388E3C") - (set-face-attribute 'company-preview-common nil :underline nil) - (set-face-attribute 'company-tooltip-common nil :underline nil) - (set-face-attribute 'company-tooltip-common-selection nil :underline nil))) + (setq company-idle-delay 0) + (setq company-tooltip-limit 10) + (setq company-echo-delay 0) + (setq company-tooltip-flip-when-above t) + (setq company-begin-commands '(self-insert-command)) + + (global-company-mode)) (provide 'module-company) diff --git a/dots/.config/emacs/modules/module-css.el b/dots/.config/emacs/modules/module-css.el @@ -21,9 +21,11 @@ ;;; Code: -(use-package scss-mode) +(use-package scss-mode + :disable) -(use-package less-css-mode) +(use-package less-css-mode + :disable) (use-package css-eldoc :after (eldoc)) diff --git a/dots/.config/emacs/modules/module-docker.el b/dots/.config/emacs/modules/module-docker.el @@ -24,7 +24,9 @@ (use-package docker :disabled) -(use-package dockerfile-mode) +(use-package dockerfile-mode + :config + (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))) (provide 'module-docker) diff --git a/dots/.config/emacs/modules/module-eldoc.el b/dots/.config/emacs/modules/module-eldoc.el @@ -22,7 +22,8 @@ ;;; Code: (use-package eldoc - :delight (eldoc-mode)) + :delight (eldoc-mode) + :config (global-eldoc-mode)) (provide 'module-eldoc) diff --git a/dots/.emacs.d/modules/module-elfeed.el b/dots/.config/emacs/modules/module-elfeed.el diff --git a/dots/.config/emacs/modules/module-eshell.el b/dots/.config/emacs/modules/module-eshell.el @@ -21,35 +21,34 @@ ;;; Code: -(use-package eshell - :config - (progn (setq eshell-directory-name "~/.emacs.d/persistent/eshell") - - (setq eshell-cmpl-cycle-completions nil - eshell-buffer-maximum-lines 20000 ; auto truncate after 20k lines - eshell-history-size 350 ; history size - eshell-buffer-shorthand t ; buffer shorthand -> echo foo > #'buffer - eshell-highlight-prompt nil ; my prompt is easy enough to see - eshell-plain-echo-behavior t) ; treat 'echo' like shell echo - - ;;(add-to-list 'eshell-visual-commands '("ncmpcpp" "htop")) - - (add-to-list 'eshell-load-hook 'set-exec-path-from-shell-PATH))) - -;; -;; defuns -;; - -(defun set-exec-path-from-shell-PATH () - "Set up Emacs' `exec-path' and PATH environment variable to match that used by the user's shell. - This is particularly useful under Mac OSX, where GUI apps are - not started from a shell." +(defun mjf/set-exec-path-from-shell-PATH () + "Set up Emacs' `exec-path` and PATH environment variable to + match that used by the user's shell. This is particularly + useful under macOS, where GUI apps are not started from a + shell." (interactive) (let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) (setenv "PATH" path-from-shell) (setq exec-path (split-string path-from-shell path-separator)))) +(use-package eshell + :bind + (:map eshell-mode-map + ("C-l". evil-scroll-line-to-top)) + + :config + (setq eshell-directory-name "~/.cache/eshell" + eshell-cmpl-cycle-completions nil + eshell-buffer-maximum-lines 20000 + eshell-history-size 350 + eshell-buffer-shorthand t ; buffer shorthand -> echo foo > #'buffer + eshell-highlight-prompt nil + eshell-plain-echo-behavior t) ; treat 'echo' like shell echo + + (add-hook 'eshell-mode-hook 'disable-line-numbers) + (add-to-list 'eshell-load-hook 'mjf/set-exec-path-from-shell-PATH)) + (provide 'module-eshell) ;;; module-eshell.el ends here diff --git a/dots/.config/emacs/modules/module-evil.el b/dots/.config/emacs/modules/module-evil.el @@ -22,41 +22,27 @@ ;;; Code: (use-package evil + :bind + (:map evil-normal-state-map ("C-u" . evil-scroll-up)) + (:map evil-visual-state-map ("C-u" . evil-scroll-up)) + (:map evil-insert-state-map ("C-u" . evil-scroll-up)) + :config - (progn (setq evil-mode-line-format '(before . mode-line-front-space)) - (setq evil-echo-state nil) - - ;; prevent esc-key from translating to meta-key in terminal mode - (setq evil-esc-delay 0) - - (evil-mode 1) - - (define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up) - (define-key evil-visual-state-map (kbd "C-u") 'evil-scroll-up) - (define-key evil-insert-state-map (kbd "C-u") - (lambda () - (interactive) - (evil-delete (point-at-bol) (point)))))) - -(evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) -(evil-define-key 'normal neotree-mode-map (kbd "o") 'neotree-quick-look) -(evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) -(evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) -(evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) -(evil-define-key 'normal neotree-mode-map (kbd "n") 'neotree-next-line) -(evil-define-key 'normal neotree-mode-map (kbd "p") 'neotree-previous-line) -(evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) -(evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) - -;; evil-goggles will slightly delay vi operations and show a shadow on the text -;; area being operated on. Extremely useful for pair programming + (setq evil-mode-line-format '(before . mode-line-front-space)) + (setq evil-echo-state nil) + (setq evil-esc-delay 0) + + (evil-mode t)) + (use-package evil-goggles :delight (evil-goggles-mode) + :config - (progn (evil-goggles-mode t) - (setq evil-goggles-pulse t) - (setq evil-goggles-blocking-duration 0.100) - (setq evil-goggles-async-duration 0.300))) + (setq evil-goggles-pulse t) + (setq evil-goggles-blocking-duration 0.100) + (setq evil-goggles-async-duration 0.300) + + (evil-goggles-mode t)) (use-package evil-surround :config (global-evil-surround-mode t)) @@ -74,18 +60,20 @@ (use-package evil-org :disabled :delight (evil-org-mode) + :config - (progn (add-hook 'org-mode-hook 'evil-org-mode) - - (require 'evil-org-agenda) - (evil-org-agenda-set-keys) - (evil-org-set-key-theme '(textobjects - insert - navigation - additional - shift - todo - heading)))) + (require 'evil-org-agenda) + + (add-hook 'org-mode-hook 'evil-org-mode) + + (evil-org-agenda-set-keys) + (evil-org-set-key-theme '(textobjects + insert + navigation + additional + shift + todo + heading))) (provide 'module-evil) diff --git a/dots/.config/emacs/modules/module-git.el b/dots/.config/emacs/modules/module-git.el @@ -21,41 +21,31 @@ ;;; Code: +(defun mjf/magit-status-with-prefix () + (interactive) + (let ((current-prefix-arg '(4))) + (call-interactively 'magit-status))) + (use-package magit :bind (("C-x g" . magit-status) - ("C-x G" . magit-status-with-prefix)) + ("C-x G" . mjf/magit-status-with-prefix)) :init - (progn (defun magit-status-with-prefix () - (interactive) - (let ((current-prefix-arg '(4))) - (call-interactively 'magit-status))) - - (setq transient-history-file (concat persistent-dir "/transient/history.el") - transient-display-buffer-action '(display-buffer-below-selected) - transient-mode-line-format - '("%e" mode-line-front-space mode-line-buffer-identification)))) - -;; (use-package evil-magit) - -(use-package gitignore-mode) + (setq transient-history-file "~/.cache/transient/history.el") + (setq transient-display-buffer-action '(display-buffer-below-selected)) + (setq transient-mode-line-format + '("%e" mode-line-front-space mode-line-buffer-identification))) (use-package magithub :disabled :after magit :config - (progn (magithub-feature-autoinject t) - (setq magithub-api-timeout 5 - magithub-dir (concat persistent-dir "/magithub")))) + (magithub-feature-autoinject t) + (setq magithub-api-timeout 5) + (setq magithub-dir "~/.cache/magithub")) -(use-package git-timemachine) +(use-package gitignore-mode) -(use-package git-gutter-fringe+ - :disabled - :delight git-gutter+-mode - :config - (progn (require 'git-gutter-fringe+) - (git-gutter-fr+-minimal) - (global-git-gutter+-mode))) +(use-package git-timemachine) (provide 'module-git) diff --git a/dots/.config/emacs/modules/module-go.el b/dots/.config/emacs/modules/module-go.el @@ -21,71 +21,78 @@ ;;; Code: -;; set gopath unless it has already been set -(defvar go-compile-command "go build -v && go vet && go test -covermode=count -coverprofile=out.cover") - -(unless (getenv "GOPATH") - (setenv "GOPATH" (concat (getenv "HOME") "/prog/go"))) -(setenv "PATH" (concat (getenv "PATH") ":/Users/mfeller/prog/go/bin")) +(defvar mjf/go-compile-command + "go build -v && go vet && go test -covermode=count -coverprofile=out.cover") + +(defun mjf/go-prog-init () + "if go is install go get all dependencies for emacs go packages" + (interactive) + (if (not (eq (executable-find "go") nil)) + (progn + (mapcar (lambda (pkg) + (let ((cmd (concat "go get -u " pkg))) + (call-process-shell-command cmd nil "*go-get-output*" t))) + '("github.com/nsf/gocode" + "golang.org/x/tools/cmd/goimports" + "github.com/rogpeppe/godef" + "github.com/golang/lint" + "golang.org/x/tools/cmd/gorename" + "golang.org/x/tools/cmd/guru" + "github.com/kisielk/errcheck"))) + (message "go executable not found, install go from https://golang.org/download"))) + +(defun mjf/ginkgo-test (package) + "Run ginkgo test suites recursively from a given go package" + (interactive (list (read-directory-name "Package:"))) + (async-shell-command + (concat "ginkgo -r " package) "*Ginkgo Tests*") + + ;; get out of evil insert mode and dont truncate text + (switch-to-buffer "*Ginkgo Tests*") + (local-set-key (kbd "q") 'kill-buffer-and-window) + (evil-motion-state) + (toggle-truncate-lines) + (message nil) + (previous-buffer)) + +(defun mjf/go-cover () + (interactive) + (shell-command "go tool cover -html=out.cover")) + +(defun mjf/setup-go-mode-compile () + "Customize compile command to run go build" + (set (make-local-variable 'compile-command) + mjf/go-compile-command)) + +(defun mjf/go-init-company () + "Initialize company mode for go" + (set (make-local-variable 'company-backends) '(company-go)) + (company-mode)) (use-package go-mode - :bind (:map go-mode-map - ("C-c C-g" . go-goto-imports) - ("C-c C-c" . compile) - ("C-c C-t" . ginkgo-test) - ("C-c C" . go-cover)) + :bind + (:map go-mode-map + ("C-c C-g" . go-goto-imports) + ("C-c C-c" . compile) + ("C-c C-t" . ginkgo-test) + ("C-c C" . go-cover)) + + :init + (unless (getenv "GOPATH") + (setenv "GOPATH" (concat (getenv "HOME") "/prog/go"))) + + (setenv "PATH" (concat (getenv "PATH") ":" + (concat (getenv "GOPATH")"/bin"))) + :config - (progn (setq gofmt-command "goimports") ; use goimports instead of go-fmt - (setq godoc-command "godoc") ; use godoc instead of go doc - (setq tab-width 4) - - (defun go-prog-init () - "if go is install go get all dependencies for emacs go packages" - (interactive) - (if (not (eq (executable-find "go") nil)) - (progn - (mapcar (lambda (pkg) - (let ((cmd (concat "go get -u " pkg))) - (call-process-shell-command cmd nil "*go-get-output*" t))) - '("github.com/nsf/gocode" - "golang.org/x/tools/cmd/goimports" - "github.com/rogpeppe/godef" - "github.com/golang/lint" - "golang.org/x/tools/cmd/gorename" - "golang.org/x/tools/cmd/guru" - "github.com/kisielk/errcheck"))) - (message "go executable not found, install go from https://golang.org/download"))) - - (defun ginkgo-test (package) - "Run ginkgo test suites recursively from a given go package" - (interactive (list (read-directory-name "Package:"))) - (async-shell-command - (concat "ginkgo -r " package) "*Ginkgo Tests*") - - ;; get out of evil insert mode and dont truncate text - (switch-to-buffer "*Ginkgo Tests*") - (local-set-key (kbd "q") 'kill-buffer-and-window) - (evil-motion-state) - (toggle-truncate-lines) - (message nil) - (previous-buffer)) - - (defun go-cover () - (interactive) - (shell-command "go tool cover -html=out.cover")) - - (defun setup-go-mode-compile () - "Customize compile command to run go build" - (set (make-local-variable 'compile-command) - go-compile-command)) - - (add-hook 'go-mode-hook 'setup-go-mode-compile) - (add-hook 'go-mode-hook 'subword-mode) - - ;; format before save - (add-hook 'before-save-hook 'gofmt-before-save))) - -;; go-add-tags provides functions for adding tags to go structs + (setq gofmt-command "goimports") ; use goimports instead of go-fmt + (setq godoc-command "godoc") ; use godoc instead of go doc + (setq tab-width 8) + + (add-hook 'go-mode-hook 'setup-go-mode-compile) + (add-hook 'go-mode-hook 'subword-mode) + (add-hook 'before-save-hook 'gofmt-before-save)) + (use-package go-add-tags :after go-mode) @@ -96,29 +103,29 @@ (use-package go-guru :after go-mode - :bind (:map go-mode-map - ("M-." . go-guru-definition) - ("C-c d" . go-guru-describe))) + :bind + (:map go-mode-map + ("M-." . go-guru-definition) + ("C-c d" . go-guru-describe))) (use-package company-go :after (go-mode company) :config - (progn (add-hook 'go-mode-hook (lambda () - (set (make-local-variable 'company-backends) '(company-go)) - (company-mode))))) + (add-hook 'go-mode-hook 'mjf/go-init-company)) (use-package go-eldoc :after (go-mode eldoc) :config - (progn (add-hook 'go-mode-hook 'go-eldoc-setup))) + (add-hook 'go-mode-hook 'go-eldoc-setup)) (use-package flycheck-gometalinter + :disabled :after (go-mode flycheck-mode) :config - (progn (flycheck-gometalinter-setup) - (setq flycheck-gometalinter-deadline "10s") - (setq flycheck-gometalinter-fast t) - (setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo")))) + (flycheck-gometalinter-setup) + (setq flycheck-gometalinter-deadline "10s") + (setq flycheck-gometalinter-fast t) + (setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo"))) (provide 'module-go) diff --git a/dots/.config/emacs/modules/module-kubernetes.el b/dots/.config/emacs/modules/module-kubernetes.el @@ -1,10 +1,33 @@ -(use-package kubernetes - :ensure t - :commands (kubernetes-overview)) +;;; module-kubernetes.el -;; If you want to pull in the Evil compatibility package. -(use-package kubernetes-evil - :ensure t - :after kubernetes) +;; Author: Mark Feller <mark.feller@member.fsf.org> + +;; This file is not part of GNU Emacs. + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this file. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;;; Code: + +(require 'module-yaml) + +(use-package kubel + :config + (add-to-list 'evil-emacs-state-modes 'kubel-mode) + (add-hook 'kubel-mode-hook 'disable-line-numbers)) (provide 'module-kubernetes) + +;;; module-kubernetes.el ends here diff --git a/dots/.config/emacs/modules/module-ledger.el b/dots/.config/emacs/modules/module-ledger.el @@ -21,10 +21,43 @@ ;;; Code: +(defun mjf/ledger-report (name command) + `(,name ,(concat "%(binary) -f %(ledger-file) " command))) + +(defun mjf/ledger-reports (lst) + (mapcar (lambda (x) + (mjf/ledger-report (car x) (cadr x))) lst)) + (use-package ledger-mode - :mode "\\.ledger\\'") + :mode "\\.ledger\\'" + :config + (add-hook 'ledger-report-mode-hook 'disable-line-numbers) + (add-hook 'ledger-report-mode-hook 'evil-emacs-state) + + (setq ledger-post-amount-alignment-column 62) + (setq ledger-report-auto-refresh nil) + (setq ledger-reports + (mjf/ledger-reports + '(("bal" "bal -V") + ("reg" "reg") + ("stats" "stats") + ("payee" "reg @%(payee)") + ("account" "reg %(account)") + ("investments" "bal ^Assets:Investments") + ("net worth" "bal ^Assets ^Liabilities -V") + ("forecast" "reg ^Assets ^Liabilities --forecast 'd<[2030]'") + ("creditcard" "reg ^Liabilities:Credit --monthly") + ("budget" "reg ^Expenses -p 'last month' --monthly --budget") + ("budget year" "reg ^Expenses -p 'this year' --monthly --budget") + ("expenses" "bal ^Expenses and not Tax -p 'this month'") + ("expenses monthly" "reg ^Expenses and not Tax -S T -p 'this year' --monthly --collapse") + ("expenses month" "bal ^Expenses and not Tax --flat -S T -p 'last month'") + ("expenses year" "bal ^Expenses and not Tax --flat -S T -p 'this year'") + ("average" "bal ^Expenses -p 'this year' --monthly --average") + ("paystubs" "print Income:Salary"))))) (use-package flycheck-ledger + :disabled :after (flycheck-mode ledger-mode)) (provide 'module-ledger) diff --git a/dots/.config/emacs/modules/module-multiple-cursors.el b/dots/.config/emacs/modules/module-multiple-cursors.el @@ -5,6 +5,6 @@ ("C-c C-<" . mc/mark-all-like-this) ("C-S-SPC" . set-rectangular-region-anchor) ("C-S-c C->" . mc/mark-sgml-tag-pair)) - :init (setq mc/list-file (expand-file-name "mc-lists.el" persistent-dir))) + :init (setq mc/list-file "~/.cache/mc-lists.el")) (provide 'module-multiple-cursors) diff --git a/dots/.config/emacs/modules/module-notmuch.el b/dots/.config/emacs/modules/module-notmuch.el @@ -19,22 +19,67 @@ ;;; Commentary: +;; Notmuch mail provides email indexing and searching based on tags. See +;; https://notmuchmail.org/ + ;;; Code: +(require 'smtpmail) + +(defun mjf/initialize-gmail () + "Configure smtpmail to use gmail" + (setq message-send-mail-function 'smtpmail-send-it + send-mail-function 'smtpmail-send-it + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-local-domain "gmail.com" + smtpmail-stream-type 'ssl + smtpmail-smtp-service 465)) + +(defun mjf/tag-deleted () + "Tag mail at point as deleted. This operation will not delete +the mail, but tag it for later deletion." + (interactive) + (notmuch-search-tag '("+deleted" "-inbox" "-unread")) + (next-line)) + +(defun mjf/delete-tagged-mail () + "Delete mail that is tagged with the deleted tag" + (interactive) + (shell-command "notmuch_delete") + (notmuch-refresh-all-buffers)) + +(defun mjf/getmail () + "Fetch mail using getmail" + (interactive) + (message "Fetching mail...") + (shell-command "getmail") + (notmuch-hello-update)) + (use-package notmuch + :bind + (:map notmuch-search-mode-map + ("d" . mjf/tag-deleted) + ("D" . mjf/delete-tagged-mail) + ("/" . notmuch-search)) + (:map notmuch-tree-mode-map + ("d" . mjf/tag-deleted) + ("D" . mjf/delete-tagged-mail)) + (:map notmuch-hello-mode-map + ("r" . mjf/getmail)) + :config - (progn (setq user-full-name "Mark Feller") - - (setq message-sendmail-envelope-from 'header) - (add-hook 'message-send-mail-hook 'cg-feed-msmtp) - - (setq notmuch-saved-searches - '((:name "inbox" :query "tag:inbox" :key "i") - (:name "unread" :query "tag:unread" :key "u") - (:name "sent" :query "tag:sent" :key "t") - (:name "drafts" :query "tag:draft" :key "d") - (:name "guix-devel" :query "guix-devel tag:unread" :key "g") - (:name "emacs-devel" :query "emacs-devel tag:unread" :key "e"))))) + (add-hook 'notmuch-hello-mode-hook 'disable-line-numbers) + (add-hook 'notmuch-search-mode-hook 'disable-line-numbers) + (add-hook 'notmuch-tree-mode-hook 'disable-line-numbers) + + (setq notmuch-saved-searches + '((:name "inbox" :query "tag:inbox" :key "i") + (:name "unread" :query "tag:unread" :key "u") + (:name "all" :query "*" :key "a") + (:name "deleted" :query "tag:deleted") + (:name "sent" :query "tag:sent" :key "t") + (:name "drafts" :query "tag:draft" :key "d")))) (provide 'module-notmuch) diff --git a/dots/.config/emacs/modules/module-org.el b/dots/.config/emacs/modules/module-org.el @@ -21,6 +21,11 @@ ;;; Code: +(defun mjf/org-summary-todo (n-done n-not-done) + "Switch entry to DONE when all subentries are done, to TODO otherwise." + (let (org-log-done org-log-states) ; turn off logging + (org-todo (if (= n-not-done 0) "DONE" "TODO")))) + (use-package org :bind (("C-c l" . org-store-link) ("C-c a" . org-agenda) @@ -29,91 +34,84 @@ ("C-x C-s" . org-edit-src-exit)) :delight (org-indent-mode nil t) :config - (progn (require 'org-indent) - (require 'org-src) - (require 'ob-shell) - - (setq org-startup-indented t) - (setq org-src-tab-acts-natively t) - (setq org-src-fontify-natively t) - (setq org-hide-emphasis-markers t) - - (defun org-summary-todo (n-done n-not-done) - "Switch entry to DONE when all subentries are done, to TODO otherwise." - (let (org-log-done org-log-states) ; turn off logging - (org-todo (if (= n-not-done 0) "DONE" "TODO")))) - (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) - - ;; disable line numbers in org mode - (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) - - ;; where I keep all my org files - (setq org-agenda-files - '("~/org/work.org" - "~/org/life.org")) - - ;; personal capture templates - (setq org-capture-templates - '( - ;; unfiled work items - ("w" "Work" entry (file+headline "~/org/work.org" "Unread") - "* TODO %?\n %i\n") - - ;; random thoughts I'd like to capture - ("t" "Thought" entry (file+headline "~/org/work.org" "Thoughts") - "* %?\n %i\n") - - ;; unfiled work items in my life - ("l" "Life" entry (file+headline "~/org/life.org" "Inbox") - "* TODO %?\n %i\n") - - ("j" "Journal" entry (file+datetree "~/org/life.org") - "* TODO %?\n"))) - - ;; when refiling an org header don't search more than 3 levels deep - (setq org-refile-targets - '((nil :maxlevel . 3) - (org-agenda-files :maxlevel . 3))) - - (setq org-todo-keywords - '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)" "CANCELLED(c)") - (sequence "RECURRING(r)" "|" "DONE(d)"))) - - ;; don't make the title big, I don't like that. Also remove those ugly - ;; checkboxes - (set-face-attribute 'org-document-title nil :height 1) - (set-face-attribute 'org-checkbox nil :box nil))) + (require 'org-indent) + (require 'org-src) + (require 'ob-shell) + + (setq org-startup-indented t) + (setq org-src-tab-acts-natively t) + (setq org-src-fontify-natively t) + (setq org-hide-emphasis-markers t) + + (add-hook 'org-after-todo-statistics-hook 'mjf/org-summary-todo) + (add-hook 'org-mode-hook 'disable-line-numbers) + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) + + ;; where I keep all my org files + (setq org-agenda-files + '("~/org/work.org" + "~/org/life.org")) + + ;; personal capture templates + (setq org-capture-templates + '( + ;; unfiled work items + ("w" "Work" entry (file+headline "~/org/work.org" "Unread") + "* TODO %?\n %i\n") + + ;; random thoughts I'd like to capture + ("t" "Thought" entry (file+headline "~/org/work.org" "Thoughts") + "* %?\n %i\n") + + ;; unfiled work items in my life + ("l" "Life" entry (file+headline "~/org/life.org" "Inbox") + "* TODO %?\n %i\n") + + ("j" "Journal" entry (file+datetree "~/org/life.org") + "* TODO %?\n"))) + + ;; when refiling an org header don't search more than 3 levels deep + (setq org-refile-targets + '((nil :maxlevel . 3) + (org-agenda-files :maxlevel . 3))) + + (setq org-todo-keywords + '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)" "CANCELLED(c)") + (sequence "RECURRING(r)" "|" "DONE(d)"))) + + ;; don't make the title big, I don't like that. Also remove those ugly + ;; checkboxes + (set-face-attribute 'org-document-title nil :height 1) + (set-face-attribute 'org-checkbox nil :box nil)) (use-package org-bullets :config - (progn (setq org-bullets-bullet-list '("●" "○" "◉" "•")) + (setq org-bullets-bullet-list '("●" "○" "◉" "•")) - ;; bullets on lists - (font-lock-add-keywords - 'org-mode - '(("^ +\\([-*]\\) " - (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))))) + ;; bullets on lists + (font-lock-add-keywords + 'org-mode + '(("^ +\\([-*]\\) " + (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))) (use-package org-fancy-priorities :ensure t :delight (org-fancy-priorities-mode) :hook (org-mode . org-fancy-priorities-mode) :config - (progn (setq org-fancy-priorities-list '("⬆" "➡" "⬇" "☕")) - - ;; solarized theme on priorities - (setq org-priority-faces '((65 . "#dc322f") - (66 . "#cb4b16") - (67 . "#859900"))))) + (setq org-fancy-priorities-list '("⬆" "➡" "⬇" "☕")) + (setq org-priority-faces '((65 . "#dc322f") + (66 . "#cb4b16") + (67 . "#859900")))) (use-package deft :disabled :config - (progn (setq deft-directory "~/org" - deft-extensions '("md" "org") - deft-recursive t) + (setq deft-directory "~/org" + deft-extensions '("md" "org") + deft-recursive t) - (add-hook 'deft-mode-hook (lambda () (evil-emacs-state))))) + (add-hook 'deft-mode-hook (lambda () (evil-emacs-state)))) (provide 'module-org) diff --git a/dots/.config/emacs/modules/module-projectile.el b/dots/.config/emacs/modules/module-projectile.el @@ -23,11 +23,13 @@ (use-package projectile :delight (projectile-mode) + :bind + (:map projectile-mode-map + ("C-c p" . 'projectile-command-map)) :config - (progn (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) - (setq projectile-completion-system 'ivy - projectile-cache-file (expand-file-name "projectile-cache" persistent-dir) - projectile-known-projects-file (expand-file-name "projectile-bookmarks.eld" persistent-dir)))) + (setq projectile-completion-system 'ivy) + (setq projectile-cache-file "~/.cache/projectile-cache") + (setq projectile-known-projects-file "~/.cache/projectile-bookmarks.eld")) (use-package counsel-projectile :after (counsel projectile) diff --git a/dots/.config/emacs/modules/module-python.el b/dots/.config/emacs/modules/module-python.el @@ -21,42 +21,13 @@ ;;; Code: -(use-package python) - -(use-package elpy - :bind (:map elpy-mode-map - ("C-c C-j" . elpy-goto-definition) - ("M-," . pop-tag-mark)) - :config - (progn (setq elpy-rpc-backend "jedi") - (elpy-enable))) - - -(use-package pip-requirements - :config - (add-hook 'pip-requirements-mode-hook #'pip-requirements-auto-complete-setup)) - -(use-package py-autopep8) - -(use-package pyenv-mode - :disabled - :init - (add-to-list 'exec-path "~/.pyenv/shims") - (setenv "WORKON_HOME" "~/.pyenv/versions/") - :config - (pyenv-mode) - (add-hook 'after-init-hook 'pyenv-init) - (add-hook 'projectile-after-switch-project-hook 'pyenv-activate-current-project) - :bind - ("C-x p e" . pyenv-activate-current-project)) - (defun pyenv-init() (setq global-pyenv (replace-regexp-in-string "\n" "" (shell-command-to-string "pyenv global"))) (message (concat "Setting pyenv version to " global-pyenv)) (pyenv-mode-set global-pyenv) (defvar pyenv-current-version nil global-pyenv)) -(defun pyenv-activate-current-project () +(defun mjf/pyenv-activate-current-project () "Automatically activates pyenv version if .python-version file exists." (interactive) (f-traverse-upwards @@ -70,12 +41,33 @@ (pyvenv-workon pyenv-current-version) (message (concat "Setting virtualenv to " pyenv-current-version)))))))) +(use-package python + :config + (setq python-shell-interpreter "ipython") + (setq python-shell-interpreter-args "-i --simple-prompt") + + ;; Enable hideshow minor mode in python for folding and unfolding + (add-hook 'python-mode-hook 'hs-minor-mode) + (add-hook 'python-mode-hook 'subword-mode)) -(setq python-shell-interpreter "ipython" - python-shell-interpreter-args "-i --simple-prompt" +(use-package elpy + :bind + (:map elpy-mode-map + ("C-c C-j" . elpy-goto-definition) + ("M-," . pop-tag-mark)) + + :config + (setq elpy-rpc-backend "jedi") + (setq elpy-rpc-python-command "python3") + (setq elpy-shell-echo-output nil) - ;; when there are a bunch of ^G^G^G this fixes it - elpy-shell-echo-output nil) + (elpy-enable)) + +(use-package pip-requirements + :config + (add-hook 'pip-requirements-mode-hook #'pip-requirements-auto-complete-setup)) + +(use-package py-autopep8) (provide 'module-python) diff --git a/dots/.config/emacs/modules/module-rust.el b/dots/.config/emacs/modules/module-rust.el @@ -21,51 +21,52 @@ ;;; Code: -(use-package rust-mode - :bind (:map rust-mode-map - ("C-c C-c" . compile) - ("C-c <tab>" . rust-format-buffer)) - :config - (progn (setq rust-format-on-save t) - - (defun rust-prog-init () - "if cargo is install get all depencies for emacs rust packages" - (interactive) - (if (not (eq (executable-find "cargo") nil)) - (progn - (mapcar (lambda (pkg) - (let ((cmd (concat "cargo install " pkg))) - (call-process-shell-command cmd nil "*cargo-output*" t))) - '("racer"))) - (message "cargo executable not found"))) - - (defun setup-rust-mode-compile () - "Customize compile command to run go build" - (if (not (string-match "cargo" compile-command)) - (set (make-local-variable 'compile-command) - "cargo build"))) +(defun mjf/rust-prog-init () + "if cargo is install get all depencies for emacs rust packages" + (interactive) + (if (not (eq (executable-find "cargo") nil)) + (progn + (mapcar (lambda (pkg) + (let ((cmd (concat "cargo install " pkg))) + (call-process-shell-command cmd nil "*cargo-output*" t))) + '("racer"))) + (message "cargo executable not found"))) + +(defun mjf/setup-rust-mode-compile () + "Customize compile command to run go build" + (if (not (string-match "cargo" compile-command)) + (set (make-local-variable 'compile-command) + "cargo build"))) - (add-hook 'rust-mode-hook 'setup-rust-mode-compile))) +(use-package rust-mode + :bind + (:map rust-mode-map + ("C-c C-c" . compile) + ("C-c <tab>" . rust-format-buffer)) + :config + (setq rust-format-on-save t) + (add-hook 'rust-mode-hook 'mjf/setup-rust-mode-compile)) -;; depends on racer install with cargo install racer (use-package racer :after (rust-mode) :delight racer-mode - :bind (:map rust-mode-map - ("TAB" . company-indent-or-complete-common) - ("C-c d" . racer-describe)) - :config - (progn (setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH - (setq racer-rust-src-path (concat (getenv "HOME") "/prog/rust/src")) ;; Rust source code PATH + :bind + (:map rust-mode-map + ("TAB" . company-indent-or-complete-common) + ("C-c d" . racer-describe)) - (add-hook 'rust-mode-hook #'racer-mode) - (add-hook 'racer-mode-hook #'eldoc-mode) - (add-hook 'racer-mode-hook #'company-mode) + :config + (setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH + (setq racer-rust-src-path (concat (getenv "HOME") "/prog/rust/src")) ;; Rust source code PATH + (setq company-tooltip-align-annotations t) - (setq company-tooltip-align-annotations t))) + (add-hook 'rust-mode-hook #'racer-mode) + (add-hook 'racer-mode-hook #'eldoc-mode) + (add-hook 'racer-mode-hook #'company-mode)) (use-package flycheck-rust + :disable :after (flycheck-mode rust-mode) :config (progn (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))) diff --git a/dots/.config/emacs/modules/module-undo-tree.el b/dots/.config/emacs/modules/module-undo-tree.el @@ -1,6 +1,8 @@ +(delight 'undo-tree-mode "" "undo-tree") + (use-package undo-tree :disabled - :delight undo-tree-mode + :delight (undo-tree-mode "" "undo-tree") :config (global-undo-tree-mode t)) (provide 'module-undo-tree) diff --git a/dots/.config/emacs/modules/module-yasnippet.el b/dots/.config/emacs/modules/module-yasnippet.el @@ -22,12 +22,12 @@ ;;; Code: (use-package yasnippet - :mode ("/\\.emacs\\.d/snippets/" . snippet-mode) + :mode ("/\\.config/emacs/snippets/" . snippet-mode) :delight yas-minor-mode :demand :config - (progn (yas-load-directory "~/.emacs.d/snippets/") - (yas-global-mode 1))) + (yas-load-directory "~/.config/emacs/snippets/") + (yas-global-mode 1)) (provide 'module-yasnippet) diff --git a/dots/.config/emacs/theme/poet-fork/poet-theme.el b/dots/.config/emacs/theme/poet-fork/poet-theme.el @@ -1,310 +0,0 @@ -;;; poet-theme.el --- A theme for prose. - -;; Copyright 2018-now Kunal Bhalla - -;; Author: Kunal Bhalla <bhalla.kunal@gmail.com> -;; URL: https://github.com/kunalb/poet/ -;; Version: 2.0 - -;;; Commentary: - -;; Emacs has very good support for multiple fonts in a single -;; file. Poet uses this support to make it much more convenient to -;; write prose within Emacs, with particular attention paid to -;; org-mode and markdown-mode. Code blocks, tables, etc are -;; formatted in monospace text with the appropriate backgrounds. - -;; Recommended customizations for using this theme -;; -;; - Set up the base fonts you'd like to use in Emacs before loading Poet -;; (set-face-attribute 'default nil :family "Iosevka" :height 130) -;; (set-face-attribute 'fixed-pitch nil :family "Iosevka") -;; (set-face-attribute 'variable-pitch nil :family "Baskerville") -;; On loading this theme captures the default and treats that for fixed-pitch -;; rendering. -;; -;; - Enable variable pitch mode for editing text -;; (add-hook 'text-mode-hook -;; (lambda () -;; (variable-pitch-mode 1)) -;; -;; - Some other modes I like to enable/disable -;; (olivetti-mode 1) ;; Centers text in the buffer -;; (flyspell-mode 1) ;; Catch Spelling mistakes -;; (typo-mode 1) ;; Good for symbols like em-dash -;; (blink-cursor-mode 0) ;; Reduce visual noise -;; (linum-mode 0) ;; No line numbers for prose -;; -;; - And prettier org mode bullets: -;; (setq org-bullets-bullet-list -;; '("◉" "○")) -;; (org-bullets 1) - -;;; Code: - -(defvar poet--monospace-height - (face-attribute 'fixed-pitch :height nil 'default) - "The original height stored as a defvar to stay constant across reloads.") - -(defun poet--height (multiplier) - "Scale up the height according to the MULTIPLIER." - (truncate (* poet--monospace-height multiplier))) - -(deftheme poet - "A prose friendly theme.") - -(let ( - ;; Primary Colors - (fg "#444444") - (bg "#e1d9c2") - - (white-light "#ffffff") - (yellow-light "#fff59d") - (red-light "#ff1744") - - (black "gray0") - (white "gray88") - (yellow "#fff176") - (blue "#0288D1") - (green "#388E3C") - (red "#bf360c") - (purple "#673AB7") - (brown "#8D6E63") - - ;; dark colors - (cyan-dark "#455A64") - (blue-dark "#3f51b5") - (red-dark "#8E3C38") - (purple-dark "#6C3082") - (brown-dark "#4e342e") - ) - (let ( - (emph "gray13") - (sep "gray80") - (hlt "gray93") - (bg-hlt "#fff8e1") - (meta brown-dark) - (link "#303f9f") - (link-underline "#304ffe") - (vlink-underline "#1a237e") - (button "gray27") - (cursor "gray29") - (paren-match-bg red-light) - (paren-match-fg white-light) - (search-fg red) - (search-bg white-light) - (search-fail-bg "#f8bbd0") - (tooltip-fg "#111111") - (tooltip-bg yellow) - (shadow "grey60") - (secondary-bg yellow-light) - (trailing-bg "#ff8a65") - (fci "grey87") - (mode-line-fg "grey7") - (mode-line-hlt white-light) - (mode-line-inactive "#888888") - (header red-dark) - (header-line-bg white) - (builtin red-dark) - (string green) - (function-name "#444444") - (keyword "#444444") - (constant blue) - (type "#444444") - (variable cyan-dark) - - ;; org - (org-meta brown) - (org-document-info brown) - (org-table white) - (org-quote-fg purple-dark) - (org-quote-bg white) - (org-date "#444444") - (org-title red) - (org-title-underline "#aaaaaa") - (org-checkbox "#aaaaaa") - (org-scheduled "#333333") - (org-scheduled-today "#111111") - (org-done green) - (org-todo red) - (org-tag "#777777") - (org-block-line "#d0d0d0") - (org-block-bg white) - (org-agenda-structure-fg "#555555") - (org-agenda-structure-bg white) - (org-agenda-today-fg "#000000") - (org-agenda-today-bg "#eeeeee") - (org-special-keyword "#777777") - (org-sched-prev "#222222") - (org-agenda-done "#777777") - - (hl-line "#efefef") - (linum-hlt "#555555") - (linum "#aaaaaa") - (markdown-markup brown) - (markdown-metadata "#777777") - (markdown-language purple) - (markdown-list "#000000") - (markdown-code-bg white) - (markdown-pre-bg white) - (markdown-header-delimiter brown) - (imenu brown-dark)) - (custom-theme-set-faces 'poet - `(variable-pitch ((t (:family ,(face-attribute 'variable-pitch :family) :height ,(poet--height 1.23))))) - - `(default ((t (:background ,bg :foreground ,fg)))) - `(italic ((t (:foreground ,emph :slant italic)))) - `(highlight ((t (:background ,hlt :overline nil)))) - `(region ((t (:background ,bg-hlt)))) - `(fringe ((t (:background ,bg)))) - `(button ((t (:inherit default :foreground ,button)))) - `(escape-glyph ((t (:foreground ,purple)))) - `(link ((t (:underline (:color ,link-underline :style line) :foreground ,link)))) - `(link-visited ((t (:inherit link :foreground ,link :underline (:color ,vlink-underline :style line))))) - `(cursor ((t (:background ,cursor)))) - `(show-paren-match ((t (:background ,paren-match-fg :foreground ,paren-match-bg)))) - `(isearch ((t (:foreground ,search-fg :background ,search-bg)))) - `(isearch-fail ((t (:background ,search-fail-bg)))) - `(query-replace ((t (:inherit isearch)))) - `(tooltip ((t (:inherit default :foreground ,tooltip-fg :background ,tooltip-bg)))) - `(shadow ((t (:foreground ,shadow)))) - `(secondary-selection ((t (:background ,secondary-bg)))) - `(trailing-whitespace ((t (:background ,trailing-bg)))) - `(lazy-highlight ((t (:foreground ,black :background ,white-light)))) - `(next-error ((t (:inherit region)))) - `(window-divider ((t (:background ,sep :foreground ,sep)))) - `(vertical-border ((t (:background ,sep :foreground ,sep)))) - `(minibuffer-prompt ((t (:inherit fixed-pitch :weight bold :foreground ,meta)))) - - ;; mode line - `(header-line ((t (:overline nil :background ,header-line-bg :box (:line-width 3 :color ,header-line-bg) :underline ,sep :inherit mode-line)))) - `(mode-line ((t (:inherit fixed-pitch :foreground ,mode-line-fg :background ,bg :overline ,sep :box (:line-width 8 :color ,bg))))) - `(mode-line-inactive ((t (:inherit mode-line :background ,bg :foreground ,mode-line-inactive :box (:color ,bg :line-width 8))))) - `(mode-line-buffer-id ((t (:weight bold)))) - `(mode-line-emphasis ((t (:weight bold)))) - `(mode-line-highlight ((t (:background ,mode-line-hlt)))) - - `(error ((t (:inherit fixed-pitch)))) - - ;; primary font lock - `(font-lock-comment-face ((t (:foreground ,shadow :inherit fixed-pitch)))) - `(font-lock-builtin-face ((t (:foreground ,builtin :inherit fixed-pitch)))) - `(font-lock-string-face ((t (:inherit fixed-pitch :foreground ,string)))) - `(font-lock-function-name-face ((t (:inherit fixed-pitch :foreground ,function-name)))) - `(font-lock-keyword-face ((t (:inherit fixed-pitch :weight bold :foreground ,keyword)))) - `(font-lock-comment-delimiter-face ((t (:inherit fixed-pitch :inherit font-lock-comment-face)))) - `(font-lock-constant-face ((t (:inherit fixed-pitch)))) - `(font-lock-doc-face ((t (:inherit fixed-pitch :inherit font-lock-string-face)))) - `(font-lock-preprocessor-face ((t (:inherit fixed-pitch :inherit font-lock-builtin-face)))) - `(font-lock-regexp-grouping-backslash ((t (:inherit fixed-pitch :inherit bold)))) - `(font-lock-regexp-grouping-construct ((t (:inherit fixed-pitch :inherit bold)))) - `(font-lock-type-face ((t (:inherit fixed-pitch)))) - `(font-lock-variable-name-face ((t (:inherit fixed-pitch :foreground ,variable)))) - `(font-lock-warning-face ((t (:inherit error)))) - - ;; Org - `(org-level-1 ((t (:inherit default :foreground ,header :height ,(poet--height 1.5))))) - `(org-level-2 ((t (:inherit default :foreground ,header :height ,(poet--height 1.4))))) - `(org-level-3 ((t (:inherit default :foreground ,header :height ,(poet--height 1.3))))) - `(org-level-4 ((t (:inherit default :foreground ,header :height ,(poet--height 1.23))))) - `(org-level-5 ((t (:inherit default :foreground ,header :height ,(poet--height 1.23))))) - `(org-level-6 ((t (:inherit default :foreground ,header :height ,(poet--height 1.23))))) - `(org-level-7 ((t (:inherit default :foreground ,header :height ,(poet--height 1.23))))) - `(org-level-8 ((t (:inherit default :foreground ,header :height ,(poet--height 1.23))))) - `(org-meta-line ((t (:inherit fixed-pitch :foreground ,org-meta)))) - `(org-document-info-keyword ((t (:inherit fixed-pitch :foreground ,org-document-info)))) - `(org-document-info ((t (:inherit default :foreground ,org-document-info)))) - `(org-verbatim ((t (:inherit fixed-pitch)))) - `(org-table ((t (:inherit fixed-pitch :background ,org-table)))) - `(org-formula ((t (:inherit org-table :height ,(poet--height 1))))) - `(org-quote ((t (:inherit default :foreground ,org-quote-fg :background ,org-quote-bg)))) - `(org-hide ((t (:inherit fixed-pitch :foreground ,bg)))) - `(org-indent ((t (:inherit org-hide)))) - `(org-date ((t (:inherit fixed-pitch :foreground ,org-date :underline nil)))) - `(org-document-title ((t (:inherit default :foreground ,org-title :height ,(poet--height 1.8) :underline (:color ,org-title-underline))))) - `(org-checkbox ((t (:inherit fixed-pitch :weight bold :foreground ,org-checkbox)))) - `(org-scheduled ((t (:foreground ,org-scheduled)))) - `(org-scheduled-today ((t (:foreground ,org-scheduled-today)))) - `(org-done ((t (:inherit fixed-pitch :foreground ,org-done)))) - `(org-todo ((t (:inherit fixed-pitch :foreground ,org-todo)))) - `(org-tag ((t (:inherit fixed-pitch :height ,(poet--height 1) :foreground ,org-tag)))) - `(org-block-begin-line ((t (:inherit fixed-pitch :background ,org-block-line)))) - `(org-block-end-line ((t (:inherit fixed-pitch :background ,org-block-line)))) - `(org-block ((t (:background ,org-block-bg :inherit fixed-pitch)))) - `(org-priority ((t (:inherit fixed-pitch :weight normal)))) - `(org-agenda-structure ((t (:foreground ,org-agenda-structure-fg :background ,org-agenda-structure-bg :overline ,org-agenda-structure-bg :underline ,org-agenda-structure-bg)))) - `(org-agenda-date-weekend ((t (:inherit org-agenda-structure)))) - `(org-agenda-date-today ((t (:foreground ,org-agenda-today-fg :overline ,org-agenda-today-bg :background ,org-agenda-today-bg :underline ,org-agenda-today-bg)))) - `(org-special-keyword ((t (:inherit fixed-pitch :foreground ,org-special-keyword)))) - `(org-scheduled-previously ((t (:foreground ,org-sched-prev)))) - `(org-agenda-done ((t (:foreground ,org-agenda-done)))) - `(org-footnote ((t (:foreground ,link)))) - `(hl-line ((t (:background ,hl-line)))) - - ;; line numbers - `(line-number ((t (:inherit fixed-pitch :foreground ,linum)))) - `(line-number-current-line ((t (:inherit fixed-pitch :foreground ,linum-hlt)))) - - ;; markdown - `(markdown-header-face-1 ((t (:foreground ,header :inherit default :height ,(poet--height 1.5))))) - `(markdown-header-face-2 ((t (:foreground ,header :inherit default :height ,(poet--height 1.4))))) - `(markdown-header-face-3 ((t (:foreground ,header :inherit default :height ,(poet--height 1.3))))) - `(markdown-header-face-4 ((t (:foreground ,header :inherit default :height ,(poet--height 1.23))))) - `(markdown-header-face-5 ((t (:foreground ,header :inherit default :height ,(poet--height 1.23))))) - `(markdown-header-face-6 ((t (:foreground ,header :inherit default :height ,(poet--height 1.23))))) - `(markdown-header-face-7 ((t (:foreground ,header :inherit default :height ,(poet--height 1.23))))) - `(markdown-header-face-8 ((t (:foreground ,header :inherit default :height ,(poet--height 1.23))))) - `(markdown-markup-face ((t (:inherit fixed-pitch :foreground ,markdown-markup)))) - `(markdown-inline-code-face ((t (:inherit fixed-pitch)))) - `(markdown-metadata-key-face ((t (:inherit fixed-pitch :height ,(poet--height 1) :foreground ,markdown-metadata)))) - `(markdown-metadata-value-face ((t (:inherit fixed-pitch :height ,(poet--height 1) :foreground ,fg)))) - `(markdown-language-keyword-face ((t (:foreground ,markdown-language)))) - `(markdown-list-face ((t (:inherit fixed-pitch :foreground ,markdown-list)))) - `(markdown-code-face ((t (:inherit fixed-pitch :foreground ,fg :background ,markdown-code-bg)))) - `(markdown-pre-face ((t (:inherit fixed-pitch :color ,fg :background ,markdown-pre-bg)))) - `(markdown-header-delimiter-face ((t (:inherit fixed-pitch :foreground ,markdown-header-delimiter)))) - `(markdown-header-rule-face ((t (:inherit fixed-pitch :foreground ,markdown-header-delimiter)))) - `(markdown-url-face ((t (:inherit fixed-pitch :foreground ,link)))) - - ;; ivy - `(ivy-current-match ((t (:inherit fixed-pitch :background ,hlt)))) - `(ivy-minibuffer-match-face-1 ((t (:inherit fixed-pitch :foreground ,cyan-dark)))) - `(ivy-minibuffer-match-face-2 ((t (:inherit fixed-pitch :foreground ,red-dark)))) - `(ivy-minibuffer-match-face-3 ((t (:inherit fixed-pitch :foreground ,blue-dark)))) - `(ivy-minibuffer-match-face-4 ((t (:inherit fixed-pitch :foreground ,brown-dark)))) - - ;; imenu - `(imenu-list-entry-face-0 ((t (:foreground ,imenu)))) - `(imenu-list-entry-face-1 ((t (:foreground ,imenu)))) - `(imenu-list-entry-face-2 ((t (:foreground ,imenu)))) - `(imenu-list-entry-face-3 ((t (:foreground ,imenu)))) - `(imenu-list-entry-face-4 ((t (:foreground ,imenu)))) - `(imenu-list-entry-face-5 ((t (:foreground ,imenu)))) - - ;; tldr - `(tldr-title ((t (:foreground ,red :weight bold :height 1.9)))) - `(tldr-description ((t (:foreground ,green)))) - `(tldr-code-block ((t ()))) - `(tldr-command-argument ((t ()))) - - ;; evil - `(evil-ex-substitute-replacement ((t (:foreground ,white-light :background ,brown-dark :underline nil)))) - `(evil-goggles-delete-face ((t (:inherit 'lazy-highlight)))) - `(evil-goggles-paste-face ((t (:inherit 'lazy-highlight)))) - `(evil-goggles-yank-face ((t (:inherit 'lazy-highlight)))) - - `(helm-source-header ((t (:height ,(poet--height 1)))))) - - (custom-theme-set-variables 'poet - '(line-spacing 0.4) - `(fci-rule-color ,fci)))) - -;;;###autoload -(when (and (boundp 'custom-theme-load-path) - load-file-name) - (add-to-list 'custom-theme-load-path - (file-name-as-directory - (file-name-directory load-file-name)))) - -(provide-theme 'poet) -;;; poet-theme.el ends here diff --git a/dots/.emacs.d/core/core-bootstrap.el b/dots/.emacs.d/core/core-bootstrap.el @@ -1,50 +0,0 @@ -;;; core-bootstrap.el --- bootstrap for use-package - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; Setup Emacs package repos and grab use-package for rest of the -;; package management. - -;;; Code: - -(require 'package) - -(setq package-user-dir "~/.cache/elpa") -(setq package-archives - '(("melpa-stable" . "https://stable.melpa.org/packages/") - ("melpa" . "https://melpa.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/") - ("org" . "http://orgmode.org/elpa/"))) - -(package-initialize) - -;; bootstrap use-package -(unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package) - (package-install 'diminish) - (package-install 'bind-key)) - -(require 'use-package) -(setq use-package-always-ensure t) - -(provide 'core-bootstrap) - -;;; core-bootstrap.el ends here diff --git a/dots/.emacs.d/core/core-defuns.el b/dots/.emacs.d/core/core-defuns.el @@ -1,198 +0,0 @@ -;;; core-defuns.el --- personal defuns - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun transpose-words (arg) - "[Override for default transpose-words in simple.el] - Interchange words around point, leaving point at end of - them. With prefix arg ARG, effect is to take word before or - around point and drag it backward past ARG other words (forward - if ARG negative). If ARG is zero, the words around or after - point and around or after mark are interchanged." - (interactive "*p") - (if (eolp) (forward-char -1)) - (transpose-subr 'backward-word arg) - (forward-word (+ arg 1))) - -(defun untabify-buffer () - (interactive) - (untabify (point-min) (point-max))) - -(defun indent-buffer () - (interactive) - (indent-region (point-min) (point-max))) - -(defun cleanup-buffer () - "Perform a bunch of operations on the whitespace content of a buffer. -Including indent-buffer, which should not be called automatically on save." - (interactive) - (untabify-buffer) - (delete-trailing-whitespace) - (indent-buffer)) - -(defun toggle-window-split () - "Toggle the current window split." - (interactive) - (if (= (count-windows) 2) - (let* ((this-win-buffer (window-buffer)) - (next-win-buffer (window-buffer (next-window))) - (this-win-edges (window-edges (selected-window))) - (next-win-edges (window-edges (next-window))) - (this-win-2nd (not (and (<= (car this-win-edges) - (car next-win-edges)) - (<= (cadr this-win-edges) - (cadr next-win-edges))))) - (splitter - (if (= (car this-win-edges) - (car (window-edges (next-window)))) - 'split-window-horizontally - 'split-window-vertically))) - (delete-other-windows) - (let ((first-win (selected-window))) - (funcall splitter) - (if this-win-2nd (other-window 1)) - (set-window-buffer (selected-window) this-win-buffer) - (set-window-buffer (next-window) next-win-buffer) - (select-window first-win) - (if this-win-2nd (other-window 1)))))) - -(defun toggle-fullscreen () - "Toggle full screen" - (interactive) - (set-frame-parameter - nil 'fullscreen - (when (not (frame-parameter nil 'fullscreen)) 'fullboth))) - -(defun info-mode () - (interactive) - (let ((file-name (buffer-file-name))) - (kill-buffer (current-buffer)) - (info file-name))) -(add-to-list 'auto-mode-alist '("\\.info\\'" . info-mode)) - -(defadvice move-beginning-of-line (around smarter-bol activate) - ;; Move to requested line if needed. - (let ((arg (or (ad-get-arg 0) 1))) - (when (/= arg 1) - (forward-line (1- arg)))) - ;; Move to indentation on first call, then to actual BOL on second. - (let ((pos (point))) - (back-to-indentation) - (when (= pos (point)) - ad-do-it))) - -;; If the *scratch* buffer is killed, recreate it automatically -;; FROM: Morten Welind -;;http://www.geocrawler.com/archives/3/338/1994/6/0/1877802/ -(save-excursion - (set-buffer (get-buffer-create "*scratch*")) - (lisp-interaction-mode) - (make-local-variable 'kill-buffer-query-functions) - (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer)) - -(defun kill-scratch-buffer () - ;; The next line is just in case someone calls this manually - (set-buffer (get-buffer-create "*scratch*")) - ;; Kill the current (*scratch*) buffer - (remove-hook 'kill-buffer-query-functions 'kill-scratch-buffer) - (kill-buffer (current-buffer)) - ;; Make a brand new *scratch* buffer - (set-buffer (get-buffer-create "*scratch*")) - (lisp-interaction-mode) - (make-local-variable 'kill-buffer-query-functions) - (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer) - ;; Since we killed it, don't let caller do that. - nil) - -(defun save-buffer-without-dtw () - (interactive) - (let ((b (current-buffer))) ; memorize the buffer - (with-temp-buffer ; new temp buffer to bind the global value of before-save-hook - (let ((before-save-hook (remove 'delete-trailing-whitespace before-save-hook))) - (with-current-buffer b ; go back to the current buffer, before-save-hook is now buffer-local - (let ((before-save-hook (remove 'delete-trailing-whitespace before-save-hook))) - (save-buffer))))))) - -(defun narrow-or-widen-dwim (p) - "Widen if buffer is narrowed, narrow-dwim otherwise. -Dwim means: region, org-src-block, org-subtree, or -defun, whichever applies first. Narrowing to -org-src-block actually calls `org-edit-src-code'. - -With prefix P, don't widen, just narrow even if buffer -is already narrowed." - (interactive "P") - (declare (interactive-only)) - (cond ((and (buffer-narrowed-p) (not p)) (widen)) - ((region-active-p) - (narrow-to-region (region-beginning) - (region-end))) - ((derived-mode-p 'org-mode) - ;; `org-edit-src-code' is not a real narrowing - ;; command. Remove this first conditional if - ;; you don't want it. - (cond ((ignore-errors (org-edit-src-code) t) - (delete-other-windows)) - ((ignore-errors (org-narrow-to-block) t)) - (t (org-narrow-to-subtree)))) - ((derived-mode-p 'latex-mode) - (LaTeX-narrow-to-environment)) - (t (narrow-to-defun)))) - -;; (define-key endless/toggle-map "n" -;; #'narrow-or-widen-dwim) -;; This line actually replaces Emacs' entire narrowing -;; keymap, that's how much I like this command. Only -;; copy it if that's what you want. -(define-key ctl-x-map "n" #'narrow-or-widen-dwim) -(add-hook 'LaTeX-mode-hook - (lambda () - (define-key LaTeX-mode-map "\C-xn" - nil))) - -(defun toggle-modeline () - (interactive) - (if (not (consp mode-line-format)) - (setq mode-line-format (default-value 'mode-line-format)) - (setq mode-line-format nil))) - -(defun resize-small () - (interactive) - (set-frame-width (selected-frame) 85) - (set-frame-height (selected-frame) 50)) - -(defun resize-wide () - (interactive) - (set-frame-width (selected-frame) 180) - (set-frame-height (selected-frame) 50)) - -(defun resize-big () - (interactive) - (set-frame-width (selected-frame) 240) - (set-frame-height (selected-frame) 70)) - -(defun disable-line-numbers () - (display-line-numbers-mode -1)) - -(provide 'core-defuns) - -;;; core-defuns.el ends here diff --git a/dots/.emacs.d/core/core-packages.el b/dots/.emacs.d/core/core-packages.el @@ -1,251 +0,0 @@ -;;; core-packages.el --- Core packages for my Emacs config - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. -;;; Commentary: - -;;; Code: - -(use-package swiper - :demand - :delight (ivy-mode) - :bind (("C-s" . swiper) - ("C-r" . swiper) - ("C-c u" . swiper-all) - ("C-c C-r" . ivy-resume) - ("C-c C-o" . ivy-occur) - ("C-c C-b" . ivy-switch-buffer) - ("C-c C-k" . kill-buffer)) - (:map ivy-minibuffer-map - ("TAB" . ivy-partial-or-done)) - :config - (setq ivy-height 6) - (setq enable-recursive-minibuffers t) - (setq swiper-include-line-number-in-search t) - - (ivy-mode 1)) - -(use-package smex - :demand - :config (setq smex-save-file "~/.cache/smex-items")) - -(use-package counsel - :after (ivy) - :demand - :bind (("M-x" . counsel-M-x) - ("C-x C-f" . counsel-find-file) - ("C-h f" . counsel-describe-function) - ("C-h v" . counsel-describe-variable) - ("C-c f r" . counsel-recentf) - ("C-c g" . counsel-git) - ("C-c /" . counsel-git-grep) - ("M-y" . counsel-yank-pop))) - -(use-package saveplace - :config - (setq save-place-file "~/.cache/places" - backup-by-copying t - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t)) - -(use-package ibuffer - :bind (("C-x C-b" . ibuffer) - :map ibuffer-mode-map - ("/ p" . ibuffer-projectile-set-filter-groups)) - :config - (setq ibuffer-default-sorting-mode 'major-mode) - (setq ibuffer-display-summary nil) - (setq ibuffer-expert t) - (setq ibuffer-show-empty-filter-groups nil) - (setq ibuffer-marked-char ?-) - - (add-hook 'ibuffer-mode-hook 'disable-line-numbers) - (add-hook 'ibuffer-mode-hook (lambda () (ibuffer-auto-mode 1))) - - (defun ibuffer-get-major-modes-ibuff-rules-list (mm-list result-list) - (if mm-list - (let* ((cur-mm (car mm-list)) - (next-res-list-el `(,(symbol-name cur-mm) (mode . ,cur-mm)))) - (ibuffer-get-major-modes-ibuff-rules-list - (cdr mm-list) (cons next-res-list-el result-list))) - result-list)) - - (defun ibuffer-get-major-modes-list () - (mapcar - (function (lambda (buffer) - (buffer-local-value 'major-mode (get-buffer buffer)))) - (buffer-list (selected-frame)))) - - (defun ibuffer-create-buffs-group () - (interactive) - (let* ((ignore-modes '(Buffer-menu-mode - compilation-mode - minibuffer-inactive-mode - ibuffer-mode - magit-process-mode - messages-buffer-mode - fundamental-mode - completion-list-mode - help-mode - Info-mode)) - (cur-bufs - (list (cons "Home" - (ibuffer-get-major-modes-ibuff-rules-list - (cl-set-difference - (remove-duplicates - (ibuffer-get-major-modes-list)) - ignore-modes) '()))))) - (setq ibuffer-saved-filter-groups cur-bufs) - (ibuffer-switch-to-saved-filter-groups "Home"))) - - (autoload 'ibuffer "ibuffer" "List buffers." t) - - (defun ibuffer-group-by-modes () - "Group buffers by modes." - (ibuffer-create-buffs-group)) - - - (defadvice ibuffer-update-title-and-summary (after remove-column-titles) - (with-no-warnings - (save-excursion - (set-buffer "*Ibuffer*") - (toggle-read-only 0) - (goto-char 1) - (search-forward "-\n" nil t) - (delete-region 1 (point)) - ;; (let ((window-min-height 1)) - ;; ;; save a little screen estate - ;; (shrink-window-if-larger-than-buffer)) - (toggle-read-only)))) - - (ad-activate 'ibuffer-update-title-and-summary) - - ;; Use human readable Size column instead of original one - (define-ibuffer-column size-h - (:name "Size" :inline t) - (cond - ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0))) - ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0))) - ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0))) - (t (format "%8d" (buffer-size))))) - - ;; Modify the default ibuffer-formats - (setq ibuffer-formats - '((mark modified read-only " " - (name 18 18 :left :elide) - " " - (size-h 9 -1 :right) - " " - (mode 16 16 :left :elide) - " " - filename-and-process)))) - -(use-package autopair - :delight (autopair-mode) - :config (autopair-global-mode)) - -(global-auto-revert-mode t) - -(use-package comment-dwim-2 - :bind (("M-;" . comment-dwim-2))) - -(use-package dired - :ensure nil - :bind (("C-x C-j" . dired-jump)) - - :config - (setq wdired-use-dired-vertical-movement 'sometimes) - (setq dired-listing-switches "-la") - - (set-face-attribute 'dired-directory nil - :inherit 'default - :foreground "#839496" - :weight 'bold) - - (add-hook 'dired-mode-hook 'disable-line-numbers) - - (defun dired-sort-dir-first () - "Sort dired listings with directories first." - (save-excursion - (let (buffer-read-only) - (forward-line 2) ;; beyond dir. header - (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max))) - (set-buffer-modified-p nil))) - - (defadvice dired-readin - (after dired-after-updating-hook first () activate) - "Sort dired listings with directories first before adding marks." - (dired-sort-dir-first))) - -(use-package dired-subtree - :after dired - :bind (:map dired-mode-map - ("<tab>" . dired-subtree-toggle) - ("C-<tab>" . dired-subtree-cycle) - ("<backtab>" . dired-subtree-remove))) - -;; better describe -(use-package helpful - :bind (("C-h f" . helpful-function) - ("C-h o" . helpful-symbol) - ("C-h k" . helpful-key) - ("C-h v" . helpful-variable)) - :config - (add-hook 'helpful-mode-hook 'disable-line-numbers)) - -(use-package rg - :config - (rg-enable-default-bindings (kbd "M-s")) - (setq rg-executable "/usr/local/bin/rg")) - -;; window management -(bind-keys - ("H-e" . windmove-up) - ("H-d" . windmove-down) - ("H-f" . windmove-right) - ("H-s" . windmove-left) - - ;; Window Resizing - ("H-E" . enlarge-window) - ("H-D" . shrink-window) - ("H-F" . enlarge-window-horizontally) - ("H-S" . shrink-window-horizontally) - - ;; Window Splitting - ("H-v" . split-window-vertically) - ("H-r" . split-window-horizontally) - ("H-w" . delete-window) - ("H-q" . delete-other-windows) - - ;; Misc Window Commands - ("H-a" . balance-windows) - ("H-t" . toggle-window-split) - ("H-<return>". toggle-fullscreen) - - ("H-c" . mjf/center-window)) - -(delight 'subword-mode "" "subword") -(delight 'undo-tree-mode "" "undo-tree") - -(add-hook 'woman-mode-hook 'disable-line-numbers) -(add-hook 'Man-mode-hook 'disable-line-numbers) - -(provide 'core-packages) - -;;; core-packages.el ends here diff --git a/dots/.emacs.d/core/core-paths.el b/dots/.emacs.d/core/core-paths.el @@ -1,48 +0,0 @@ -;;; core-paths.el --- path confiugration for my emacs - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. -;;; Commentary: - -;; move all the misc files created by emacs into a seperate directory to -;; decluter emacs config root - -;;; Code: - -(setq backup-directory-alist - `((".*" . ,temporary-file-directory))) - -(setq auto-save-file-name-transforms - `((".*" ,temporary-file-directory t))) - -(setq auto-save-list-file-prefix "~/.cache/auto-save-list/.saves-") -(setq bookmark-default-file "~/.cache/bookmarks.el") -(setq ede-project-placeholder-cache-file "~/.cache/ede-projects.el") -(setq semanticdb-default-save-directory "~/.cache/semanticdb") -(setq abbrev-file-name "~/.cache/abbrev_defs.el") -(setq tramp-persistency-file-name "~/.cache/tramp.el") -(setq recentf-save-file "~/.cache/recentf") -(setq org-id-locations-file "~/.cache/org-id-locations.el") -(setq nsm-settings-file "~/.cache/network-security.data") -(setq url-configuration-directory "~/.cache/url/") - -(unless (file-exists-p custom-file) - (write-region "" nil custom-file)) - -(provide 'core-paths) - -;;; core-paths.el ends here diff --git a/dots/.emacs.d/core/core-ui.el b/dots/.emacs.d/core/core-ui.el @@ -1,87 +0,0 @@ -;;; core-ui.el --- ui configuration for my emacs - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(when (fboundp 'tool-bar-mode) - (tool-bar-mode -1)) - -(menu-bar-mode -1) - -(when (fboundp 'scroll-bar-mode) - (scroll-bar-mode -1)) - -(blink-cursor-mode -1) ; the blinking cursor is nothing, but an annoyance -(setq ring-bell-function 'ignore) ; disable the annoying bell ring -(setq inhibit-startup-screen t) ; disable startup screen -(fset 'yes-or-no-p 'y-or-n-p) ; enable y/n answers - -;; nice scrolling -(setq scroll-margin 0 - scroll-conservatively 100000 - scroll-preserve-screen-position 1) - -;; mode line numbers -(line-number-mode 0) -(column-number-mode t) - -(delete-selection-mode t) ; Delete Marked regions -(show-paren-mode t) ; Show matching parenthesis - -(setq-default indent-tabs-mode nil) -(setq-default tab-width 8) -(setq-default indicate-empty-lines nil) - -(set-terminal-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) -(prefer-coding-system 'utf-8) - -(setq-default fill-column 72) - -(add-hook 'before-save-hook 'delete-tailing-whitespace) - -(setq echo-keystrokes 0.1) - -(setq frame-resize-pixelwise t) - -(defun on-after-init () - (unless (display-graphic-p (selected-frame)) - (set-face-background 'default "unspecified-bg" (selected-frame)))) - -(add-hook 'window-setup-hook 'on-after-init) - -;; line numbers -(setq-default display-line-numbers-width 3) -(setq display-line-numbers-type 'relative - display-line-numbers-current-absolute t - display-line-numbers-widen nil) ; don't count narrowed regions - -(setq-default line-spacing 5) - -(global-display-line-numbers-mode) - -;; add some padding around the entire frame and fringes -(set-fringe-mode 25) -(set-frame-parameter nil 'internal-border-width 0) - -(provide 'core-ui) - -;;; core-ui.el ends here diff --git a/dots/.emacs.d/lisp/init-local.el b/dots/.emacs.d/lisp/init-local.el @@ -1,42 +0,0 @@ -(resize-small) -(mjf/center-window) - -(load-file "~/.emacs.d/lisp/acme/acme-theme.el") - -(setq-default mode-line-format - '((:propertize " " face mode-line-height) - "%e" - evil-mode-line-tag - mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position - (vc-mode vc-mode) - " " mode-line-modes mode-line-misc-info mode-line-end-spaces)) - -(setq mode-line-format - '((:propertize " " face mode-line-height) - "%e" - evil-mode-line-tag - mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position - (vc-mode vc-mode) - " " mode-line-modes mode-line-misc-info mode-line-end-spaces)) - -(exec-path-from-shell-initialize) - -(setq elfeed-feeds - `("https://thume.ca/atom.xml" - "https://lukesmith.xyz/rss.xml" - "https://nullprogram.com/feed/" - ("https://notrelated.libsyn.com/rss" podcast) - ("http://mfeller.io/rss.xml" personal) - ("https://planet.emacslife.com/atom.xml" emacs community) - ,(mjf/yt-playlist-feed "PLkG-zhy1pVumXUC8e1vdfTciqZgNcpvdq") - ,(mjf/yt-channel-feed "UCBa659QWEk1AI4Tg--mrJ2A") ; Tom Scott - ,(mjf/yt-channel-feed "UC0uTPqBCFIpZxlz_Lv1tk_g") - ,(mjf/yt-channel-feed "UCdJdEguB1F1CiYe7OEi3SBg") ; Jon Tron - ,(mjf/yt-channel-feed "UCEOXxzW2vU0P-0THehuIIeg") ; Captian D - ,(mjf/yt-channel-feed "UCrTNhL_yO3tPTdQ5XgmmWjA") ; Red Letter Media - ,(mjf/yt-channel-feed "UCgXiTWrFg05fTPfw1YLb5Ug") ; Triforce! - )) - -(mjf/initialize-gmail) - -(provide 'init-local) diff --git a/dots/.emacs.d/lisp/init-pre-local.el b/dots/.emacs.d/lisp/init-pre-local.el @@ -1,5 +0,0 @@ -(setq user-full-name "Mark Feller") - -(setenv "SHELL" "/usr/local/bin/zsh") - -(provide 'init-pre-local) diff --git a/dots/.emacs.d/lisp/poet/LICENSE b/dots/.emacs.d/lisp/poet/LICENSE @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Kunal Bhalla - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/dots/.emacs.d/lisp/poet/README.md b/dots/.emacs.d/lisp/poet/README.md @@ -1,68 +0,0 @@ -# poet [![MELPA](https://melpa.org/packages/poet-theme-badge.svg)](https://melpa.org/#/poet-theme) -A light emacs theme that's well suited for prose: particularly org-mode and markdown-mode; or any mode that works well with `variable-pitch` mode. - -## Motivation -The main idea behind this was to make Emacs more friendly for writing prose instead of code. Highlights include mixing monospace and variable pitch text in markdown and org-modes, making it convenient to write prose and code together. For example, - -![Screenshot](https://github.com/kunalb/poet/raw/master/screenshots.png) - -## Set up -- **Installation**: - - **Melpa**: Make sure [melpa is in your package archives list](https://melpa.org/#/getting-started), and <kbd>M-x</kbd> `package-install poet-theme` - - **Manual**: Download the theme to your `custom-theme-directory` which defaults to `~/emacs.d`. -- **Variable-pitch-mode**: Adding variable pitch mode to text modes will help in rendering mixed fonts every time you edit markdown, org-mode, etc. -``` - (add-hook 'text-mode-hook - (lambda () - (variable-pitch-mode 1))) -``` -- **Custom fonts**: Choose your fonts/font sizes before loading the theme with -``` - (set-face-attribute 'default nil :family "Iosevka" :height 130) - (set-face-attribute 'fixed-pitch nil :family "Iosevka") - (set-face-attribute 'variable-pitch nil :family "Baskerville") -``` -- **Mac OSX Title Bar**: Only for **Emacs 26.1** -``` - (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) - (add-to-list 'default-frame-alist '(ns-appearance . light)) -``` -- **Additional useful modes**: Some modes I like to enable/disable -``` - (olivetti-mode 1) ;; Centers text in the buffer - (flyspell-mode 1) ;; Catch Spelling mistakes - (typo-mode 1) ;; Good for symbols like em-dash - - (blink-cursor-mode 0) ;; Reduce visual noise - (linum-mode 0) ;; No line numbers for prose - - (setq org-bullets-bullet-list - '("◉" "○")) - (org-bullets 1) -``` - -## [Reddit](https://www.reddit.com/r/emacs/comments/9e01wf/share_your_modern_emacs/e5lpfmy/) reviews poet -![Reddit](https://github.com/kunalb/poet/raw/master/reddit.png) - -## Warning -- Exclusively aimed at graphical emacs - -## Next Steps -(No fixed timelines for these, depends on my time and motivation) -- [x] Publish v1 to Melpa. ---- -- [x] Add more screenshots showing off different modes (particularly markdown) -- [x] Evaluate & test github flavoured markdown in markdown-mode. -- [x] Publish v2 to Melpa ---- -- [x] Create a poet-dark mode with a yellow/white/black scheme. -- [ ] Add a dark brown theme -- [ ] Add support for customizing font faces -- [ ] Document support for additional modes. -- [ ] Publish v3 to Melpa. - - -## More Screenshots -![Org](https://github.com/kunalb/poet/raw/master/org.png) -![Markdown 1](https://github.com/kunalb/poet/raw/master/md1.png) -![Markdown 2](https://github.com/kunalb/poet/raw/master/md2.png) diff --git a/dots/.emacs.d/lisp/poet/tests/test.md b/dots/.emacs.d/lisp/poet/tests/test.md @@ -1,68 +0,0 @@ ---- -author: Kunal Bhalla ---- - -Test Document -======================== - -Headers ------------- -# Heading 1 -## Heading 2 -### Heading 3 -#### Heading 4 -##### Heading 5 - - -## Bullets -* Some Bullets - * which can be nested - * through multiple levels - -- They - - Can - - Also -+ Be - + Other - + Symbols - -1. Numbered - 2. Bullets - 3. Too! - -## Code -```python -def helloWorld(): - print("Hello, world!") -``` - -Code can also be `inline`. - -## Tables -| Column 1 | Column 2 | -|----------|----------| -| foo | bar | -| baz | qux | -| quux | quuz | - -## Emphasis -Possibly **Strong** -Or *italic* -And can have _underscores_ -Or be ~~deleted~~. - -## Links -[This theme](https://github.com/kunalb/poet) - -## Quotes -> are often misattributed -> -- me - -## Rules ---- -*** ---- - -## Checklists! -- [ ] Do all -- [ ] The Things! diff --git a/dots/.emacs.d/lisp/poet/tests/test.org b/dots/.emacs.d/lisp/poet/tests/test.org @@ -1,33 +0,0 @@ -#+TITLE: Test Org Document -#+DATE: <2018-03-18 Sun> - -* With Features :tag: -** Lots of different features -Just testing out different behaviours in org mode. - -#+BEGIN_SRC elisp -(like code) -#+END_SRC - -#+BEGIN_EXAMPLE -And examples -#+END_EXAMPLE - -* TODO And plain lists -** TODO Something more -** DONE Something else -CLOSED: [2018-04-18 Wed 23:46] -- Some lists are nice - -* DONE And emphasis -- [ ] With a *checklist* -- [X] And /italics/ -- [ ] And _underlines_ -- [ ] And [[https://github.com/kunalb/poet][links]] - -* [#A] And tables -| Test | Table | -|------+--------| -| With | Values | -| 1 | 2 | -| 3 | 4 | diff --git a/dots/.emacs.d/modules/module-company.el b/dots/.emacs.d/modules/module-company.el @@ -1,38 +0,0 @@ -;;; module-company.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package company - :delight (company-mode nil "company") - :demand - :config - (setq company-idle-delay 0) - (setq company-tooltip-limit 10) - (setq company-echo-delay 0) - (setq company-tooltip-flip-when-above t) - (setq company-begin-commands '(self-insert-command)) - - (global-company-mode)) - -(provide 'module-company) - -;;; module-company.el ends here diff --git a/dots/.emacs.d/modules/module-css.el b/dots/.emacs.d/modules/module-css.el @@ -1,35 +0,0 @@ -;;; module-css.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package scss-mode - :disable) - -(use-package less-css-mode - :disable) - -(use-package css-eldoc - :after (eldoc)) - -(provide 'module-css) - -;;; module-css.el ends here diff --git a/dots/.emacs.d/modules/module-docker.el b/dots/.emacs.d/modules/module-docker.el @@ -1,33 +0,0 @@ -;;; module-docker.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package docker - :disabled) - -(use-package dockerfile-mode - :config - (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))) - -(provide 'module-docker) - -;;; module-docker.el ends here diff --git a/dots/.emacs.d/modules/module-eldoc.el b/dots/.emacs.d/modules/module-eldoc.el @@ -1,30 +0,0 @@ -;;; module-eldoc.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package eldoc - :delight (eldoc-mode) - :config (global-eldoc-mode)) - -(provide 'module-eldoc) - -;;; module-eldoc.el ends here diff --git a/dots/.emacs.d/modules/module-eshell.el b/dots/.emacs.d/modules/module-eshell.el @@ -1,54 +0,0 @@ -;;; module-eshell.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun mjf/set-exec-path-from-shell-PATH () - "Set up Emacs' `exec-path` and PATH environment variable to - match that used by the user's shell. This is particularly - useful under macOS, where GUI apps are not started from a - shell." - (interactive) - (let ((path-from-shell - (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) - (setenv "PATH" path-from-shell) - (setq exec-path (split-string path-from-shell path-separator)))) - -(use-package eshell - :bind - (:map eshell-mode-map - ("C-l". evil-scroll-line-to-top)) - - :config - (setq eshell-directory-name "~/.cache/eshell" - eshell-cmpl-cycle-completions nil - eshell-buffer-maximum-lines 20000 - eshell-history-size 350 - eshell-buffer-shorthand t ; buffer shorthand -> echo foo > #'buffer - eshell-highlight-prompt nil - eshell-plain-echo-behavior t) ; treat 'echo' like shell echo - - (add-hook 'eshell-mode-hook 'disable-line-numbers) - (add-to-list 'eshell-load-hook 'mjf/set-exec-path-from-shell-PATH)) - -(provide 'module-eshell) - -;;; module-eshell.el ends here diff --git a/dots/.emacs.d/modules/module-evil.el b/dots/.emacs.d/modules/module-evil.el @@ -1,80 +0,0 @@ -;;; module-evil.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package evil - :bind - (:map evil-normal-state-map ("C-u" . evil-scroll-up)) - (:map evil-visual-state-map ("C-u" . evil-scroll-up)) - (:map evil-insert-state-map ("C-u" . evil-scroll-up)) - - :config - (setq evil-mode-line-format '(before . mode-line-front-space)) - (setq evil-echo-state nil) - (setq evil-esc-delay 0) - - (evil-mode t)) - -(use-package evil-goggles - :delight (evil-goggles-mode) - - :config - (setq evil-goggles-pulse t) - (setq evil-goggles-blocking-duration 0.100) - (setq evil-goggles-async-duration 0.300) - - (evil-goggles-mode t)) - -(use-package evil-surround - :config (global-evil-surround-mode t)) - -(use-package evil-commentary - :disabled - :delight (evil-commentary-mode) - :config (evil-commentary-mode t)) - -(use-package evil-snipe - :disabled - :delight (evil-snipe-mode nil "snipe") - :config (evil-snipe-override-mode t)) - -(use-package evil-org - :disabled - :delight (evil-org-mode) - - :config - (require 'evil-org-agenda) - - (add-hook 'org-mode-hook 'evil-org-mode) - - (evil-org-agenda-set-keys) - (evil-org-set-key-theme '(textobjects - insert - navigation - additional - shift - todo - heading))) - -(provide 'module-evil) - -;;; module-evil.el ends here diff --git a/dots/.emacs.d/modules/module-git.el b/dots/.emacs.d/modules/module-git.el @@ -1,52 +0,0 @@ -;;; module-git.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun mjf/magit-status-with-prefix () - (interactive) - (let ((current-prefix-arg '(4))) - (call-interactively 'magit-status))) - -(use-package magit - :bind (("C-x g" . magit-status) - ("C-x G" . mjf/magit-status-with-prefix)) - :init - (setq transient-history-file "~/.cache/transient/history.el") - (setq transient-display-buffer-action '(display-buffer-below-selected)) - (setq transient-mode-line-format - '("%e" mode-line-front-space mode-line-buffer-identification))) - -(use-package magithub - :disabled - :after magit - :config - (magithub-feature-autoinject t) - (setq magithub-api-timeout 5) - (setq magithub-dir "~/.cache/magithub")) - -(use-package gitignore-mode) - -(use-package git-timemachine) - -(provide 'module-git) - -;;; module-git.el ends here diff --git a/dots/.emacs.d/modules/module-go.el b/dots/.emacs.d/modules/module-go.el @@ -1,132 +0,0 @@ -;;; module-go.el --- Packages used for golang - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defvar mjf/go-compile-command - "go build -v && go vet && go test -covermode=count -coverprofile=out.cover") - -(defun mjf/go-prog-init () - "if go is install go get all dependencies for emacs go packages" - (interactive) - (if (not (eq (executable-find "go") nil)) - (progn - (mapcar (lambda (pkg) - (let ((cmd (concat "go get -u " pkg))) - (call-process-shell-command cmd nil "*go-get-output*" t))) - '("github.com/nsf/gocode" - "golang.org/x/tools/cmd/goimports" - "github.com/rogpeppe/godef" - "github.com/golang/lint" - "golang.org/x/tools/cmd/gorename" - "golang.org/x/tools/cmd/guru" - "github.com/kisielk/errcheck"))) - (message "go executable not found, install go from https://golang.org/download"))) - -(defun mjf/ginkgo-test (package) - "Run ginkgo test suites recursively from a given go package" - (interactive (list (read-directory-name "Package:"))) - (async-shell-command - (concat "ginkgo -r " package) "*Ginkgo Tests*") - - ;; get out of evil insert mode and dont truncate text - (switch-to-buffer "*Ginkgo Tests*") - (local-set-key (kbd "q") 'kill-buffer-and-window) - (evil-motion-state) - (toggle-truncate-lines) - (message nil) - (previous-buffer)) - -(defun mjf/go-cover () - (interactive) - (shell-command "go tool cover -html=out.cover")) - -(defun mjf/setup-go-mode-compile () - "Customize compile command to run go build" - (set (make-local-variable 'compile-command) - mjf/go-compile-command)) - -(defun mjf/go-init-company () - "Initialize company mode for go" - (set (make-local-variable 'company-backends) '(company-go)) - (company-mode)) - -(use-package go-mode - :bind - (:map go-mode-map - ("C-c C-g" . go-goto-imports) - ("C-c C-c" . compile) - ("C-c C-t" . ginkgo-test) - ("C-c C" . go-cover)) - - :init - (unless (getenv "GOPATH") - (setenv "GOPATH" (concat (getenv "HOME") "/prog/go"))) - - (setenv "PATH" (concat (getenv "PATH") ":" - (concat (getenv "GOPATH")"/bin"))) - - :config - (setq gofmt-command "goimports") ; use goimports instead of go-fmt - (setq godoc-command "godoc") ; use godoc instead of go doc - (setq tab-width 8) - - (add-hook 'go-mode-hook 'setup-go-mode-compile) - (add-hook 'go-mode-hook 'subword-mode) - (add-hook 'before-save-hook 'gofmt-before-save)) - -(use-package go-add-tags - :after go-mode) - -(use-package go-errcheck - :after go-mode) - -(use-package go-stacktracer) - -(use-package go-guru - :after go-mode - :bind - (:map go-mode-map - ("M-." . go-guru-definition) - ("C-c d" . go-guru-describe))) - -(use-package company-go - :after (go-mode company) - :config - (add-hook 'go-mode-hook 'mjf/go-init-company)) - -(use-package go-eldoc - :after (go-mode eldoc) - :config - (add-hook 'go-mode-hook 'go-eldoc-setup)) - -(use-package flycheck-gometalinter - :disabled - :after (go-mode flycheck-mode) - :config - (flycheck-gometalinter-setup) - (setq flycheck-gometalinter-deadline "10s") - (setq flycheck-gometalinter-fast t) - (setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo"))) - -(provide 'module-go) - -;;; module-go.el ends here diff --git a/dots/.emacs.d/modules/module-kubernetes.el b/dots/.emacs.d/modules/module-kubernetes.el @@ -1,33 +0,0 @@ -;;; module-kubernetes.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(require 'module-yaml) - -(use-package kubel - :config - (add-to-list 'evil-emacs-state-modes 'kubel-mode) - (add-hook 'kubel-mode-hook 'disable-line-numbers)) - -(provide 'module-kubernetes) - -;;; module-kubernetes.el ends here diff --git a/dots/.emacs.d/modules/module-ledger.el b/dots/.emacs.d/modules/module-ledger.el @@ -1,65 +0,0 @@ -;;; module-ledger.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun mjf/ledger-report (name command) - `(,name ,(concat "%(binary) -f %(ledger-file) " command))) - -(defun mjf/ledger-reports (lst) - (mapcar (lambda (x) - (mjf/ledger-report (car x) (cadr x))) lst)) - -(use-package ledger-mode - :mode "\\.ledger\\'" - :config - (add-hook 'ledger-report-mode-hook 'disable-line-numbers) - (add-hook 'ledger-report-mode-hook 'evil-emacs-state) - - (setq ledger-post-amount-alignment-column 62) - (setq ledger-report-auto-refresh nil) - (setq ledger-reports - (mjf/ledger-reports - '(("bal" "bal -V") - ("reg" "reg") - ("stats" "stats") - ("payee" "reg @%(payee)") - ("account" "reg %(account)") - ("investments" "bal ^Assets:Investments") - ("net worth" "bal ^Assets ^Liabilities -V") - ("forecast" "reg ^Assets ^Liabilities --forecast 'd<[2030]'") - ("creditcard" "reg ^Liabilities:Credit --monthly") - ("budget" "reg ^Expenses -p 'last month' --monthly --budget") - ("budget year" "reg ^Expenses -p 'this year' --monthly --budget") - ("expenses" "bal ^Expenses and not Tax -p 'this month'") - ("expenses monthly" "reg ^Expenses and not Tax -S T -p 'this year' --monthly --collapse") - ("expenses month" "bal ^Expenses and not Tax --flat -S T -p 'last month'") - ("expenses year" "bal ^Expenses and not Tax --flat -S T -p 'this year'") - ("average" "bal ^Expenses -p 'this year' --monthly --average") - ("paystubs" "print Income:Salary"))))) - -(use-package flycheck-ledger - :disabled - :after (flycheck-mode ledger-mode)) - -(provide 'module-ledger) - -;;; module-ledger.el ends here diff --git a/dots/.emacs.d/modules/module-multiple-cursors.el b/dots/.emacs.d/modules/module-multiple-cursors.el @@ -1,10 +0,0 @@ -(use-package multiple-cursors - :bind (("C-S-c C-S-c" . mc/edit-lines) - ("C->" . mc/mark-next-like-this) - ("C-<" . mc/mark-previous-like-this) - ("C-c C-<" . mc/mark-all-like-this) - ("C-S-SPC" . set-rectangular-region-anchor) - ("C-S-c C->" . mc/mark-sgml-tag-pair)) - :init (setq mc/list-file "~/.cache/mc-lists.el")) - -(provide 'module-multiple-cursors) diff --git a/dots/.emacs.d/modules/module-notmuch.el b/dots/.emacs.d/modules/module-notmuch.el @@ -1,86 +0,0 @@ -;;; module-notmuch.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; Notmuch mail provides email indexing and searching based on tags. See -;; https://notmuchmail.org/ - -;;; Code: - -(require 'smtpmail) - -(defun mjf/initialize-gmail () - "Configure smtpmail to use gmail" - (setq message-send-mail-function 'smtpmail-send-it - send-mail-function 'smtpmail-send-it - smtpmail-default-smtp-server "smtp.gmail.com" - smtpmail-smtp-server "smtp.gmail.com" - smtpmail-local-domain "gmail.com" - smtpmail-stream-type 'ssl - smtpmail-smtp-service 465)) - -(defun mjf/tag-deleted () - "Tag mail at point as deleted. This operation will not delete -the mail, but tag it for later deletion." - (interactive) - (notmuch-search-tag '("+deleted" "-inbox" "-unread")) - (next-line)) - -(defun mjf/delete-tagged-mail () - "Delete mail that is tagged with the deleted tag" - (interactive) - (shell-command "notmuch_delete") - (notmuch-refresh-all-buffers)) - -(defun mjf/getmail () - "Fetch mail using getmail" - (interactive) - (message "Fetching mail...") - (shell-command "getmail") - (notmuch-hello-update)) - -(use-package notmuch - :bind - (:map notmuch-search-mode-map - ("d" . mjf/tag-deleted) - ("D" . mjf/delete-tagged-mail) - ("/" . notmuch-search)) - (:map notmuch-tree-mode-map - ("d" . mjf/tag-deleted) - ("D" . mjf/delete-tagged-mail)) - (:map notmuch-hello-mode-map - ("r" . mjf/getmail)) - - :config - (add-hook 'notmuch-hello-mode-hook 'disable-line-numbers) - (add-hook 'notmuch-search-mode-hook 'disable-line-numbers) - (add-hook 'notmuch-tree-mode-hook 'disable-line-numbers) - - (setq notmuch-saved-searches - '((:name "inbox" :query "tag:inbox" :key "i") - (:name "unread" :query "tag:unread" :key "u") - (:name "all" :query "*" :key "a") - (:name "deleted" :query "tag:deleted") - (:name "sent" :query "tag:sent" :key "t") - (:name "drafts" :query "tag:draft" :key "d")))) - -(provide 'module-notmuch) - -;;; module-notmuch.el ends here diff --git a/dots/.emacs.d/modules/module-org.el b/dots/.emacs.d/modules/module-org.el @@ -1,118 +0,0 @@ -;;; module-org.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun mjf/org-summary-todo (n-done n-not-done) - "Switch entry to DONE when all subentries are done, to TODO otherwise." - (let (org-log-done org-log-states) ; turn off logging - (org-todo (if (= n-not-done 0) "DONE" "TODO")))) - -(use-package org - :bind (("C-c l" . org-store-link) - ("C-c a" . org-agenda) - ("C-c c" . org-capture) - :map org-src-mode-map - ("C-x C-s" . org-edit-src-exit)) - :delight (org-indent-mode nil t) - :config - (require 'org-indent) - (require 'org-src) - (require 'ob-shell) - - (setq org-startup-indented t) - (setq org-src-tab-acts-natively t) - (setq org-src-fontify-natively t) - (setq org-hide-emphasis-markers t) - - (add-hook 'org-after-todo-statistics-hook 'mjf/org-summary-todo) - (add-hook 'org-mode-hook 'disable-line-numbers) - (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) - - ;; where I keep all my org files - (setq org-agenda-files - '("~/org/work.org" - "~/org/life.org")) - - ;; personal capture templates - (setq org-capture-templates - '( - ;; unfiled work items - ("w" "Work" entry (file+headline "~/org/work.org" "Unread") - "* TODO %?\n %i\n") - - ;; random thoughts I'd like to capture - ("t" "Thought" entry (file+headline "~/org/work.org" "Thoughts") - "* %?\n %i\n") - - ;; unfiled work items in my life - ("l" "Life" entry (file+headline "~/org/life.org" "Inbox") - "* TODO %?\n %i\n") - - ("j" "Journal" entry (file+datetree "~/org/life.org") - "* TODO %?\n"))) - - ;; when refiling an org header don't search more than 3 levels deep - (setq org-refile-targets - '((nil :maxlevel . 3) - (org-agenda-files :maxlevel . 3))) - - (setq org-todo-keywords - '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)" "CANCELLED(c)") - (sequence "RECURRING(r)" "|" "DONE(d)"))) - - ;; don't make the title big, I don't like that. Also remove those ugly - ;; checkboxes - (set-face-attribute 'org-document-title nil :height 1) - (set-face-attribute 'org-checkbox nil :box nil)) - -(use-package org-bullets - :config - (setq org-bullets-bullet-list '("●" "○" "◉" "•")) - - ;; bullets on lists - (font-lock-add-keywords - 'org-mode - '(("^ +\\([-*]\\) " - (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))) - -(use-package org-fancy-priorities - :ensure t - :delight (org-fancy-priorities-mode) - :hook (org-mode . org-fancy-priorities-mode) - :config - (setq org-fancy-priorities-list '("⬆" "➡" "⬇" "☕")) - (setq org-priority-faces '((65 . "#dc322f") - (66 . "#cb4b16") - (67 . "#859900")))) - -(use-package deft - :disabled - :config - (setq deft-directory "~/org" - deft-extensions '("md" "org") - deft-recursive t) - - (add-hook 'deft-mode-hook (lambda () (evil-emacs-state)))) - -(provide 'module-org) - -;;; module-org.el ends here diff --git a/dots/.emacs.d/modules/module-projectile.el b/dots/.emacs.d/modules/module-projectile.el @@ -1,40 +0,0 @@ -;;; module-projectile.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package projectile - :delight (projectile-mode) - :bind - (:map projectile-mode-map - ("C-c p" . 'projectile-command-map)) - :config - (setq projectile-completion-system 'ivy) - (setq projectile-cache-file "~/.cache/projectile-cache") - (setq projectile-known-projects-file "~/.cache/projectile-bookmarks.eld")) - -(use-package counsel-projectile - :after (counsel projectile) - :config (counsel-projectile-mode)) - -(provide 'module-projectile) - -;;; module-projectile.el ends here diff --git a/dots/.emacs.d/modules/module-python.el b/dots/.emacs.d/modules/module-python.el @@ -1,73 +0,0 @@ -;;; module-python.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun pyenv-init() - (setq global-pyenv (replace-regexp-in-string "\n" "" (shell-command-to-string "pyenv global"))) - (message (concat "Setting pyenv version to " global-pyenv)) - (pyenv-mode-set global-pyenv) - (defvar pyenv-current-version nil global-pyenv)) - -(defun mjf/pyenv-activate-current-project () - "Automatically activates pyenv version if .python-version file exists." - (interactive) - (f-traverse-upwards - (lambda (path) - (message path) - (let ((pyenv-version-path (f-expand ".python-version" path))) - (if (f-exists? pyenv-version-path) - (progn - (setq pyenv-current-version (s-trim (f-read-text pyenv-version-path 'utf-8))) - (pyenv-mode-set pyenv-current-version) - (pyvenv-workon pyenv-current-version) - (message (concat "Setting virtualenv to " pyenv-current-version)))))))) - -(use-package python - :config - (setq python-shell-interpreter "ipython") - (setq python-shell-interpreter-args "-i --simple-prompt") - - ;; Enable hideshow minor mode in python for folding and unfolding - (add-hook 'python-mode-hook 'hs-minor-mode)) - -(use-package elpy - :bind - (:map elpy-mode-map - ("C-c C-j" . elpy-goto-definition) - ("M-," . pop-tag-mark)) - - :config - (setq elpy-rpc-backend "jedi") - (setq elpy-rpc-python-command "python3") - (setq elpy-shell-echo-output nil) - - (elpy-enable)) - -(use-package pip-requirements - :config - (add-hook 'pip-requirements-mode-hook #'pip-requirements-auto-complete-setup)) - -(use-package py-autopep8) - -(provide 'module-python) - -;;; module-python.el ends here diff --git a/dots/.emacs.d/modules/module-rust.el b/dots/.emacs.d/modules/module-rust.el @@ -1,76 +0,0 @@ -;;; module-rust.el --- Packages used for rust - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(defun mjf/rust-prog-init () - "if cargo is install get all depencies for emacs rust packages" - (interactive) - (if (not (eq (executable-find "cargo") nil)) - (progn - (mapcar (lambda (pkg) - (let ((cmd (concat "cargo install " pkg))) - (call-process-shell-command cmd nil "*cargo-output*" t))) - '("racer"))) - (message "cargo executable not found"))) - -(defun mjf/setup-rust-mode-compile () - "Customize compile command to run go build" - (if (not (string-match "cargo" compile-command)) - (set (make-local-variable 'compile-command) - "cargo build"))) - -(use-package rust-mode - :bind - (:map rust-mode-map - ("C-c C-c" . compile) - ("C-c <tab>" . rust-format-buffer)) - - :config - (setq rust-format-on-save t) - (add-hook 'rust-mode-hook 'mjf/setup-rust-mode-compile)) - -(use-package racer - :after (rust-mode) - :delight racer-mode - :bind - (:map rust-mode-map - ("TAB" . company-indent-or-complete-common) - ("C-c d" . racer-describe)) - - :config - (setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH - (setq racer-rust-src-path (concat (getenv "HOME") "/prog/rust/src")) ;; Rust source code PATH - (setq company-tooltip-align-annotations t) - - (add-hook 'rust-mode-hook #'racer-mode) - (add-hook 'racer-mode-hook #'eldoc-mode) - (add-hook 'racer-mode-hook #'company-mode)) - -(use-package flycheck-rust - :disable - :after (flycheck-mode rust-mode) - :config - (progn (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))) - -(provide 'module-rust) - -;;; module-rust.el ends here diff --git a/dots/.emacs.d/modules/module-undo-tree.el b/dots/.emacs.d/modules/module-undo-tree.el @@ -1,8 +0,0 @@ -(delight 'undo-tree-mode "" "undo-tree") - -(use-package undo-tree - :disabled - :delight (undo-tree-mode "" "undo-tree") - :config (global-undo-tree-mode t)) - -(provide 'module-undo-tree) diff --git a/dots/.emacs.d/modules/module-yasnippet.el b/dots/.emacs.d/modules/module-yasnippet.el @@ -1,34 +0,0 @@ -;;; module-yasnippet.el - -;; Author: Mark Feller <mark.feller@member.fsf.org> - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this file. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;;; Code: - -(use-package yasnippet - :mode ("/\\.emacs\\.d/snippets/" . snippet-mode) - :delight yas-minor-mode - :demand - :config - (yas-load-directory "~/.emacs.d/snippets/") - (yas-global-mode 1)) - -(provide 'module-yasnippet) - -;;; module-yasnippet.el ends here