** [[https://github.com/jwiegley/use-package/][use-package]]
#+BEGIN_SRC emacs-lisp
(package-initialize)
- (require 'use-package)
+ (condition-case nil
+ (require 'use-package)
+ (progn (package-install 'use-package)
+ (require 'use-package)))
#+END_SRC
** Paradox
#+BEGIN_SRC emacs-lisp
:ensure t
:diminish flyspell-mode 🐝
:config
- (add-hook 'message-mode-hook 'turn-on-flyspell)
(add-hook 'text-mode-hook 'turn-on-flyspell)
(add-hook 'c-mode-common-hook 'flyspell-prog-mode)
(add-hook 'cperl-mode-hook 'flyspell-prog-mode)
((equal arg 16) (helm-org-rifle-occur-agenda-files))
(t (helm-org-agenda-files-headings)))))))
#+END_SRC
-
+*** Helm Google
+This can be used to link things pretty quickly if necessary
+#+BEGIN_SRC emacs-lisp
+ (use-package helm-google
+ :ensure t
+ :bind ("C-c h g" . helm-google)
+ :config
+ (progn (add-to-list 'helm-google-actions
+ '("Copy URL" . (lambda (candidate)
+ (let ((url
+ (replace-regexp-in-string
+ "https://.*q=\\(.*\\)\&sa=.*"
+ "\\1" candidate)))
+ (kill-new url))))
+ t
+ )
+
+ (add-to-list 'helm-google-actions
+ '("Org Store Link" . (lambda (candidate)
+ (let ((title (car (split-string candidate "[\n]+")))
+ (url
+ (replace-regexp-in-string
+ "https://.*q=\\(.*\\)\&sa=.*"
+ "\\1" candidate)))
+ (push (list url title) org-stored-links))))
+ t)
+ ))
+#+END_SRC
+** Zap to char
+#+BEGIN_SRC emacs-lisp
+ (use-package avy-zap
+ :ensure t
+ :bind ("M-z" . avy-zap-up-to-char-dwim))
+#+END_SRC
** Hydra
#+BEGIN_SRC emacs-lisp :tangle don-configuration.el
(require 'don-hydra)
(setq post-uses-fill-mode nil)
)
#+END_SRC
+** Mutt
+*** Message-mode
+#+BEGIN_SRC emacs-lisp
+ (use-package message-mode
+
+ :mode "muttng-[a-z0-9]+-[0-9]+-"
+ :mode "mutt-[a-z0-9]+-[0-9]+-"
+ :hook 'my/message-mode-settings
+ :hook 'turn-on-flyspell
+ :bind (:map message-mode-map
+ ("C-c C-a" . my/post-attach-file))
+ :config
+ (defun my/message-mode-settings ()
+ (font-lock-add-keywords nil
+ '(("^[ \t]*>[ \t]*>[ \t]*>.*$"
+ (0 'message-multiply-quoted-text-face))
+ ("^[ \t]*>[ \t]*>.*$"
+ (0 'message-double-quoted-text-face))))
+ )
+
+ (defun my/post-attach-file ()
+ "Prompt for an attachment."
+ (interactive)
+ (let ((file (read-file-name "Attach file: " nil nil t nil))
+ (description (string-read "Description: ")))
+ (my/header-attach-file file description)))
+
+ (defun my/header-attach-file (file description)
+ "Attach a FILE to the current message (works with Mutt).
+ Argument DESCRIPTION MIME description."
+ (interactive "fAttach file: \nsDescription: ")
+ (when (> (length file) 0)
+ (save-excursion
+ (save-match-data
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (search-forward-regexp "^$")
+ (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " "
+ description "\n"))
+ (message (concat "Attached '" file "'."))
+ (setq post-has-attachment t))))))
+
+ (setq mail-yank-prefix "> ")
+ )
+#+END_SRC
+*** Muttrc mode
+#+BEGIN_SRC emacs-lisp
+ (use-package muttrc-mode
+ :mode "muttngrc"
+ :mode "muttrc"
+ )
+
+#+END_SRC
+* Base emacs
+** Reverting buffers
+#+BEGIN_SRC emacs-lisp
+ (setq global-auto-revert-non-file-buffers t
+ global-auto-revert-ignore-modes '(pdf-view-mode)
+ auto-revert-verbose nil)
+ (global-auto-revert-mode 1)
+#+END_SRC
* Org Mode
** Use-package and load things
#+BEGIN_SRC emacs-lisp
#+END_SRC
** Agenda Configuration
#+BEGIN_SRC emacs-lisp
- ;; The following lines are always needed. Choose your own keys.
- (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cb" 'org-iswitchb)
+ :mode "\\.\\(org\\|org_archive\\|txt\\)$"
+ :bind (("C-c l" . org-store-link)
+ ("C-c a" . org-agenda)
+ ("C-c b" . org-iswitchb)
+ :config
(setq-default org-log-done 'time)
(setq-default org-agenda-ndays 5)
"~/projects/org-notes/wildman.org"
"~/projects/org-notes/uddin.org"
"~/projects/org-notes/reviews.org"
- "~/projects/org-notes/hpcbio.org"
"~/org-mode/from-mobile.org"
"~/projects/org-notes/fh.org")))
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time-mode 1)
- (setq font-latex-fontify-script nil)
- (setq font-latex-fontify-sectioning (quote color))
- (setq font-latex-script-display (quote (nil)))
- (global-auto-revert-mode 1)
(global-font-lock-mode 1)
(icomplete-mode 1)
(setq log-edit-keep-buffer t)
;; tramp configuration
(setq tramp-use-ssh-controlmaster-options nil)
- ; mail configuration
- (add-to-list 'auto-mode-alist '("muttng-[a-z0-9]+-[0-9]+-" . message-mode))
- (add-to-list 'auto-mode-alist '("muttngrc" . muttrc-mode))
-
- (add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-" . message-mode))
- (add-to-list 'auto-mode-alist '("muttrc" . muttrc-mode))
- (defun my-message-mode-settings ()
- (font-lock-add-keywords nil
- '(("^[ \t]*>[ \t]*>[ \t]*>.*$"
- (0 'message-multiply-quoted-text-face))
- ("^[ \t]*>[ \t]*>.*$"
- (0 'message-double-quoted-text-face))))
- (local-set-key (kbd "C-c C-a") 'my-post-attach-file)
- )
- (add-hook 'message-mode-hook 'my-message-mode-settings)
-
- (defun my-post-attach-file ()
- "Prompt for an attachment."
- (interactive)
- (let ((file (read-file-name "Attach file: " nil nil t nil))
- (description (string-read "Description: ")))
- (my-header-attach-file file description)))
-
- (symbol-function 'my-post-attach-file)
-
- (defun my-header-attach-file (file description)
- "Attach a FILE to the current message (works with Mutt).
- Argument DESCRIPTION MIME description."
- (interactive "fAttach file: \nsDescription: ")
- (when (> (length file) 0)
- (save-excursion
- (save-match-data
- (save-restriction
- (widen)
- (goto-char (point-min))
- (search-forward-regexp "^$")
- (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " "
- description "\n"))
- (message (concat "Attached '" file "'."))
- (setq post-has-attachment t))))))
-
-
-
- (setq mail-yank-prefix "> ")
-
;; self-insert-command hack.
;; Without this, "if<SP>" expands to
;; if ( -!-) {