commit 7f3d5ac18f6c490344091e7821dcc6223d638f79
parent 225acc4d9e9ca032a893e2ae886e38b9e8df33a3
Author: rmj <pwishie@gmail.com>
Date: Sat, 11 Apr 2020 16:09:25 -0700
indentation fix
Diffstat:
M | .econfig.org | | | 1201 | +++++++++++++++++++++++++++++++++++++++++-------------------------------------- |
1 file changed, 621 insertions(+), 580 deletions(-)
diff --git a/.econfig.org b/.econfig.org
@@ -7,97 +7,97 @@
** init
#+BEGIN_SRC emacs-lisp
-(server-start)
+ (server-start)
-(eval-when-compile
+ (eval-when-compile
(require 'use-package))
-(defalias 'yes-or-no-p 'y-or-n-p)
+ (defalias 'yes-or-no-p 'y-or-n-p)
- (set-frame-parameter (selected-frame) 'alpha '(90 . 50))
- (add-to-list 'default-frame-alist '(alpha . (90 . 50)))
+ (set-frame-parameter (selected-frame) 'alpha '(90 . 50))
+ (add-to-list 'default-frame-alist '(alpha . (90 . 50)))
#+END_SRC
** font and theme
#+BEGIN_SRC emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/lisp/")
+ (add-to-list 'load-path "~/.emacs.d/lisp/")
-(require 'popup-pos-tip)
+ (require 'popup-pos-tip)
-(defadvice popup-tip
- (around popup-pos-tip-wrapper (string &rest args) activate)
- (if (eq window-system 'x)
- (apply 'popup-pos-tip string args)
- ad-do-it))
+ (defadvice popup-tip
+ (around popup-pos-tip-wrapper (string &rest args) activate)
+ (if (eq window-system 'x)
+ (apply 'popup-pos-tip string args)
+ ad-do-it))
-(setq x-gtk-use-system-tooltips nil)
+ (setq x-gtk-use-system-tooltips nil)
-;; font
+ ;; font
(add-to-list 'default-frame-alist
- '(font . "Hack:antialias=true:size=16:style=Regular")
- '(font . "Fira Code Symbol:antialias=true:size=16:style=Regular"))
-
-(defun fira-code-mode--make-alist (list)
- "Generate prettify-symbols alist from LIST."
- (let ((idx -1))
- (mapcar
- (lambda (s)
- (setq idx (1+ idx))
- (let* ((code (+ #Xe100 idx))
- (width (string-width s))
- (prefix ())
- (suffix '(?\s (Br . Br)))
- (n 1))
- (while (< n width)
- (setq prefix (append prefix '(?\s (Br . Bl))))
- (setq n (1+ n)))
- (cons s (append prefix suffix (list (decode-char 'ucs code))))))
- list)))
-
-(defconst fira-code-mode--ligatures
- '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\"
- "{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}"
- "--" "---" "-->" "->" "->>" "-<" "-<<" "-~"
- "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_("
- ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*"
- "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||="
- "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "=="
- "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">="
- ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>"
- "<$" "<$>" "<!--" "<-" "<--" "<->" "<+" "<+>" "<="
- "<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<" "<~"
- "<~~" "</" "</>" "~@" "~-" "~=" "~>" "~~" "~~>" "%%"
- "x" ":" "+" "+" "*"))
-
-(defvar fira-code-mode--old-prettify-alist)
-
-(defun fira-code-mode--enable ()
- "Enable Fira Code ligatures in current buffer."
- (setq-local fira-code-mode--old-prettify-alist prettify-symbols-alist)
- (setq-local prettify-symbols-alist (append (fira-code-mode--make-alist fira-code-mode--ligatures) fira-code-mode--old-prettify-alist))
- (prettify-symbols-mode t))
-
-(defun fira-code-mode--disable ()
- "Disable Fira Code ligatures in current buffer."
- (setq-local prettify-symbols-alist fira-code-mode--old-prettify-alist)
- (prettify-symbols-mode -1))
-
-(define-minor-mode fira-code-mode
- "Fira Code ligatures minor mode"
- :lighter ""
- (setq-local prettify-symbols-unprettify-at-point 'right-edge)
- (if fira-code-mode
- (fira-code-mode--enable)
- (fira-code-mode--disable)))
-
-(defun fira-code-mode--setup ()
- "Setup Fira Code Symbols"
- (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))
-
-(add-hook 'rust-mode-hook 'fira-code-mode)
-
-(defun my/create-greek-ligatures ()
+ '(font . "Hack:antialias=true:size=16:style=Regular")
+ '(font . "Fira Code Symbol:antialias=true:size=16:style=Regular"))
+
+ (defun fira-code-mode--make-alist (list)
+ "Generate prettify-symbols alist from LIST."
+ (let ((idx -1))
+ (mapcar
+ (lambda (s)
+ (setq idx (1+ idx))
+ (let* ((code (+ #Xe100 idx))
+ (width (string-width s))
+ (prefix ())
+ (suffix '(?\s (Br . Br)))
+ (n 1))
+ (while (< n width)
+ (setq prefix (append prefix '(?\s (Br . Bl))))
+ (setq n (1+ n)))
+ (cons s (append prefix suffix (list (decode-char 'ucs code))))))
+ list)))
+
+ (defconst fira-code-mode--ligatures
+ '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\"
+ "{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}"
+ "--" "---" "-->" "->" "->>" "-<" "-<<" "-~"
+ "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_("
+ ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*"
+ "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||="
+ "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "=="
+ "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">="
+ ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>"
+ "<$" "<$>" "<!--" "<-" "<--" "<->" "<+" "<+>" "<="
+ "<==" "<=>" "<=<" "<>" "<<" "<<-" "<<=" "<<<" "<~"
+ "<~~" "</" "</>" "~@" "~-" "~=" "~>" "~~" "~~>" "%%"
+ "x" ":" "+" "+" "*"))
+
+ (defvar fira-code-mode--old-prettify-alist)
+
+ (defun fira-code-mode--enable ()
+ "Enable Fira Code ligatures in current buffer."
+ (setq-local fira-code-mode--old-prettify-alist prettify-symbols-alist)
+ (setq-local prettify-symbols-alist (append (fira-code-mode--make-alist fira-code-mode--ligatures) fira-code-mode--old-prettify-alist))
+ (prettify-symbols-mode t))
+
+ (defun fira-code-mode--disable ()
+ "Disable Fira Code ligatures in current buffer."
+ (setq-local prettify-symbols-alist fira-code-mode--old-prettify-alist)
+ (prettify-symbols-mode -1))
+
+ (define-minor-mode fira-code-mode
+ "Fira Code ligatures minor mode"
+ :lighter ""
+ (setq-local prettify-symbols-unprettify-at-point 'right-edge)
+ (if fira-code-mode
+ (fira-code-mode--enable)
+ (fira-code-mode--disable)))
+
+ (defun fira-code-mode--setup ()
+ "Setup Fira Code Symbols"
+ (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))
+
+ (add-hook 'rust-mode-hook 'fira-code-mode)
+
+ (defun my/create-greek-ligatures ()
"Create greek ligatures."
(push '("lambda" . ?λ ) prettify-symbols-alist)
(push '("alpha" . ?α ) prettify-symbols-alist)
@@ -105,23 +105,23 @@
(push '("theta" . ?θ ) prettify-symbols-alist)
(push '("omega" . ?ω ) prettify-symbols-alist))
-(add-hook 'after-init-hook 'my/create-greek-ligatures)
+ (add-hook 'after-init-hook 'my/create-greek-ligatures)
-(add-to-list 'load-path "~/.emacs.d/themes/")
+ (add-to-list 'load-path "~/.emacs.d/themes/")
-(setq modus-vivendi-theme-slanted-constructs nil
- modus-vivendi-theme-bold-constructs nil
- modus-vivendi-theme-visible-fringes nil
- modus-vivendi-theme-subtle-diffs nil
- modus-vivendi-theme-distinct-org-blocks nil
- modus-vivendi-theme-proportional-fonts nil
- modus-vivendi-theme-scale-headings nil
- modus-vivendi-theme-scale-1 1
- modus-vivendi-theme-scale-2 1
- modus-vivendi-theme-scale-3 1
- modus-vivendi-theme-scale-4 1)
+ (setq modus-vivendi-theme-slanted-constructs nil
+ modus-vivendi-theme-bold-constructs nil
+ modus-vivendi-theme-visible-fringes nil
+ modus-vivendi-theme-subtle-diffs nil
+ modus-vivendi-theme-distinct-org-blocks nil
+ modus-vivendi-theme-proportional-fonts nil
+ modus-vivendi-theme-scale-headings nil
+ modus-vivendi-theme-scale-1 1
+ modus-vivendi-theme-scale-2 1
+ modus-vivendi-theme-scale-3 1
+ modus-vivendi-theme-scale-4 1)
-(load-theme 'modus-vivendi t)
+ (load-theme 'modus-vivendi t)
;; (use-package telephone-line
;; :init
@@ -138,132 +138,132 @@
;;
(use-package powerline
- :ensure t
+ :ensure t
- :init
- (powerline-default-theme))
+ :init
+ (powerline-default-theme))
-(global-set-key (kbd "M-<up>") 'text-scale-increase)
-(global-set-key (kbd "M-<down>") 'text-scale-decrease)
-(scroll-bar-mode nil)
+ (global-set-key (kbd "M-<up>") 'text-scale-increase)
+ (global-set-key (kbd "M-<down>") 'text-scale-decrease)
+ (scroll-bar-mode nil)
-(use-package shr
- :commands (eww
- eww-browse-url)
- :config
- ;(setq browse-url-browser-function 'eww-browse-url)
- (setq shr-use-fonts nil)
- (setq shr-use-colors nil)
- (setq shr-max-image-proportion 0.2)
- (setq shr-width (current-fill-column)))
+ (use-package shr
+ :commands (eww
+ eww-browse-url)
+ :config
+ ;(setq browse-url-browser-function 'eww-browse-url)
+ (setq shr-use-fonts nil)
+ (setq shr-use-colors nil)
+ (setq shr-max-image-proportion 0.2)
+ (setq shr-width (current-fill-column)))
#+END_SRC
** Ivy-mode
#+BEGIN_SRC emacs-lisp
-(use-package counsel
+ (use-package counsel
:ensure t)
-(use-package swiper
+ (use-package swiper
:ensure t)
-(use-package ivy
+ (use-package ivy
:ensure t
:init
-
- (ivy-mode 1)
- (setq ivy-use-virtual-buffers t)
- (setq enable-recursive-minibuffers t)
- ;; enable this if you want `swiper' to use it
- ;; (setq search-default-mode #'char-fold-to-regexp)
- (global-set-key "\C-s" 'swiper)
- (global-set-key (kbd "<f6>") 'ivy-resume)
- (global-set-key (kbd "M-x") 'counsel-M-x)
- (global-set-key (kbd "<f5> f") 'counsel-describe-function)
- (global-set-key (kbd "<f5> v") 'counsel-describe-variable)
- (global-set-key (kbd "<f5> l") 'counsel-find-library)
- (global-set-key (kbd "<f5> i") 'counsel-info-lookup-symbol)
- (global-set-key (kbd "<f5> u") 'counsel-unicode-char)
- (global-set-key (kbd "s-c g") 'counsel-git)
- (global-set-key (kbd "s-c j") 'counsel-git-grep)
- (global-set-key (kbd "s-c k") 'counsel-ag)
- (global-set-key (kbd "s-x l") 'counsel-locate)
- (global-set-key (kbd "s-S-o") 'counsel-rhythmbox)
- (define-key minibuffer-local-map (kbd "s-r") 'counsel-minibuffer-history))
+
+ (ivy-mode 1)
+ (setq ivy-use-virtual-buffers t)
+ (setq enable-recursive-minibuffers t)
+ ;; enable this if you want `swiper' to use it
+ ;; (setq search-default-mode #'char-fold-to-regexp)
+ (global-set-key "\C-s" 'swiper)
+ (global-set-key (kbd "<f6>") 'ivy-resume)
+ (global-set-key (kbd "M-x") 'counsel-M-x)
+ (global-set-key (kbd "<f5> f") 'counsel-describe-function)
+ (global-set-key (kbd "<f5> v") 'counsel-describe-variable)
+ (global-set-key (kbd "<f5> l") 'counsel-find-library)
+ (global-set-key (kbd "<f5> i") 'counsel-info-lookup-symbol)
+ (global-set-key (kbd "<f5> u") 'counsel-unicode-char)
+ (global-set-key (kbd "s-c g") 'counsel-git)
+ (global-set-key (kbd "s-c j") 'counsel-git-grep)
+ (global-set-key (kbd "s-c k") 'counsel-ag)
+ (global-set-key (kbd "s-x l") 'counsel-locate)
+ (global-set-key (kbd "s-S-o") 'counsel-rhythmbox)
+ (define-key minibuffer-local-map (kbd "s-r") 'counsel-minibuffer-history))
#+END_SRC
** Misc
#+BEGIN_SRC emacs-lisp
-(put 'upcase-region 'disabled nil)
-(electric-pair-mode t)
-(show-paren-mode 1)
-(setq-default indent-tabs-mode nil)
-(setq-default tab-width 4)
-(setq column-number-mode t)
-(display-time-mode 1)
-(tool-bar-mode -1)
-(menu-bar-mode -1)
+ (put 'upcase-region 'disabled nil)
+ (electric-pair-mode t)
+ (show-paren-mode 1)
+ (setq-default indent-tabs-mode nil)
+ (setq-default tab-width 4)
+ (setq column-number-mode t)
+ (display-time-mode 1)
+ (tool-bar-mode -1)
+ (menu-bar-mode -1)
-;(scroll-bar-mode -1)
-(setq ring-bell-function 'ignore)
-(blink-cursor-mode 0)
-(set-language-environment "UTF-8")
-(setq redisplay-dont-pause t)
+ ;(scroll-bar-mode -1)
+ (setq ring-bell-function 'ignore)
+ (blink-cursor-mode 0)
+ (set-language-environment "UTF-8")
+ (setq redisplay-dont-pause t)
#+END_SRC
** Filename-mode associations
#+BEGIN_SRC emacs-lisp
-(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
-;(add-to-list 'auto-mode-alist '(".\\'" . conf-mode)) ; run conf mode on dotfiles
-(add-to-list 'auto-mode-alist '("\\config\\'" . conf-mode))
-(add-to-list 'auto-mode-alist '("\\.service\\'" . systemd-mode))
-(add-to-list 'auto-mode-alist '("\\.fish\\'" . fish-mode))
-(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
-(add-to-list 'auto-mode-alist '("\\.Xdefaults'" . conf-xdefaults-mode))
-(add-to-list 'auto-mode-alist '("\\.Xresources'" . conf-xdefaults-mode))
+ (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
+ ;(add-to-list 'auto-mode-alist '(".\\'" . conf-mode)) ; run conf mode on dotfiles
+ (add-to-list 'auto-mode-alist '("\\config\\'" . conf-mode))
+ (add-to-list 'auto-mode-alist '("\\.service\\'" . systemd-mode))
+ (add-to-list 'auto-mode-alist '("\\.fish\\'" . fish-mode))
+ (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
+ (add-to-list 'auto-mode-alist '("\\.Xdefaults'" . conf-xdefaults-mode))
+ (add-to-list 'auto-mode-alist '("\\.Xresources'" . conf-xdefaults-mode))
#+END_SRC
** joestar
#+BEGIN_SRC emacs-lisp
- (use-package joestar
+ (use-package joestar
:init
(progn
- (defvar undo-tree-map
- (let ((map (make-sparse-keymap)))
- ;; remap `undo' and `undo-only' to `undo-tree-undo'
- (define-key map [remap undo] 'undo-tree-undo)
- (define-key map [remap undo-only] 'undo-tree-undo)
- ;; bind standard undo bindings (since these match redo counterparts)
- (define-key map (kbd "C-/") 'undo-tree-undo)
- (define-key map "\C-_" 'undo-tree-undo)
- ;; redo doesn't exist normally, so define our own keybindings
- (define-key map (kbd "C-?") 'undo-tree-redo)
- (define-key map (kbd "M-_") 'undo-tree-redo)
- ;; just in case something has defined `redo'...
- (define-key map [remap redo] 'undo-tree-redo)
- ;; we use "C-x u" for the undo-tree visualizer
- (define-key map (kbd "s-x u") 'undo-tree-visualize)
- ;; bind register commands
- (define-key map (kbd "s-x r u") 'undo-tree-save-state-to-register)
- (define-key map (kbd "s-x r U") 'undo-tree-restore-state-from-register)
- ;; set keymap
- (setq undo-tree-map map))))
+ (defvar undo-tree-map
+ (let ((map (make-sparse-keymap)))
+ ;; remap `undo' and `undo-only' to `undo-tree-undo'
+ (define-key map [remap undo] 'undo-tree-undo)
+ (define-key map [remap undo-only] 'undo-tree-undo)
+ ;; bind standard undo bindings (since these match redo counterparts)
+ (define-key map (kbd "C-/") 'undo-tree-undo)
+ (define-key map "\C-_" 'undo-tree-undo)
+ ;; redo doesn't exist normally, so define our own keybindings
+ (define-key map (kbd "C-?") 'undo-tree-redo)
+ (define-key map (kbd "M-_") 'undo-tree-redo)
+ ;; just in case something has defined `redo'...
+ (define-key map [remap redo] 'undo-tree-redo)
+ ;; we use "C-x u" for the undo-tree visualizer
+ (define-key map (kbd "s-x u") 'undo-tree-visualize)
+ ;; bind register commands
+ (define-key map (kbd "s-x r u") 'undo-tree-save-state-to-register)
+ (define-key map (kbd "s-x r U") 'undo-tree-restore-state-from-register)
+ ;; set keymap
+ (setq undo-tree-map map))))
:load-path
- "~/.emacs.d/joestar/")
+ "~/.emacs.d/joestar/")
(global-joestar-mode)
;; global move window keys so non joestar buffers can still have these bindings
(global-set-key (kbd "M-<left>") #'(lambda ()
- (interactive)
- (other-window -1)))
+ (interactive)
+ (other-window -1)))
(global-set-key (kbd "M-<right>") #'(lambda ()
- (interactive)
- (other-window 1)))
+ (interactive)
+ (other-window 1)))
(global-set-key (kbd "S-<right>") 'joe-nbuf)
(global-set-key (kbd "S-<left>") 'joe-pbuf)
@@ -272,32 +272,35 @@
** org
#+BEGIN_SRC emacs-lisp
-(use-package org-indent-mode
+ (use-package org-indent-mode
:config
(org-indent-mode t)
:hook org-mode)
-(use-package org-bullets
+ (use-package org-bullets
:ensure t)
+ (setq org-src-tab-acts-natively t)
+
#+END_SRC
* IDE
** company-mode and flycheck
#+BEGIN_SRC emacs-lisp
-(use-package irony-mode
-:config
- (irony-mode t)
-:init
- (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
- (eval-after-load 'flycheck
- '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
+ (use-package irony-mode
+ :config
+ (irony-mode t)
+ :init
+ (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
+ (eval-after-load 'flycheck
+ '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
- (eval-after-load 'company
- '(add-to-list 'company-backends 'company-irony))
+ (eval-after-load 'company
+ '(add-to-list 'company-backends 'company-irony))
- :hook c++-mode)
-(use-package company-mode
+ :hook c++-mode)
+
+ (use-package company-mode
:config
(company-mode t)
(require 'company-c-headers)
@@ -305,46 +308,46 @@
(require 'company-irony)
(require 'color)
(require 'company-quickhelp)
-
- (let ((bg (face-attribute 'default :background)))
- (custom-set-faces
- `(company-tooltip ((t (:inherit default :background ,(color-lighten-name bg 2)))))
- `(company-scrollbar-bg ((t (:background ,(color-lighten-name bg 10)))))
- `(company-scrollbar-fg ((t (:background ,(color-lighten-name bg 5)))))
- `(company-tooltip-selection ((t (:inherit font-lock-function-name-face))))
- `(company-tooltip-common ((t (:inherit font-lock-constant-face))))))
+
+ (let ((bg (face-attribute 'default :background)))
+ (custom-set-faces
+ `(company-tooltip ((t (:inherit default :background ,(color-lighten-name bg 2)))))
+ `(company-scrollbar-bg ((t (:background ,(color-lighten-name bg 10)))))
+ `(company-scrollbar-fg ((t (:background ,(color-lighten-name bg 5)))))
+ `(company-tooltip-selection ((t (:inherit font-lock-function-name-face))))
+ `(company-tooltip-common ((t (:inherit font-lock-constant-face))))))
(eval-after-load 'irony
- '((add-to-list 'company-backends 'company-irony)
- (add-to-list 'company-backends 'company-c-headers)
- (add-to-list 'company-backends 'company-irony-c-headers)))
+ '((add-to-list 'company-backends 'company-irony)
+ (add-to-list 'company-backends 'company-c-headers)
+ (add-to-list 'company-backends 'company-irony-c-headers)))
(company-quickhelp-mode t)
- :hook (prog-mode))
-
+ :hook (prog-mode))
+
(use-package flycheck-mode
- :config
-
- (flycheck-mode t)
- (define-key flycheck-mode-map flycheck-keymap-prefix nil)
- (setq flycheck-keymap-prefix (kbd \"s-s f\"))
- (define-key flycheck-mode-map flycheck-keymap-prefix
- flycheck-command-map)
+ :config
+
+ (flycheck-mode t)
+ (define-key flycheck-mode-map flycheck-keymap-prefix nil)
+ (setq flycheck-keymap-prefix (kbd \"s-s f\"))
+ (define-key flycheck-mode-map flycheck-keymap-prefix
+ flycheck-command-map)
+
+ :hook (prog-mode))
- :hook (prog-mode))
-
#+END_SRC
** all programming languages
*** todos
#+BEGIN_SRC emacs-lisp
-(use-package fic-mode
-:config
- (fic-mode t)
-:hook prog-mode)
+ (use-package fic-mode
+ :config
+ (fic-mode t)
+ :hook prog-mode)
#+END_SRC
** C/C++
@@ -352,67 +355,67 @@
#+BEGIN_SRC emacs-lisp
-(setq c-default-style "linux"
- c-basic-offset 4)
+ (setq c-default-style "linux"
+ c-basic-offset 4)
-(c-set-offset 'substatement-open 0)
+ (c-set-offset 'substatement-open 0)
-(use-package modern-cpp-font-lock
+ (use-package modern-cpp-font-lock
:ensure t
:init
(modern-c++-font-lock-global-mode t))
-
-(add-hook 'c++-mode-hook 'irony-mode)
-(add-hook 'c-mode-hook 'irony-mode)
+
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
#+END_SRC
*** company and yasnippet
#+BEGIN_SRC emacs-lisp
-(add-hook 'c++-mode-hook
- (lambda () (setq flycheck-clang-language-standard "c++17")))
+ (add-hook 'c++-mode-hook
+ (lambda () (setq flycheck-clang-language-standard "c++17")))
-(require 'yasnippet)
-(yas-reload-all)
-(add-hook 'prog-mode-hook #'yas-minor-mode)
+ (require 'yasnippet)
+ (yas-reload-all)
+ (add-hook 'prog-mode-hook #'yas-minor-mode)
#+END_SRC
** lisp
#+BEGIN_SRC emacs-lisp
- (use-package slime
- :config
- (setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
- (setq slime-contribs '(slime-fancy))
- (load (expand-file-name "~/quicklisp/slime-helper.el"))
- ;; Replace "sbcl" with the path to your implementation
- (setq inferior-lisp-program "sbcl"))
+ (use-package slime
+ :config
+ (setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
+ (setq slime-contribs '(slime-fancy))
+ (load (expand-file-name "~/quicklisp/slime-helper.el"))
+ ;; Replace "sbcl" with the path to your implementation
+ (setq inferior-lisp-program "sbcl"))
-
-(setq geiser-active-implementations '(guile))
-(use-package rainbow-delimiters
+
+ (setq geiser-active-implementations '(guile))
+ (use-package rainbow-delimiters
:ensure t
:init
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
-(use-package elisp-def
+ (use-package elisp-def
:ensure t
:init
(dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook))
- (add-hook hook #'elisp-def-mode)))
+ (add-hook hook #'elisp-def-mode)))
#+END_SRC
** Misc
#+BEGIN_SRC emacs-lisp
-(use-package neotree
+ (use-package neotree
:ensure t
:init (global-set-key [f8] 'neotree-toggle))
-(use-package emojify
+ (use-package emojify
:ensure t
:init (global-emojify-mode))
#+END_SRC
@@ -421,107 +424,107 @@
#+BEGIN_SRC emacs-lisp
-(fset 'perl-mode 'cperl-mode)
-(setq cperl-indent-level 4)
-(setq cperl-extra-newline-before-brace t
- cperl-brace-offset -2
- cperl-merge-trailing-else nil)
+ (fset 'perl-mode 'cperl-mode)
+ (setq cperl-indent-level 4)
+ (setq cperl-extra-newline-before-brace t
+ cperl-brace-offset -2
+ cperl-merge-trailing-else nil)
+
+ (add-hook 'perl-mode-hook (lambda ()
+ (set (make-local-variable 'rebox-style-loop) '(75 11))
+ (set (make-local-variable 'rebox-min-fill-column) 79)
+ (rebox-mode 1)))
-(add-hook 'perl-mode-hook (lambda ()
- (set (make-local-variable 'rebox-style-loop) '(75 11))
- (set (make-local-variable 'rebox-min-fill-column) 79)
- (rebox-mode 1)))
-
#+END_SRC
*** Ruby
#+BEGIN_SRC emacs-lisp
-(add-hook 'ruby-mode-hook 'robe-mode)
-(add-hook 'robe-mode-hook 'ac-robe-setup)
+ (add-hook 'ruby-mode-hook 'robe-mode)
+ (add-hook 'robe-mode-hook 'ac-robe-setup)
#+END_SRC
** golang
#+BEGIN_SRC emacs-lisp
-(defun set-exec-path-from-shell-PATH ()
- (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 eshell-path-env path-from-shell) ; for eshell users
- (setq exec-path (split-string path-from-shell path-separator))))
+ (defun set-exec-path-from-shell-PATH ()
+ (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 eshell-path-env path-from-shell) ; for eshell users
+ (setq exec-path (split-string path-from-shell path-separator))))
-(when window-system (set-exec-path-from-shell-PATH))
+ (when window-system (set-exec-path-from-shell-PATH))
-(setenv "GOPATH" "/home/rmj/src/goproj/")
+ (setenv "GOPATH" "/home/rmj/src/goproj/")
-(add-to-list 'exec-path "/home/rmj/src/goproj/bin/")
-(add-hook 'before-save-hook 'gofmt-before-save)
+ (add-to-list 'exec-path "/home/rmj/src/goproj/bin/")
+ (add-hook 'before-save-hook 'gofmt-before-save)
-(use-package go-mode
- :ensure t
- :init
- (defun my-go-mode-hook ()
- ; Call Gofmt before saving
+ (use-package go-mode
+ :ensure t
+ :init
+ (defun my-go-mode-hook ()
+ ; Call Gofmt before saving
(add-hook 'before-save-hook 'gofmt-before-save)
- ; Godef jump key binding
+ ; Godef jump key binding
(local-set-key (kbd "M-.") 'godef-jump)
(local-set-key (kbd "M-*") 'pop-tag-mark)
(add-to-list 'company-backends 'company-go)
- ; Customize compile command to run go build
+ ; Customize compile command to run go build
(if (not (string-match "go" compile-command))
(set (make-local-variable 'compile-command)
"go build -v && go test -v && go vet")))
- (add-hook 'go-mode-hook 'my-go-mode-hook))
+ (add-hook 'go-mode-hook 'my-go-mode-hook))
#+END_SRC
** rust
#+BEGIN_SRC emacs-lisp
-(use-package cargo
+ (use-package cargo
:config
(cargo-minor-mode t)
-
+
+ :hook
+ (rust-mode))
+
+ (use-package racer
+ :ensure t
+ :init
+
+ (setq racer-cmd "~/.cargo/bin/racer")
+ (setq racer-rust-src-path "/home/rmj/src/rust/src/")
+ :config
+ (progn
+ (racer-mode t)
+ (eldoc-mode t)
+ (company-mode t)
+ (flycheck-rust-setup)
+ (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
+ (setq company-tooltip-align-annotations t)
+ (local-set-key (kbd "C-c <tab>") #'rust-format-buffer))
+
:hook
(rust-mode))
-
- (use-package racer
- :ensure t
- :init
-
- (setq racer-cmd "~/.cargo/bin/racer")
- (setq racer-rust-src-path "/home/rmj/src/rust/src/")
- :config
- (progn
- (racer-mode t)
- (eldoc-mode t)
- (company-mode t)
- (flycheck-rust-setup)
- (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
- (setq company-tooltip-align-annotations t)
- (local-set-key (kbd "C-c <tab>") #'rust-format-buffer))
-
- :hook
- (rust-mode))
#+END_SRC
** HTML/CSS/JS
#+BEGIN_SRC emacs-lisp
-(use-package web-mode
- :ensure t
- :init
+ (use-package web-mode
+ :ensure t
+ :init
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(setq web-mode-ac-sources-alist
- '(("css" . (ac-source-css-property))
- ("html" . (ac-source-words-in-buffer ac-source-abbrev))))
+ '(("css" . (ac-source-css-property))
+ ("html" . (ac-source-words-in-buffer ac-source-abbrev))))
(setq web-mode-enable-auto-quoting t))
-(use-package emmet-mode
+ (use-package emmet-mode
:ensure t
:config
@@ -535,20 +538,20 @@
** Python
#+BEGIN_SRC emacs-lisp
-(use-package elpy
+ (use-package elpy
:ensure t
:init
(defun my-init-elpy ()
- "Init elpy."
- (elpy-enable)
- (add-to-list 'company-backends 'elpy-company-backend)
+ "Init elpy."
+ (elpy-enable)
+ (add-to-list 'company-backends 'elpy-company-backend)
- (when (require 'flycheck nil t)
- (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
- (add-hook 'elpy-mode-hook 'flycheck-mode))
+ (when (require 'flycheck nil t)
+ (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
+ (add-hook 'elpy-mode-hook 'flycheck-mode))
- (flymake-mode nil)
- (eldoc-mode nil))
+ (flymake-mode nil)
+ (eldoc-mode nil))
(add-hook 'python-mode-hook 'my-init-elpy))
@@ -559,49 +562,49 @@
** spellcheck
#+BEGIN_SRC emacs-lisp
-(setq ispell-program-name (executable-find "hunspell"))
-(setq ispell-local-dictionary "en_US")
-(setq ispell-local-dictionary-alist
- '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
+ (setq ispell-program-name (executable-find "hunspell"))
+ (setq ispell-local-dictionary "en_US")
+ (setq ispell-local-dictionary-alist
+ '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
+
-
#+END_SRC
** line numbers
#+BEGIN_SRC emacs-lisp
-(setq linum-relative-backend 'display-line-numbers-mode)
-(require 'linum-relative)
-(linum-relative-on)
+ (setq linum-relative-backend 'display-line-numbers-mode)
+ (require 'linum-relative)
+ (linum-relative-on)
#+END_SRC
** sudo edit
#+BEGIN_SRC emacs-lisp
-(defun er-sudo-edit (&optional arg)
- "Edit currently visited file as root With a prefix ARG prompt for a file to visit. Will also prompt for a file to visit if current buffer is not visiting a file."
- (interactive "P")
- (if (or arg (not buffer-file-name))
- (find-file (concat "/sudo:root@localhost:"
- (ido-read-file-name "Find file(as root): ")))
- (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
+ (defun er-sudo-edit (&optional arg)
+ "Edit currently visited file as root With a prefix ARG prompt for a file to visit. Will also prompt for a file to visit if current buffer is not visiting a file."
+ (interactive "P")
+ (if (or arg (not buffer-file-name))
+ (find-file (concat "/sudo:root@localhost:"
+ (ido-read-file-name "Find file(as root): ")))
+ (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
#+END_SRC
** misc
#+BEGIN_SRC emacs-lisp
-;; tell emacs not to use the clipboard
-;(setq x-select-enable-clipboard nil)
+ ;; tell emacs not to use the clipboard
+ ;(setq x-select-enable-clipboard nil)
-(global-set-key (kbd "s-i") 'ido-switch-buffer)
+ (global-set-key (kbd "s-i") 'ido-switch-buffer)
#+END_SRC
** latex
#+BEGIN_SRC emacs-lisp
-(setq auto-revert-interval 0.5)
+ (setq auto-revert-interval 0.5)
-(use-package company-auctex
+ (use-package company-auctex
:ensure t
:init
(company-auctex-init)
@@ -609,7 +612,7 @@
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
(setq auctex-latexmk-inherit-TeX-PDF-mode t))
-(use-package auctex-latexmk
+ (use-package auctex-latexmk
:ensure t
:init
(auctex-latexmk-setup)
@@ -619,13 +622,13 @@
#+END_SRC
** highlighting
#+BEGIN_SRC emacs-lisp
-;; rainbow delimeters
+ ;; rainbow delimeters
-(use-package rainbow-mode
- :config (rainbow-mode t)
-
+ (use-package rainbow-mode
+ :config (rainbow-mode t)
+
- :hook (web-mode c-mode c++-mode js2-mode))
+ :hook (web-mode c-mode c++-mode js2-mode))
#+END_SRC
@@ -633,253 +636,291 @@
** email
#+BEGIN_SRC emacs-lisp
- (use-package shrface
- :after shr
- :quelpa
- (shrface :repo "chenyanming/shrface" :fetcher github))
-
- (use-package org-mime
- :ensure t)
-
- (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e/")
- (require 'mu4e)
-
- (setq mu4e-maildir (expand-file-name "~/Maildir"))
-
- ; get mail
- (setq mu4e-get-mail-command "mbsync pwishie-gmail"
- ;; mu4e-html2text-command "w3m -T text/html" ;;using the default mu4e-shr2text
- mu4e-view-prefer-html t
- mu4e-update-interval 300
- mu4e-headers-auto-update t
- mu4e-compose-signature-auto-include nil
- mu4e-compose-format-flowed t)
+ (use-package shrface
+ :after shr
+ :quelpa
+ (shrface :repo "chenyanming/shrface" :fetcher github))
- ;; to view selected message in the browser, no signin, just html mail
- (add-to-list 'mu4e-view-actions
- '("ViewInBrowser" . mu4e-action-view-in-browser) t)
+ (use-package org-mime
+ :ensure t)
- ;; enable inline images
- (setq mu4e-view-show-images t)
- ;; use imagemagick, if available
- (when (fboundp 'imagemagick-register-types)
- (imagemagick-register-types))
+ (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e/")
+ (require 'mu4e)
+
+ (setq mu4e-maildir (expand-file-name "~/Maildir"))
- ;; every new email composition gets its own frame!
- (setq mu4e-compose-in-new-frame t)
+ ; get mail
+ (setq mu4e-get-mail-command "mbsync pwishie-gmail"
+ ;; mu4e-html2text-command "w3m -T text/html" ;;using the default mu4e-shr2text
+ mu4e-view-prefer-html t
+ mu4e-update-interval 300
+ mu4e-headers-auto-update t
+ mu4e-compose-signature-auto-include nil
+ mu4e-compose-format-flowed t)
- ;; don't save message to Sent Messages, IMAP takes care of this
- (setq mu4e-sent-messages-behavior 'delete)
+ ;; to view selected message in the browser, no signin, just html mail
+ (add-to-list 'mu4e-view-actions
+ '("ViewInBrowser" . mu4e-action-view-in-browser) t)
+
+ ;; enable inline images
+ (setq mu4e-view-show-images t)
+ ;; use imagemagick, if available
+ (when (fboundp 'imagemagick-register-types)
+ (imagemagick-register-types))
+
+ ;; every new email composition gets its own frame!
+ (setq mu4e-compose-in-new-frame t)
+
+ ;; don't save message to Sent Messages, IMAP takes care of this
+ (setq mu4e-sent-messages-behavior 'delete)
+
+ (add-hook 'mu4e-view-mode-hook #'visual-line-mode)
+
+ ;; (defun my-render-html-message ()
+ ;; (let ((dom (libxml-parse-html-region (point-min) (point-max))))
+ ;; (erase-buffer)
+ ;; (shr-insert-document dom)
+ ;; (goto-char (point-min))))
+
+ ;; (setq mu4e-html2text-command 'my-render-html-message)
+
+
+ ;; <tab> to navigate to links, <RET> to open them in browser
+ (add-hook 'mu4e-view-mode-hook
+ (lambda()
+ ;; try to emulate some of the eww key-bindings
+ (local-set-key (kbd "<RET>") 'mu4e~view-browse-url-from-binding)
+ (local-set-key (kbd "<tab>") 'shr-next-link)
+ (local-set-key (kbd "<backtab>") 'shr-previous-link)))
+
+ ;; from https://www.reddit.com/r/emacs/comments/bfsck6/mu4e_for_dummies/elgoumx
+ (add-hook 'mu4e-headers-mode-hook
+ (defun my/mu4e-change-headers ()
+ (interactive)
+ (setq mu4e-headers-fields
+ `((:human-date . 25) ;; alternatively, use :date
+ (:flags . 6)
+ (:from . 22)
+ (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject
+ (:size . 7)))))
+
+ ;; if you use date instead of human-date in the above, use this setting
+ ;; give me ISO(ish) format date-time stamps in the header list
+ ;(setq mu4e-headers-date-format "%Y-%m-%d %H:%M")
+
+ ;; spell check
+ (add-hook 'mu4e-compose-mode-hook
+ (defun my-do-compose-stuff ()
+ "My settings for message composition."
+ (visual-line-mode)
+ ;(org-mu4e-compose-org-mode)
+ (use-hard-newlines -1)
+ (flyspell-mode)))
+
+ (require 'smtpmail)
+
+ ;;rename files when moving
+ ;;NEEDED FOR MBSYNC
+ (setq mu4e-change-filenames-when-moving t)
+
+ ;;set up queue for offline email
+ ;;use mu mkdir ~/Maildir/acc/queue to set up first
+ (setq smtpmail-queue-mail nil) ;; start in normal mode
+
+ ;;from the info manual
+ (setq mu4e-attachment-dir "~/Downloads")
+
+ (setq message-kill-buffer-on-exit t)
+ (setq mu4e-compose-dont-reply-to-self t)
+
+ (require 'org-mu4e)
+
+ ;; convert org mode to HTML automatically
+ (setq org-mu4e-convert-to-html t)
+
+ (setq mu4e-org-contacts-file (expand-file-name "~/.emacs.d/contacts.org"))
+ (add-to-list 'mu4e-headers-actions
+ '("org-contact-add" . mu4e-action-add-org-contact) t)
+ (add-to-list 'mu4e-view-actions
+ '("org-contact-add" . mu4e-action-add-org-contact) t)
+
+ ;;from vxlabs config
+ ;; show full addresses in view message (instead of just names)
+ ;; toggle per name with M-RET
+ (setq mu4e-view-show-addresses 't)
+
+ ;; don't ask when quitting
+ (setq mu4e-confirm-quit nil)
+
+ (require 'smtpmail-multi)
+
+ (require 'feedmail)
+
+ ;; mu4e-context
+ (setq mu4e-context-policy 'pick-first)
+ (setq mu4e-compose-context-policy 'always-ask)
+ (setq mu4e-contexts
+ (list
+ (make-mu4e-context
+ :name "personal" ;;for pwishie-gmail
+ :enter-func (lambda () (mu4e-message "Entering context personal"))
+ :leave-func (lambda () (mu4e-message "Leaving context personal"))
+ :match-func (lambda (msg)
+ (when msg
+ (mu4e-message-contact-field-matches
+ msg '(:from :to :cc :bcc) "pwishie@gmail.com")))
+ :vars '((user-mail-address . "pwishie@gmail.com")
+ (user-full-name . "Ryan")
+ (mu4e-sent-folder . "/pwishie-gmail/[pwishie].Sent Mail")
+ (mu4e-drafts-folder . "/pwishie-gmail/[pwishie].drafts")
+ (mu4e-trash-folder . "/pwishie-gmail/[pwishie].Bin")
+ (mu4e-compose-signature . (concat "Formal Signature\n" "Emacs 25, org-mode 9, mu4e 1.0\n"))
+ (mu4e-compose-format-flowed . t)
+ (smtpmail-queue-dir . "~/Maildir/pwishie-gmail/queue/cur")
+ (setq message-send-mail-function 'message-send-mail-with-sendmail
+ sendmail-program "/usr/bin/msmtp"
+ user-full-name "Ryan Jeffrey")
+
+ (setq message-sendmail-envelope-from 'header)
+ (add-hook 'message-send-mail-hook 'choose-msmtp-account)
+ (smtpmail-smtp-user . "pwishie")
+ (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil)))
+ (smtpmail-auth-credentials . (expand-file-name "~/.emacs.d/.authinfo.gpg"))
+ (smtpmail-default-smtp-server . "smtp.gmail.com")
+ (smtpmail-smtp-server . "smtp.gmail.com")
+ (smtpmail-smtp-service . 587)
+ (smtpmail-debug-info . t)
+ (smtpmail-debug-verbose . t)
+ (mu4e-maildir-shortcuts . ( ("/pwishie-gmail/INBOX" . ?i)
+ ("/pwishie-gmail/[pwishie].Sent Mail" . ?s)
+ ("/pwishie-gmail/[pwishie].Bin" . ?t)
+ ("/pwishie-gmail/[pwishie].All Mail" . ?a)
+ ("/pwishie-gmail/[pwishie].Starred" . ?r)
+ ("/pwishie-gmail/[pwishie].drafts" . ?d)
+ ))))
+ ;; (make-mu4e-context
+ ;; :name "personal" ;;for rmjxyz-gmail
+ ;; :enter-func (lambda () (mu4e-message "Entering context personal"))
+ ;; :leave-func (lambda () (mu4e-message "Leaving context personal"))
+ ;; :match-func (lambda (msg)
+ ;; (when msg
+ ;; (mu4e-message-contact-field-matches
+ ;; msg '(:from :to :cc :bcc) "rmjxyz@gmail.com")))
+ ;; :vars '((user-mail-address . "rmjxyz@gmail.com")
+ ;; (user-full-name . "User Account2")
+ ;; (mu4e-sent-folder . "/rmjxyz-gmail/[rmjxyz].Sent Mail")
+ ;; (mu4e-drafts-folder . "/rmjxyz-gmail/[rmjxyz].drafts")
+ ;; (mu4e-trash-folder . "/rmjxyz-gmail/[rmjxyz].Trash")
+ ;; (mu4e-compose-format-flowed . t)
+ ;; (smtpmail-queue-dir . "~/Maildir/rmjxyz-gmail/queue/cur")
+ ;; (message-send-mail-function . smtpmail-send-it)
+ ;; (smtpmail-smtp-user . "rmjxyz")
+ ;; (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil)))
+ ;; (smtpmail-auth-credentials . (expand-file-name "~/.emacs.d/.authinfo.gpg"))
+ ;; (smtpmail-default-smtp-server . "smtp.gmail.com")
+ ;; (smtpmail-smtp-server . "smtp.gmail.com")
+ ;; (smtpmail-smtp-service . 587)
+ ;; (smtpmail-debug-info . t)
+ ;; (smtpmail-debug-verbose . t)
+ ;; (mu4e-maildir-shortcuts . ( ("/rmjxyz-gmail/INBOX" . ?i)
+ ;; ("/rmjxyz-gmail/[rmjxyz].Sent Mail" . ?s)
+ ;; ("/rmjxyz-gmail/[rmjxyz].Trash" . ?t)
+ ;; ("/rmjxyz-gmail/[rmjxyz].All Mail" . ?a)
+ ;; ("/rmjxyz-gmail/[rmjxyz].Starred" . ?r)
+ ;; ("/rmjxyz-gmail/[rmjxyz].drafts" . ?d)
+ ;; ))))
+ ))
- (add-hook 'mu4e-view-mode-hook #'visual-line-mode)
+#+END_SRC
+** rss
+#+BEGIN_SRC emacs-lisp
- ;; (defun my-render-html-message ()
- ;; (let ((dom (libxml-parse-html-region (point-min) (point-max))))
- ;; (erase-buffer)
- ;; (shr-insert-document dom)
- ;; (goto-char (point-min))))
+ (use-package elfeed
+ :ensure t
+ :init
+ (setq elfeed-db-directory (expand-file-name "~/.elrss"))
+ (define-key elfeed-search-mode-map (kbd "u") '(lambda ()
+ (interactive)
+ (message "Updating elfeed database.")
+ (elfeed-update)))
+
+ (setq-default elfeed-search-filter "@6-months-ago +unread -reddit")
+
+ ;; from https://github.com/skeeto/elfeed/issues/190#issuecomment-384346895
+ (setq elfeed-show-mode-hook
+ (lambda ()
+ (set-face-attribute 'variable-pitch (selected-frame) :font (font-spec :family "Ubuntu" :size 12))
+ (setq fill-column 120)
+ (setq elfeed-show-entry-switch #'my-show-elfeed)))
+
+ (defun my-show-elfeed (buffer)
+ (with-current-buffer buffer
+ (setq buffer-read-only nil)
+ (goto-char (point-min))
+ (re-search-forward "\n\n")
+ (fill-individual-paragraphs (point) (point-max))
+ (setq buffer-read-only t))
+ (switch-to-buffer buffer)))
+
+ (use-package elfeed-org
+ :ensure t
+ :init
+ (global-set-key (kbd "s-x w") 'elfeed)
+ (elfeed-org)
+ (setq rmh-elfeed-org-files (list "/home/rmj/.emacs.d/elfeed.org")))
- ;; (setq mu4e-html2text-command 'my-render-html-message)
+ (require 'color)
- ;; <tab> to navigate to links, <RET> to open them in browser
- (add-hook 'mu4e-view-mode-hook
- (lambda()
- ;; try to emulate some of the eww key-bindings
- (local-set-key (kbd "<RET>") 'mu4e~view-browse-url-from-binding)
- (local-set-key (kbd "<tab>") 'shr-next-link)
- (local-set-key (kbd "<backtab>") 'shr-previous-link)))
+ (defface comic-tag
+ '((t :foreground "#AE6486"))
+ "Marks comic tags")
- ;; from https://www.reddit.com/r/emacs/comments/bfsck6/mu4e_for_dummies/elgoumx
- (add-hook 'mu4e-headers-mode-hook
- (defun my/mu4e-change-headers ()
- (interactive)
- (setq mu4e-headers-fields
- `((:human-date . 25) ;; alternatively, use :date
- (:flags . 6)
- (:from . 22)
- (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject
- (:size . 7)))))
- ;; if you use date instead of human-date in the above, use this setting
- ;; give me ISO(ish) format date-time stamps in the header list
- ;(setq mu4e-headers-date-format "%Y-%m-%d %H:%M")
+ (defface podcast-tag
+ '((t :foreground "#6699CC"))
+ "Marks podcast tags")
- ;; spell check
- (add-hook 'mu4e-compose-mode-hook
- (defun my-do-compose-stuff ()
- "My settings for message composition."
- (visual-line-mode)
- ;(org-mu4e-compose-org-mode)
- (use-hard-newlines -1)
- (flyspell-mode)))
+ (push '(comic comic-tag)
+ elfeed-search-face-alist)
- (require 'smtpmail)
+ (push '(podcast podcast-tag)
+ elfeed-search-face-alist)
- ;;rename files when moving
- ;;NEEDED FOR MBSYNC
- (setq mu4e-change-filenames-when-moving t)
- ;;set up queue for offline email
- ;;use mu mkdir ~/Maildir/acc/queue to set up first
- (setq smtpmail-queue-mail nil) ;; start in normal mode
- ;;from the info manual
- (setq mu4e-attachment-dir "~/Downloads")
+ ;; from https://github.com/ravarspath/emacs-conf/blob/master/lisp/ravar-custom.el
+ (setq ravar/elfeed-podcast-dir "/home/rmj/Music/podcast")
- (setq message-kill-buffer-on-exit t)
- (setq mu4e-compose-dont-reply-to-self t)
+ (defun ravar/elfeed-play-enclosure-mpd ()
+ "Downloads the item in the enclosure and starts in playing in mpd using mpc"
+ (interactive)
+ (let* ((entry elfeed-show-entry)
+ (enclosure-index (elfeed--get-enclosure-num
+ "Enclosure to save" entry))
+ (url-enclosure (car (elt (elfeed-entry-enclosures entry)
+ (- enclosure-index 1))))
+ (fname
+ (funcall elfeed-show-enclosure-filename-function
+ entry url-enclosure)))
+ (start-process-shell-command
+ "play enclosure" nil
+ (format "cd %s; wget %s;mpc update; mpc search filename %s | mpc insert;
+ mpc next; mpc play "
+ ravar/elfeed-podcast-dir url-enclosure fname))))
- (require 'org-mu4e)
+ (define-key elfeed-show-mode-map (kbd "o") 'ravar/elfeed-play-enclosure-mpd)
- ;; convert org mode to HTML automatically
- (setq org-mu4e-convert-to-html t)
-
- (setq mu4e-org-contacts-file (expand-file-name "~/.emacs.d/contacts.org"))
- (add-to-list 'mu4e-headers-actions
- '("org-contact-add" . mu4e-action-add-org-contact) t)
- (add-to-list 'mu4e-view-actions
- '("org-contact-add" . mu4e-action-add-org-contact) t)
-
- ;;from vxlabs config
- ;; show full addresses in view message (instead of just names)
- ;; toggle per name with M-RET
- (setq mu4e-view-show-addresses 't)
-
- ;; don't ask when quitting
- (setq mu4e-confirm-quit nil)
-
- (require 'smtpmail-multi)
-
- (require 'feedmail)
-
- ;; mu4e-context
- (setq mu4e-context-policy 'pick-first)
- (setq mu4e-compose-context-policy 'always-ask)
- (setq mu4e-contexts
- (list
- (make-mu4e-context
- :name "personal" ;;for pwishie-gmail
- :enter-func (lambda () (mu4e-message "Entering context personal"))
- :leave-func (lambda () (mu4e-message "Leaving context personal"))
- :match-func (lambda (msg)
- (when msg
- (mu4e-message-contact-field-matches
- msg '(:from :to :cc :bcc) "pwishie@gmail.com")))
- :vars '((user-mail-address . "pwishie@gmail.com")
- (user-full-name . "Ryan")
- (mu4e-sent-folder . "/pwishie-gmail/[pwishie].Sent Mail")
- (mu4e-drafts-folder . "/pwishie-gmail/[pwishie].drafts")
- (mu4e-trash-folder . "/pwishie-gmail/[pwishie].Bin")
- (mu4e-compose-signature . (concat "Formal Signature\n" "Emacs 25, org-mode 9, mu4e 1.0\n"))
- (mu4e-compose-format-flowed . t)
- (smtpmail-queue-dir . "~/Maildir/pwishie-gmail/queue/cur")
- (setq message-send-mail-function 'message-send-mail-with-sendmail
- sendmail-program "/usr/bin/msmtp"
- user-full-name "Ryan Jeffrey")
-
- (setq message-sendmail-envelope-from 'header)
- (add-hook 'message-send-mail-hook 'choose-msmtp-account)
- (smtpmail-smtp-user . "pwishie")
- (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil)))
- (smtpmail-auth-credentials . (expand-file-name "~/.emacs.d/.authinfo.gpg"))
- (smtpmail-default-smtp-server . "smtp.gmail.com")
- (smtpmail-smtp-server . "smtp.gmail.com")
- (smtpmail-smtp-service . 587)
- (smtpmail-debug-info . t)
- (smtpmail-debug-verbose . t)
- (mu4e-maildir-shortcuts . ( ("/pwishie-gmail/INBOX" . ?i)
- ("/pwishie-gmail/[pwishie].Sent Mail" . ?s)
- ("/pwishie-gmail/[pwishie].Bin" . ?t)
- ("/pwishie-gmail/[pwishie].All Mail" . ?a)
- ("/pwishie-gmail/[pwishie].Starred" . ?r)
- ("/pwishie-gmail/[pwishie].drafts" . ?d)
- ))))
- ;; (make-mu4e-context
- ;; :name "personal" ;;for rmjxyz-gmail
- ;; :enter-func (lambda () (mu4e-message "Entering context personal"))
- ;; :leave-func (lambda () (mu4e-message "Leaving context personal"))
- ;; :match-func (lambda (msg)
- ;; (when msg
- ;; (mu4e-message-contact-field-matches
- ;; msg '(:from :to :cc :bcc) "rmjxyz@gmail.com")))
- ;; :vars '((user-mail-address . "rmjxyz@gmail.com")
- ;; (user-full-name . "User Account2")
- ;; (mu4e-sent-folder . "/rmjxyz-gmail/[rmjxyz].Sent Mail")
- ;; (mu4e-drafts-folder . "/rmjxyz-gmail/[rmjxyz].drafts")
- ;; (mu4e-trash-folder . "/rmjxyz-gmail/[rmjxyz].Trash")
- ;; (mu4e-compose-format-flowed . t)
- ;; (smtpmail-queue-dir . "~/Maildir/rmjxyz-gmail/queue/cur")
- ;; (message-send-mail-function . smtpmail-send-it)
- ;; (smtpmail-smtp-user . "rmjxyz")
- ;; (smtpmail-starttls-credentials . (("smtp.gmail.com" 587 nil nil)))
- ;; (smtpmail-auth-credentials . (expand-file-name "~/.emacs.d/.authinfo.gpg"))
- ;; (smtpmail-default-smtp-server . "smtp.gmail.com")
- ;; (smtpmail-smtp-server . "smtp.gmail.com")
- ;; (smtpmail-smtp-service . 587)
- ;; (smtpmail-debug-info . t)
- ;; (smtpmail-debug-verbose . t)
- ;; (mu4e-maildir-shortcuts . ( ("/rmjxyz-gmail/INBOX" . ?i)
- ;; ("/rmjxyz-gmail/[rmjxyz].Sent Mail" . ?s)
- ;; ("/rmjxyz-gmail/[rmjxyz].Trash" . ?t)
- ;; ("/rmjxyz-gmail/[rmjxyz].All Mail" . ?a)
- ;; ("/rmjxyz-gmail/[rmjxyz].Starred" . ?r)
- ;; ("/rmjxyz-gmail/[rmjxyz].drafts" . ?d)
- ;; ))))
- ))
#+END_SRC
-** rss
-#+BEGIN_SRC emacs-lisp
-
-(use-package elfeed
- :ensure t
- :init
- (setq elfeed-db-directory (expand-file-name "~/.elrss"))
- (define-key elfeed-search-mode-map (kbd "u") '(lambda ()
- (interactive)
- (message "Updating elfeed database.")
- (elfeed-update)))
-
- (setq-default elfeed-search-filter "@6-months-ago +unread -reddit"))
-
-(use-package elfeed-org
- :ensure t
- :init
- (global-set-key (kbd "s-x w") 'elfeed)
- (elfeed-org)
- (setq rmh-elfeed-org-files (list "/home/rmj/.emacs.d/elfeed.org")))
-
-
-;; from https://github.com/ravarspath/emacs-conf/blob/master/lisp/ravar-custom.el
-(setq ravar/elfeed-podcast-dir "/home/rmj/Music/podcast")
+#+RESULTS:
+: ravar/elfeed-play-enclosure-mpd
-(defun ravar/elfeed-play-enclosure-mpd ()
- "Downloads the item in the enclosure and starts in playing in mpd using mpc"
- (interactive)
- (let* ((entry elfeed-show-entry)
- (enclosure-index (elfeed--get-enclosure-num
- "Enclosure to save" entry))
- (url-enclosure (car (elt (elfeed-entry-enclosures entry)
- (- enclosure-index 1))))
- (fname
- (funcall elfeed-show-enclosure-filename-function
- entry url-enclosure)))
- (start-process-shell-command
- "play enclosure" nil
- (format "cd %s; wget %s;mpc update; mpc search filename %s | mpc insert;
-mpc next; mpc play "
- ravar/elfeed-podcast-dir url-enclosure fname))))
-
- (define-key elfeed-show-mode-map (kbd "o") 'ravar/elfeed-play-enclosure-mpd)
-
-
-#+END_SRC
** pdf
#+BEGIN_SRC emacs-lisp
-(use-package pdf-tools
+ (use-package pdf-tools
:ensure t
:init
(pdf-tools-install)
@@ -899,38 +940,38 @@ mpc next; mpc play "
** Terminal stuff
#+BEGIN_SRC emacs-lisp
-(add-hook 'term-mode-hook
- (defun my-term-mode-hook ()
- (setq bidi-paragraph-direction 'left-to-right)))
- (setq-default term-suppress-hard-newline t)
+ (add-hook 'term-mode-hook
+ (defun my-term-mode-hook ()
+ (setq bidi-paragraph-direction 'left-to-right)))
+ (setq-default term-suppress-hard-newline t)
#+END_SRC
*** vterm
#+BEGIN_SRC emacs-lisp
-(use-package vterm
-:ensure t
-:init
-(custom-set-faces
+ (use-package vterm
+ :ensure t
+ :init
+ (custom-set-faces
- '(vterm-color-black ((t (:foreground "#3F3F3F" :background "#2B2B2B"))))
- '(vterm-color-red ((t (:foreground "#AC7373" :background "#8C5353"))))
- '(vterm-color-green ((t (:foreground "#7F9F7F" :background "#9FC59F"))))
- '(vterm-color-yellow ((t (:foreground "#DFAF8F" :background "#9FC59F"))))
- '(vterm-color-blue ((t (:foreground "#7CB8BB" :background "#4C7073"))))
- '(vterm-color-magenta ((t (:foreground "#DC8CC3" :background "#CC9393"))))
- '(vterm-color-cyan ((t (:foreground "#93E0E3" :background "#8CD0D3"))))
- '(vterm-color-white ((t (:foreground "#DCDCCC" :background "#656555"))))
+ '(vterm-color-black ((t (:foreground "#3F3F3F" :background "#2B2B2B"))))
+ '(vterm-color-red ((t (:foreground "#AC7373" :background "#8C5353"))))
+ '(vterm-color-green ((t (:foreground "#7F9F7F" :background "#9FC59F"))))
+ '(vterm-color-yellow ((t (:foreground "#DFAF8F" :background "#9FC59F"))))
+ '(vterm-color-blue ((t (:foreground "#7CB8BB" :background "#4C7073"))))
+ '(vterm-color-magenta ((t (:foreground "#DC8CC3" :background "#CC9393"))))
+ '(vterm-color-cyan ((t (:foreground "#93E0E3" :background "#8CD0D3"))))
+ '(vterm-color-white ((t (:foreground "#DCDCCC" :background "#656555"))))
- '(vterm-default-fg-color ((t (:inherit vterm-color-white))))
- '(vterm-default-bg-color ((t (:inherit vterm-color-black))))))
+ '(vterm-default-fg-color ((t (:inherit vterm-color-white))))
+ '(vterm-default-bg-color ((t (:inherit vterm-color-black))))))
#+END_SRC
** ssh
#+BEGIN_SRC emacs-lisp
-(use-package ssh
-:ensure t
-:init
+ (use-package ssh
+ :ensure t
+ :init
(add-hook 'ssh-mode-hook
(lambda ()
(setq ssh-directory-tracking-mode t)
@@ -941,7 +982,7 @@ mpc next; mpc play "
** misc
#+BEGIN_SRC emacs-lisp
-(use-package highlight-indentation
+ (use-package highlight-indentation
:ensure t)
#+END_SRC
@@ -949,6 +990,6 @@ mpc next; mpc play "
#+BEGIN_SRC emacs-lisp
(defun insert-current-date () (interactive)
- (insert (shell-command-to-string "echo -n $(date +\"%d %b %Y %X\")")))
+ (insert (shell-command-to-string "echo -n $(date +\"%d %b %Y %X\")")))
#+END_SRC