Last active
January 22, 2020 02:15
-
-
Save mplscorwin/c1327af0568b592f70ba5797f2875727 to your computer and use it in GitHub Desktop.
My very message init script for gnu emacs 26.3 on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; init --- Emacs startup script | |
;;; Commentary: | |
;;;; Corwin Brust <[email protected]> | |
;;;; huge thankx to Aaron Bedra for http://aaronbedra.com/emacs.d/ | |
;;; Code: | |
(setq user-full-name "Corwin Brust") | |
(setq user-mail-address "[email protected]") | |
;; https://github.com/wyuenho/dotfiles/blob/master/.emacs | |
;; Stop asking me if a theme is safe. The entirety of Emacs is built around | |
;; evaling arbitrary code... | |
(advice-add 'load-theme :around (lambda (old-load-theme &rest args) | |
"Don't ask for confirmation when loading a theme." | |
(apply old-load-theme (car args) t (cddr args)))) | |
(require 'cl);noflycheck | |
;; PDF tools - https://github.com/mrvdb/emacs-config | |
(use-package pdf-tools :ensure t | |
:after (pdf-annot fullframe) | |
:magic ("%PDF" . pdf-view-mode) | |
:bind (:map pdf-view-mode-map | |
("h" . 'pdf-annot-add-highlight-markup-annotation) | |
("t" . 'pdf-annot-add-text-annotation) | |
("D" . 'pdf-annot-delete) | |
("C-s" . 'isearch-forward) | |
("m" . 'mrb/mailfile) | |
:map pdf-annot-edit-contents-minor-mode-map | |
("<return>" . 'pdf-annot-edit-contents-commit) | |
("<S-return>" . 'newline)) | |
:config | |
;; Some settings from http://pragmaticemacs.com/emacs/even-more-pdf-tools-tweaks/ | |
(fullframe pdf-view-mode quit-window) | |
(setq-default pdf-view-display-size 'fit-page) ;scale to fit page by default | |
(setq pdf-annot-activate-created-annotations t) ; automatically annotate highlights | |
(setq pdf-view-resize-factor 1.1) ; more fine-grained zooming | |
(add-hook 'pdf-view-mode-hook (lambda () (cua-mode 0))) ; turn off cua so copy works | |
(pdf-tools-install :no-query)) ; no-query auto builds epfinfo when needed | |
;; https://emacs.stackexchange.com/questions/32150/how-to-add-a-timestamp-to-each-entry-in-emacs-messages-buffer | |
;; (defun sh/current-time-microseconds () | |
;; "Return the current time formatted to include microseconds." | |
;; (let* ((nowtime (current-time)) | |
;; (now-ms (nth 2 nowtime))) | |
;; (concat (format-time-string "[%Y-%m-%dT%T" nowtime) (format ".%d]" now-ms)))) | |
;; (defun sh/ad-timestamp-message (FORMAT-STRING &rest args) | |
;; "Prepend a timestamp to each message. | |
;; FORMAT-STRING and ARGS are the original inputs to `message'. | |
;; Activate as advice before `message' with: | |
;; \(advice-add 'message :before 'sh/ad-timestamp-message)" | |
;; (unless (string-equal FORMAT-STRING "%s%s") | |
;; (let ((deactivate-mark nil) | |
;; (inhibit-read-only t)) | |
;; (with-current-buffer "*Messages*" | |
;; (goto-char (point-max)) | |
;; (if (not (bolp)) | |
;; (newline)) | |
;; (insert (sh/current-time-microseconds) " "))))) | |
;; (advice-add 'message :before 'sh/ad-timestamp-message) | |
;; and the antidote | |
;;(advice-remove 'message 'sh/ad-timestamp-message) | |
;; straight.el bootstrap - https://github.com/raxod502/straight.el#user-manual | |
;; (defvar bootstrap-version) | |
;; (let ((bootstrap-file | |
;; (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) | |
;; (bootstrap-version 5)) | |
;; (unless (file-exists-p bootstrap-file) | |
;; (with-current-buffer | |
;; (url-retrieve-synchronously | |
;; "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" | |
;; 'silent 'inhibit-cookies) | |
;; (goto-char (point-max)) | |
;; (eval-print-last-sexp))) | |
;; (load bootstrap-file nil 'nomessage)) | |
;; ;; hack in a way to disable flycheck error decoration | |
;; ;; https://emacs.stackexchange.com/questions/47878/how-can-i-disable-a-specific-lint-error-for-emacs-lisp-using-flycheck | |
;; (defcustom flycheck-elisp-noflycheck-marker ";noflycheck" | |
;; "Flycheck line regions marked with this marker string are ignored." | |
;; :type 'string | |
;; :group 'flycheck) | |
;; (defun flycheck-elisp-noflycheck (err) | |
;; "Ignore flycheck if line of ERR ends with `flycheck-elisp-noflycheck-marker'." | |
;; (save-excursion | |
;; (goto-char (cdr (flycheck-error-line-region err))) | |
;; (looking-back flycheck-elisp-noflycheck-marker | |
;; (max (- (point) (length flycheck-elisp-noflycheck-marker)) | |
;; (point-min))))) | |
;; (defun elisp-noflycheck-hook () | |
;; "Add the ;;;###noflycheck thing to elisp." | |
;; (require 'flycheck) | |
;; (add-hook 'flycheck-process-error-functions #'flycheck-elisp-noflycheck nil t)) | |
;; (add-hook 'emacs-lisp-mode-hook #'elisp-noflycheck-hook) | |
(defun insert-shrug () | |
"Insert a shrug." | |
(interactive) | |
(insert "¯\\_(ツ)_/¯")) | |
(global-set-key (kbd "C-x p") 'insert-shrug) | |
;; (insert-shrug) | |
;; ¯_(ツ)_/¯ | |
;;(load-file "c:/emacs/sitelisp/discord-emacs.el") | |
;;(discord-emacs-run "264869684430503956") | |
;;(discord-emacs :fetcher github :repo "nitros12/discord-emacs.el") | |
;; rely on flycheck, typescript confuses js2/rjsx ~corwin | |
;(setq js2-strict-missing-semi-warning nil) | |
;(setq js2-missing-semi-one-line-override t) | |
;(setq js2-strict-missing-semi-warning nil) | |
;(setq js2-mode-show-strict-warnings nil) | |
;(setq js2-mode-show-parse-errors nil) | |
;; (setenv "PATH" | |
;; (concat "/usr/local/bin:/opt/local/bin:/usr/bin:/bin" | |
;; (getenv "PATH"))) | |
;; (setq exec-path (append exec-path '("/usr/local/bin"))) | |
;; (require 'cl) | |
;; w64 home dir fix | |
;; WARNING: this happens too late for .emacs file so we need a stub | |
;; config to load this file, maybe: | |
;; (load-file (substitute-in-file-name "$UserProfile/AppData/Roaming/.emacs") | |
;; remove if you plan to use AppData/Roaming/ as your emacs ~/ | |
(when (eq system-type 'windows-nt) | |
(unless (getenv "Home") | |
(setenv "Home" (getenv "UserProfile")))) | |
(defconst user-init-dir | |
(cond ((boundp 'user-emacs-directory) | |
user-emacs-directory) | |
((boundp 'user-init-directory) | |
user-init-directory) | |
(t "~/.emacs.d/"))) | |
;; where the code is | |
;; copies of use-package and bind *.elc for w64 | |
(add-to-list 'load-path "~/site_lisp") | |
(add-to-list 'load-path "c:/emacs/sitelisp") | |
(add-to-list 'load-path "~/site_lisp/emacs-status") | |
;;(add-to-list 'load-path "c:/emacs/sitelisp/all-the-icons.el") | |
;; package management | |
(require 'package) | |
(add-to-list 'package-archives '("MELPA" . "https://melpa.org/packages/") t) | |
(package-initialize) | |
;; where the code should be | |
(require 'use-package) | |
(use-package helpful :ensure t) | |
;;;;;;;;;; trying out helpful | |
(require 'helpful) | |
;; config and commentay from https://github.com/Wilfred/helpful | |
;;; Note that the built-in `describe-function' includes both functions | |
;; and macros. `helpful-function' is functions only, so we provide | |
;; `helpful-callable' as a drop-in replacement. | |
(global-set-key (kbd "C-h f") #'helpful-callable) | |
(global-set-key (kbd "C-h v") #'helpful-variable) | |
(global-set-key (kbd "C-h k") #'helpful-key) | |
;;;; I also recommend the following keybindings to get the most out of helpful: | |
;; Lookup the current symbol at point. C-c C-d is a common keybinding | |
;; for this in lisp modes. | |
(global-set-key (kbd "C-c C-d") #'helpful-at-point) | |
;;;; Look up *F*unctions (excludes macros). | |
;; | |
;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful | |
;; already links to the manual, if a function is referenced there. | |
(global-set-key (kbd "C-h F") #'helpful-function) | |
;;;; Look up *C*ommands. | |
;; | |
;; By default, C-h C is bound to describe `describe-coding-system'. I | |
;; don't find this very useful, but it's frequently useful to only | |
;; look at interactive functions. | |
(global-set-key (kbd "C-h C") #'helpful-command) | |
;;;; Ivy users can use Helpful with counsel commands: | |
;; (setq counsel-describe-function-function #'helpful-callable) | |
;; (setq counsel-describe-variable-function #'helpful-variable) | |
;; | |
;;;;;;;;;;; helpful | |
;; (use-package webpaste :ensure t) | |
;; nope. | |
;; (autoload 'emacs-lisp-hide-comments "emacs-lisp-hide-comments" "Improve hide-matching-regions") | |
;; (autoload 'hide-lines "hide-lines" "Hide lines based on a regexp" t) | |
;; (defun hide-docstrings () | |
;; (interactive) | |
;; (hide-matching-regions "^[ ]*\"[\0-\377[:nonascii:]]*?\"")) | |
;; (global-set-key (kbd "C-c C-h") 'hide-docstrings) | |
;; (global-set-key (kbd "C-c C-u h") 'show-all-invisible) | |
;; folding | |
;;;{{{ setup folding | |
;(autoload 'folding-mode "folding" "Folding mode" t) | |
;(autoload 'turn-off-folding-mode "folding" "Folding mode" t) | |
;(autoload 'turn-on-folding-mode "folding" "Folding mode" t) | |
;;;}}} | |
;; ;; https://stackoverflow.com/questions/2079095/how-to-modularize-an-emacs-configuration | |
;; (defconst user-init-dir | |
;; (cond ((boundp 'user-emacs-directory) | |
;; user-emacs-directory) | |
;; ((boundp 'user-init-directory) | |
;; user-init-directory) | |
;; (t "~/.emacs.d/"))) | |
;; (defun load-user-file (file) | |
;; (interactive "f") | |
;; "Load a file in current user's configuration directory" | |
;; (load-file (expand-file-name file user-init-dir))) | |
;; ;; Then the rest of the file goes and loads lots of individual files with forms like this: | |
;; (load-user-file "personal.el") | |
;; fixing missing white pack | |
;; white | |
(defface all-the-icons-white | |
'((((background dark)) :foreground "#AA759F") | |
(((background light)) :foreground "#68295B")) | |
"Face for white icons" | |
:group 'all-the-icons-faces) | |
(defface all-the-icons-white-alt | |
'((((background dark)) :foreground "#5D54E1") | |
(((background light)) :foreground "#5D54E1")) | |
"Face for white icons" | |
:group 'all-the-icons-faces) | |
(defface all-the-icons-lwhite | |
'((((background dark)) :foreground "#E69DD6") | |
(((background light)) :foreground "#E69DD6")) | |
"Face for lwhite icons" | |
:group 'all-the-icons-faces) | |
(defface all-the-icons-dwhite | |
'((((background dark)) :foreground "#694863") | |
(((background light)) :foreground "#694863")) | |
"Face for dwhite icons" | |
:group 'all-the-icons-faces) | |
;(setenv "PATH" (concat "D:/emax64/bin" ";" (getenv "PATH"))) | |
;(setenv "PATH" (concat "C:\\MinGW\\bin" ";" (getenv "PATH"))) | |
;; (when nil | |
;; (use-package quelpa | |
;; :ensure t | |
;; :config | |
;; (quelpa | |
;; '(quelpa-use-package | |
;; :fetcher git | |
;; :url "https://framagit.org/steckerhalter/quelpa-use-package.git")) | |
;; (require 'quelpa-use-package)) | |
;; (use-package bookmark+ | |
;; :quelpa ((bookmark+ :fetcher github :repo "emacsmirror/bookmark-plus"))) | |
;; (quelpa-self-upgrade) | |
;; (quelpa '(bookmark+ :fetcher github :repo "emacsmirror/bookmark-plus")) | |
;; ) | |
;; (use-package goto-chg :quelpa | |
;; (goto-chg :stable nil :fetcher github :repo "benaiah/goto-chg")) | |
;;:quelpa (abc-mode :fetcher github :repo "mkjunker/abc-mode") | |
;;(require 'quelpa-use-package) | |
;; TODO: use quelpa to fetch => | |
;; https://raw.githubusercontent.com/bamanzi/mobaxterm-emacs-plugin/master/emacs-ext-24.5/usr/share/emacs/24.5/lisp/erc/erc-pcomplete.el | |
;; using devel js2-mode for TS generics, etc | |
;; https://github.com/HairyRabbit/js2-mode/issues/6 | |
;; https://github.com/HairyRabbit/js2-mode | |
(load-library "~/site_lisp/js2-mode.elc") | |
(load-library "~/site_lisp/js2-imenu-extras.elc") | |
;; working around a bug with some version of emacs | |
(setq-default package-check-signature nil) | |
;; deal with PGP sig expiration | |
;; windows/dos GNUPBP setup | |
;; (if (memq system-type '(windows-nt ms-dos)) | |
;; (custom-set-variables | |
;; '(epg-gpg-home-directory "C:/GnuPG") | |
;; '(epg-gpg-program (concat epg-gpg-home-directory "/bin/gpg.exe")) | |
;; '(epg-gpgconf-program (concat epg-gpg-home-directory "/bin/gpgconf.exe")))) | |
;; (let ((my/old package-check-signature)) | |
;; (use-package gnu-elpa-keyring-update | |
;; :ensure t | |
;; :init (setq package-check-signature nil) | |
;; :config (setq package-check-signature my/old))) | |
(defvar my/packages '(ac-slime | |
auto-complete | |
autopair | |
elpy | |
f | |
feature-mode | |
flycheck | |
graphviz-dot-mode | |
htmlize | |
magit | |
treemacs-magit | |
markdown-mode | |
;;neotree | |
treemacs | |
;org | |
rjsx-mode | |
company | |
tide | |
smex | |
;;web-mode | |
writegood-mode | |
ob-typescript | |
yaml-mode) | |
"Default packages") | |
(defun my/packages-installed-p () | |
(loop for pkg in my/packages | |
when (not (package-installed-p pkg)) do (return nil) | |
finally (return t))) | |
;; (unless (my/packages-installed-p) | |
;; (message "%s" "Refreshing package database...") | |
;; (package-refresh-contents) | |
;; (dolist (pkg my/packages) | |
;; (when (not (package-installed-p pkg)) | |
;; (package-install pkg)))) | |
(setq inhibit-splash-screen t | |
initial-scratch-message nil | |
initial-major-mode 'org-mode) | |
;; breadcrub style frame title | |
;; https://stackoverflow.com/questions/8834708/graphical-breadcrumb-for-emacs | |
(defun my-breadcrumb (path) | |
"Return PATH in a breadcrumb format." | |
(format "[%s@%s] %s" user-login-name system-name | |
(mapconcat 'identity | |
(split-string path | |
(char-to-string | |
nnheader-directory-separator-character) t) | |
" > "))) | |
(setq frame-title-format | |
'(buffer-file-name | |
(:eval (my-breadcrumb buffer-file-name)) | |
(dired-directory | |
(:eval (my-breadcrumb (concat "X" dired-directory)) | |
("%b"))))) | |
;; icon doesn't show :( | |
;; (setq frame-title-format | |
;; '(buffer-file-name | |
;; (:eval (my-breadcrumb (concat | |
;; (all-the-icons-icon-for-file buffer-file-name) | |
;; buffer-file-name))) | |
;; (dired-directory | |
;; (:eval (my-breadcrumb (concat "X" dired-directory)) | |
;; ("%b"))))) | |
;; somewhat less less functional | |
;;(setq frame-title-format '(buffer-file-name "Emacs : %b ( %f )" "Emacs: %b")) | |
;; (setq frame-title-format | |
;; (mapconcat `identity | |
;; (split-string buffer-file-name | |
;; (char-to-string | |
;; nnheader-directory-separator-character) t) | |
;; " > ")) | |
;; disable boilerplate UX gadgets | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(menu-bar-mode -1) | |
;; clipboard | |
(delete-selection-mode t) | |
(transient-mark-mode t) | |
(setq x-select-enable-clipboard t) | |
;; display line endings | |
(setq-default indicate-empty-lines t) | |
(when (not indicate-empty-lines) | |
(toggle-indicate-empty-lines)) | |
;; clobber tab related default | |
(setq tab-width 2 | |
indent-tabs-mode nil) | |
(use-package ws-butler | |
:ensure nil ;; ALERT: local sources! | |
:diminish | |
:init | |
(ws-butler-global-mode)) | |
;;; paredit | |
(use-package paredit | |
:ensure t | |
:diminish | |
:config | |
;; For things like *scratch* buffer | |
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) | |
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) | |
(add-hook 'eval-expression-mode-hook #'enable-paredit-mode) | |
(add-hook 'scheme-mode-hook #'enable-paredit-mode) | |
(add-hook 'lisp-mode-hook #'enable-paredit-mode)) | |
;;;; MAGIT (git, github, etc) | |
;; mostly from https://github.com/mrvdb/emacs-config | |
(use-package full-frame :ensure t) | |
(use-package magit | |
:after (fullframe) | |
:bind | |
("C-c m" . magit-status) | |
:init | |
(fullframe magit-status magit-mode-quit-window) | |
:config | |
(setq magit-last-seen-setup-instructions "1.4.0")) | |
(use-package forge | |
:after magit | |
:config | |
(setq forge-add-pullreq-refspec 'ask | |
forge-pull-notifications t | |
forge-topic-list-limit '(60 . 0))) | |
;;;;;;;;;; | |
;; auto-save stuff: https://github.com/mrvdb/emacs-config | |
(defconst mrb/idle-timer 17 | |
"Idle-timeout (seconds) for tiggering `org-save-all-buffers'.") | |
;; This function does the actual useful thing | |
(defun mrb/save-timer-callback() | |
"Function run when Emacs is idle for `mrb/idle-timer' seconds." | |
(org-save-all-org-buffers)) | |
;; Activate the timer | |
;; The # means: evaluate first ( I keep forgetting this stuff ) | |
(run-with-idle-timer mrb/idle-timer 'always #'mrb/save-timer-callback) | |
;; Minibuffer prompt is a prompt, don't enter it as text. | |
;;(setq minibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))) | |
;; Don't echo keystrokes in the minibuffer, prefix will be hinted on after 2 seconds or so. | |
;;(setq echo-keystrokes 0) | |
;; Save places in buffers between sessions | |
(use-package saveplace | |
:ensure nil ;builtin | |
:init | |
(setq-default save-place-mode t)) | |
;;;;;;;;;; END autosave stuff | |
;; yeah, but no | |
;;(setq make-backup-files nil) | |
;; https://stackoverflow.com/questions/3893727/setting-emacs-tramp-to-store-local-backups | |
;;(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp "/my/local/backup/path")) | |
;; shhh | |
(defalias 'yes-or-no-p 'y-or-n-p) | |
;; spell check with hunspell under windows | |
;; https://lists.gnu.org/archive/html/help-gnu-emacs/2014-04/msg00030.html | |
;; DONE: should be predicated w64; else use system defaults | |
(use-package ispell | |
:if (memq window-system '(w32 pc)) | |
:config | |
(add-to-list 'exec-path "D:/hunspell/bin/") | |
(setq-default ispell-list-command "list") | |
(setq flyspell-issue-welcome-flag nil) | |
(setq ispell-program-name | |
(locate-file "hunspell" exec-path exec-suffixes 'file-executable-p)) | |
(setq ispell-local-dictionary-alist | |
'((nil | |
"[[:alpha:]]" "[^[:alpha:]]" "[']" t | |
("-d" "en_US" "-p" "D:\\hunspell\\share\\hunspell\\personal.en") | |
nil iso-8859-1) | |
("american" | |
"[[:alpha:]]" "[^[:alpha:]]" "[']" t | |
("-d" "en_US" "-p" "D:\\hunspell\\share\\hunspell\\personal.en") | |
nil iso-8859-1)))) | |
;;(if (eq system-type 'darwin) | |
;; (setq-default ispell-program-name "/usr/local/bin/aspell") | |
;; (setq-default ispell-program-name "/usr/bin/aspell")) | |
;; for finding non-asci chars | |
;; https://www.emacswiki.org/emacs/FindingNonAsciiCharacters | |
(defun occur-non-ascii () | |
"Find any non-ascii characters in the current buffer." | |
(interactive) | |
(occur "[^[:ascii:]]")) | |
;; global keybindings | |
(global-set-key (kbd "RET") 'newline-and-indent) | |
(global-set-key (kbd "C-;") 'comment-or-uncomment-region) | |
;; covered by the use-package | |
;;(global-set-key (kbd "M-/") 'hippie-expand) | |
(global-set-key (kbd "C-+") 'text-scale-increase) | |
(global-set-key (kbd "C--") 'text-scale-decrease) | |
(global-set-key (kbd "C-c C-k") 'compile) | |
(global-set-key (kbd "C-x g") 'magit-status) | |
(global-set-key (kbd "M-Q") 'unfill-paragraph) | |
(global-set-key (kbd "M-C-#") 'cycle-display-line-numbers) | |
(global-set-key (kbd "C-c a") 'org-agenda) | |
;; unfuckify | |
(setq echo-keystrokes 0.1 | |
use-dialog-box nil | |
visible-bell t | |
delete-by-moving-to-trash t) | |
(show-paren-mode t) | |
(prefer-coding-system 'utf-8) | |
;;;;;;;;;; | |
;; line setup from https://github.com/mrvdb/emacs-config | |
(setq-default truncate-lines nil) | |
;; Similar to mail messages, use vertical bar for wrapped paragaphs | |
(setq visual-line-fringe-indicators '(vertical-bar nil)) | |
;; For all text modes use visual-line-mode | |
(add-hook 'text-mode-hook 'visual-line-mode) | |
;; From:https://www.emacswiki.org/emacs/UnfillParagraph | |
(defun unfill-paragraph (&optional region) | |
"Make single line of text from REGION or multi-line paragraph." | |
(interactive (progn (barf-if-buffer-read-only) '(t))) | |
(let ((fill-column (point-max)) | |
;; This would override `fill-column' if it's an integer. | |
(emacs-lisp-docstring-fill-column t)) | |
(fill-paragraph nil region))) | |
;; Similar to M-q for fill, define M-Q for unfill | |
(use-package display-line-numbers | |
:ensure nil ;;builtin | |
:config | |
(setq display-line-numbers-type 'relative) | |
(display-line-numbers-mode -1)) | |
;; I wrote this one ~corwin | |
(defun cycle-display-line-numbers () | |
"Cycle var `display-line-numbers' though nil, t and 'relative." | |
(interactive) | |
(setq display-line-numbers | |
(if (eq 'relative display-line-numbers) | |
nil | |
(if display-line-numbers | |
'relative | |
t)))) | |
;;;;;;;;;; | |
;; vender dur stuff | |
;; (defvar my/vendor-dir (expand-file-name "vendor" user-emacs-directory)) | |
;; (add-to-list 'load-path my/vendor-dir) | |
;; (dolist (project (directory-files my/vendor-dir t "\\w+")) | |
;; (when (file-directory-p project) | |
;; (add-to-list 'load-path project))) | |
;; org mode | |
(setq org-log-done t | |
org-hide-leading-stars t | |
org-hide-emphasis-markers t | |
org-todo-keywords '((sequence "TODO" "INPROGRESS" "DONE")) | |
org-todo-keyword-faces '(("INPROGRESS" . (:foreground "blue" :weight bold)))) | |
(add-hook 'org-mode-hook | |
(lambda () | |
(flyspell-mode))) | |
(add-hook 'org-mode-hook | |
(lambda () | |
(writegood-mode))) | |
(setq org-agenda-show-log t | |
org-agenda-todo-ignore-scheduled t | |
org-agenda-todo-ignore-deadlines t) | |
(setq org-agenda-files "~/org-agenda-files.el") | |
(require 'org) | |
(require 'org-agenda) | |
(use-package org-agenda-property :ensure t) | |
(setq org-agenda-property-list '("LOCATION" "Responsible")) | |
;; org category setup | |
(setq org-agenda-category-icon-alist | |
`(("Cleaning" ,(concat org-directory "/images/broom.png") nil nil :ascent center) | |
("Dungeon" ,(concat org-directory "/images/dm-1d6-32.png") nil nil :ascent center) | |
("Emacs" ,(concat org-directory "/images/emacs-sm.png") nil nil :ascent center))) | |
;;(require 'org-install) | |
(require 'org-habit) | |
(add-to-list 'org-modules "org-habit") | |
(setq org-habit-preceding-days 7 | |
org-habit-following-days 1 | |
org-habit-graph-column 80 | |
org-habit-show-habits-only-for-today t | |
org-habit-show-all-today t) | |
;; org babel | |
(require 'ob) | |
(org-babel-do-load-languages | |
'org-babel-load-languages | |
'((ditaa . t) | |
(plantuml . t) | |
;(ruby . t) | |
(shell . t) | |
(dot . t) | |
(js . t) | |
(perl . t) | |
(C . t) | |
(http . t) | |
(typescript . t))) | |
(add-to-list 'org-src-lang-modes (quote ("dot". graphviz-dot))) | |
(add-to-list 'org-src-lang-modes (quote ("plantuml" . fundamental))) | |
(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj")) | |
(defvar org-babel-default-header-args:clojure | |
'((:results . "silent") (:tangle . "yes"))) | |
(defun org-babel-execute:clojure (body params) | |
"Docstring using BODY and PARAMS." | |
(lisp-eval-string body) "Done!") | |
;(provide 'ob-clojure) | |
(setq org-src-fontify-natively t | |
org-confirm-babel-evaluate nil) | |
(add-hook 'org-babel-after-execute-hook | |
(lambda () | |
(condition-case nil | |
(org-display-inline-images) | |
(error nil))) | |
'append) | |
(add-hook 'org-mode-hook (lambda () (abbrev-mode 1))) | |
;;; ORG visual setup | |
(load-theme 'org-beautify) | |
(use-package org-bullets) | |
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) | |
;; plantuml - http://plantuml.com/ | |
(setq org-plantuml-jar-path "c:/emacs/bin/plantuml.jar") | |
;;;;;;;;;; setup org-expiry and org-capture: https://github.com/mrvdb/emacs-config | |
(use-package org-expiry | |
:ensure nil | |
;; :load-path (lambda () (concat custom-package-directory "org-expiry/")) | |
:init | |
(setq org-expiry-created-property-name "CREATED") | |
(setq org-expiry-inactive-timestamps t)) | |
(defun mrb/insert-created-timestamp() | |
"Insert a CREATED property using org-expiry.el for TODO entries" | |
(org-expiry-insert-created) | |
(org-back-to-heading) | |
(org-end-of-line) | |
) | |
(defadvice org-insert-todo-heading (after mrb/created-timestamp-advice activate) | |
"Insert a CREATED property using org-expiry.el for TODO entries" | |
(mrb/insert-created-timestamp)) | |
(ad-activate 'org-insert-todo-heading) | |
;;(ad-deactivate 'org-insert-todo-heading) | |
(use-package org-capture :ensure nil) | |
(defadvice org-capture (after mrb/created-timestamp-advice activate) | |
"Insert a CREATED property using org-expiry.el for TODO entries" | |
(when (member (org-get-todo-state) org-todo-keywords-1) | |
(mrb/insert-created-timestamp))) | |
(ad-activate 'org-capture) | |
;;(ad-deactivate 'org-capture) | |
(defun mrb/org-schedule-for-today() | |
"Schedule the current item for today." | |
(interactive) | |
(org-schedule nil (format-time-string "%Y-%m-%d"))) | |
(defun mrb/org-agenda-schedule-for-today() | |
"Schedule the current item in the agenda for today." | |
(interactive) | |
(org-agenda-schedule nil (format-time-string "%Y-%m-%d"))) | |
;;;;;;;;;; end org-expire setup | |
;;; projectile | |
(use-package projectile :ensure t | |
:config | |
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) | |
(projectile-mode +1)) | |
;;(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) | |
;; "smex is a necessity. It provides history and searching on top of M-x." | |
(setq smex-save-file (expand-file-name ".smex-items" user-emacs-directory)) | |
(smex-initialize) | |
(global-set-key (kbd "M-x") 'smex) | |
(global-set-key (kbd "M-X") 'smex-major-mode-commands) | |
;; ido filesystem nav | |
(ido-mode t) | |
(setq ido-enable-flex-matching t | |
ido-use-virtual-buffers t) | |
;; neotree | |
;; (use-package neotree | |
;; :ensure t | |
;; ;;:bind | |
;; ;; classic(default) ascii arrow icons nerd | |
;; :config | |
;; (setq neo-theme (if (display-graphic-p) 'icons 'nerd)) | |
;; (global-set-key [f8] 'neotree-toggle) | |
;; (setq inhibit-compacting-font-caches t)) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; window and frame setup and movement | |
;; undo/redo window arrangment commands with C-c <left-or-right> | |
(require 'winner-mode) | |
(winner-mode) | |
;; zip window to window with C-M-<arrow> | |
(require 'windmove) | |
(global-set-key (kbd "C-M-<up>") 'windmove-up) | |
(global-set-key (kbd "C-M-<down>") 'windmove-down) | |
(global-set-key (kbd "C-M-<left>") 'windmove-left) | |
(global-set-key (kbd "C-M-<right>") 'windmove-right) | |
;; change frame when zipping past edgeward window | |
;; ALERT local source: https://www.emacswiki.org/emacs/framemove.el | |
(require 'framemove) | |
(setq framemove-hook-into-windmove t) | |
;; end windown and frame setup and movement | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Treemacs | |
(use-package treemacs | |
:ensure t | |
:defer t | |
:init | |
(with-eval-after-load 'winum | |
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) | |
:bind | |
(:map global-map | |
([f8] . treemacs) | |
("M-0" . treemacs-select-window) | |
("C-x t 1" . treemacs-delete-other-windows) | |
("C-x t t" . treemacs) | |
("C-x t B" . treemacs-bookmark) | |
("C-x t C-t" . treemacs-find-file) | |
("C-x t M-t" . treemacs-find-tag)) | |
:config | |
;;(global-set-key [f8] 'treemacs) | |
(progn | |
(treemacs-follow-mode t) | |
(treemacs-filewatch-mode t) | |
(treemacs-fringe-indicator-mode t) | |
(pcase (cons (not (null (executable-find "git"))) | |
(not (null treemacs-python-executable))) | |
(`(t . t) | |
(treemacs-git-mode 'deferred)) | |
(`(t . _) | |
(treemacs-git-mode 'simple)))) | |
;; (setq treemacs-width 35 | |
;; treemacs-display-in-side-window t | |
;; treemacs-indentation-string (propertize " " 'face 'font-lock-comment-face) | |
;; treemacs-indentation 1) | |
;; ;;(add-hook 'treemacs-mode-hook #'hide-mode-line-mode) | |
;; (add-hook 'treemacs-mode-hook (lambda () | |
;; (linum-mode -1) | |
;; (fringe-mode 0) | |
;; (setq buffer-face-mode-face `(:background "#211C1C")) | |
;; (buffer-face-mode 1))) | |
;; ;; ;; Improve treemacs icons | |
;; (with-eval-after-load 'treemacs | |
;; (with-eval-after-load 'all-the-icons | |
;; (let ((all-the-icons-default-adjust 0) | |
;; (tab-width 1)) | |
;; ;; Root icon | |
;; (setq treemacs-icon-root-png | |
;; (concat (all-the-icons-octicon "repo" :height 0.8 :v-adjust -0.2) " ")) | |
;; ;; File icons | |
;; (setq qtreemacs-icon-open-png | |
;; (concat | |
;; (all-the-icons-octicon "chevron-down" :height 0.8 :v-adjust 0.1) | |
;; "\t" | |
;; (all-the-icons-octicon "file-directory" :v-adjust 0) | |
;; "\t") | |
;; treemacs-icon-closed-png | |
;; (concat | |
;; (all-the-icons-octicon "chevron-right" :height 0.8 | |
;; :v-adjust 0.1 :face 'font-lock-doc-face) | |
;; "\t" | |
;; (all-the-icons-octicon "file-directory" :v-adjust 0 :face 'font-lock-doc-face) | |
;; "\t")) | |
;; ;; File type icons | |
;; (setq treemacs-icons-hash (make-hash-table :size 200 :test #'equal) | |
;; treemacs-icon-fallback (concat | |
;; "\t\t" | |
;; (all-the-icons-faicon "file-o" :face 'all-the-icons-dsilver | |
;; :height 0.8 :v-adjust 0.0) | |
;; "\t") | |
;; treemacs-icon-text treemacs-icon-fallback) | |
;; (dolist (item all-the-icons-icon-alist) | |
;; (let* ((extension (car item)) | |
;; (func (cadr item)) | |
;; (args (append (list (caddr item)) '(:v-adjust -0.05) (cdddr item))) | |
;; (icon (apply func args)) | |
;; (key (s-replace-all '(("^" . "") ("\\" . "") ("$" . "") ("." . "")) extension)) | |
;; (value (concat "\t\t" icon "\t"))) | |
;; (unless (ht-get treemacs-icons-hash (s-replace-regexp "\\?" "" key)) | |
;; (ht-set! treemacs-icons-hash (s-replace-regexp "\\?" "" key) value)) | |
;; (unless (ht-get treemacs-icons-hash (s-replace-regexp ".\\?" "" key)) | |
;; (ht-set! treemacs-icons-hash (s-replace-regexp ".\\?" "" key) value))))))) | |
) | |
(use-package treemacs-projectile | |
:after treemacs projectile | |
:ensure t) | |
(use-package treemacs-icons-dired | |
:after treemacs dired | |
:ensure t | |
:config (treemacs-icons-dired-mode)) | |
(use-package treemacs-magit | |
:after treemacs magit | |
:ensure t) | |
;;(use-package all-the-icons) | |
;; https://github.com/wyuenho/dotfiles/blob/master/.emacs | |
;; Replace the major mode name with its icon | |
(use-package all-the-icons | |
:ensure t | |
:if (display-graphic-p) | |
:config | |
(add-hook 'after-change-major-mode-hook | |
(lambda () | |
(let* ((icon (all-the-icons-icon-for-mode major-mode)) | |
(face-prop (and (stringp icon) (get-text-property 0 'face icon)))) | |
(when (and (stringp icon) (not (string= major-mode icon)) face-prop) | |
(setq mode-name (propertize icon 'display '(:ascent center)))))))) | |
;; (require 'doom-themes) | |
;; (load-theme 'doom-one) | |
;; (doom-themes-treemacs-config) | |
(use-package doom-themes | |
;;:disabled t | |
:after treemacs all-the-icons | |
:ensure t | |
;; :init (load-theme 'doom-one t) | |
:config | |
;; Enable flashing mode-line on errors | |
(doom-themes-visual-bell-config) | |
;; Corrects (and improves) org-mode's native fontification. | |
(doom-themes-org-config) | |
;; Enable custom treemacs theme (all-the-icons must be installed!) | |
(doom-themes-treemacs-config)) | |
(setq column-number-mode t) | |
(require 'autopair) | |
;;(require 'auto-complete-config) | |
;;(ac-config-default) | |
(defun untabify-buffer () | |
"This re-indents, untabifies, and cleans up whitespace. It is stolen directly from the emacs-starter-kit." | |
(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." | |
(interactive) | |
(indent-buffer) | |
(untabify-buffer) | |
(delete-trailing-whitespace)) | |
(defun cleanup-region (beg end) | |
"Remove tmux artifacts between BEG amd END." | |
(interactive "r") | |
(dolist (re '("\\\\|\·*\n" "\W*|\·*")) | |
(replace-regexp re "" nil beg end))) | |
(global-set-key (kbd "C-x M-t") 'cleanup-region) | |
(global-set-key (kbd "C-c n") 'cleanup-buffer) | |
(setq-default show-trailing-whitespace t) | |
;; ;; configure gmail | |
;; (setq user-email-address "[email protected]" | |
;; gnus-select-method | |
;; '(nnimap "personal" | |
;; (nnimap-address "imap.gmail.com") | |
;; (nnimap-server-port 993) | |
;; (nnimap-stream ssl)) | |
;; smtpmail-smtp-server "smtp.gmail.com" | |
;; smtpmail-smtp-service 587 | |
;; message-send-mail-function 'smtpmail-send-it | |
;; ;;nntp-authinfo-file "~/.authinfo.gpg" | |
;; gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]" | |
;; gnus-agent nil | |
;; gnus-message-archive-group nil | |
;; gnus-fetch-old-headers 'some) | |
;; (add-hook 'gnus-summary-mode-hook 'my-gnus-summary-keys) | |
;; (defun my-gnus-summary-keys () | |
;; (local-set-key "y" 'gmail-archive) | |
;; (local-set-key "$" 'gmail-report-spam)) | |
;; (defun gmail-archive () | |
;; (interactive) | |
;; (gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/All Mail")) | |
;; (defun gmail-report-spam () | |
;; "Report SPAM via Gmail." | |
;; (interactive) | |
;; (gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/Spam")) | |
;; YAML | |
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode)) | |
;;(require 'powerline) | |
(use-package powerline :ensure t :config (powerline-default-theme)) | |
;; open a different theme if we are windowed | |
;(if window-system | |
; (load-theme 'solarized-light t) | |
; (load-theme 'wombat t)) | |
;(require 'ansi-color) | |
;(defun colorize-compilation-buffer () | |
; (toggle-read-only) | |
; (ansi-color-apply-on-region (point-min) (point-max)) | |
; (toggle-read-only)) | |
;(add-hook 'compilation-filter-hook 'colorize-compilation-buffer) | |
;; cperl mode | |
(defalias 'perl-mode 'cperl-mode) | |
(setq cperl-hairy t) | |
;; https://github.com/asummers/.emacs.d/blob/master/init.el | |
(use-package hippie-exp | |
:ensure t | |
:bind | |
("M-/" . hippie-expand) | |
:config | |
(setq hippie-expand-try-functions-list | |
'(try-expand-dabbrev | |
try-expand-dabbrev-all-buffers | |
try-expand-dabbrev-from-kill | |
try-complete-file-name-partially | |
try-complete-file-name | |
try-expand-all-abbrevs | |
try-expand-list | |
try-expand-line))) | |
;; https://gist.github.com/daniel-vu/25826682d9af2a201a150aa3c4a4321a | |
(use-package flycheck | |
:ensure t | |
:defer 2 | |
:delight | |
:init (global-flycheck-mode) | |
:custom | |
(flycheck-display-errors-delay .3) | |
:config | |
(add-hook 'typescript-mode-hook 'flycheck-mode)) | |
(use-package plsense | |
:ensure t | |
:config ;; direct fm https://github.com/aki2o/emacs-plsense | |
;;(setq plsense-popup-help-key "C-:") | |
;;(setq plsense-display-help-buffer-key "M-:") | |
;;(setq plsense-jump-to-definition-key "C->") | |
;; Make config suit for you. Eval the following sexp: | |
;; ;; (customize-group "plsense") | |
;; Recommemded configuration: | |
(plsense-config-default)) | |
(defun setup-tide-mode () | |
(interactive) | |
(tide-setup) | |
(flycheck-mode +1) | |
(setq flycheck-check-syntax-automatically '(save mode-enabled)) | |
(eldoc-mode +1) | |
(tide-hl-identifier-mode +1) | |
;; company is an optional dependency. You have to | |
;; install it separately via package-install | |
;; `M-x package-install [ret] company` | |
(company-mode +1)) | |
(use-package company | |
:ensure t | |
:config | |
(setq company-show-numbers t) | |
(setq company-tooltip-align-annotations t) | |
;; invert the navigation direction if the the completion popup-isearch-match | |
;; is displayed on top (happens near the bottom of windows) | |
(setq company-tooltip-flip-when-above t) | |
(global-company-mode) | |
;; perl backend | |
(add-to-list 'company-backends 'company-plsense) | |
(add-hook 'cperl-mode-hook 'company-mode) | |
) | |
(use-package diminish :ensure t) | |
(use-package company-quickhelp | |
:ensure t | |
:init | |
(company-quickhelp-mode 1) | |
(use-package pos-tip | |
:ensure t)) | |
(use-package company-box | |
:diminish | |
:hook (company-mode . company-box-mode)) | |
(use-package web-mode | |
:ensure t | |
:mode (("\\.html?\\'" . web-mode) | |
;("\\.tsx\\'" . web-mode) | |
;("\\.jsx\\'" . web-mode) | |
) | |
:config | |
(setq web-mode-markup-indent-offset 2 | |
web-mode-css-indent-offset 2 | |
web-mode-code-indent-offset 2 | |
web-mode-block-padding 2 | |
web-mode-comment-style 2 | |
web-mode-enable-css-colorization t | |
web-mode-enable-auto-pairing t | |
web-mode-enable-comment-keywords t | |
web-mode-enable-current-element-highlight t | |
) | |
(add-hook 'web-mode-hook | |
(lambda () | |
(when (string-equal "tsx" (file-name-extension buffer-file-name)) | |
(setup-tide-mode)))) | |
;; enable typescript-tslint checker | |
(flycheck-add-mode 'typescript-tslint 'web-mode)) | |
(use-package rjsx-mode | |
:ensure t | |
:mode ( | |
("\\.js\\'" . rjsx-mode) | |
("\\.jsx\\'" . rjsx-mode) | |
("\\.tsx\\'" . rjsx-mode))) | |
(use-package typescript-mode | |
:ensure t | |
:config | |
(setq typescript-indent-level 2) | |
(add-hook 'typescript-mode #'subword-mode)) | |
(use-package tide | |
:init | |
:ensure t | |
:after (typescript-mode company flycheck) | |
:hook ((typescript-mode . tide-setup) | |
(typescript-mode . tide-hl-identifier-mode) | |
;(before-save . tide-format-before-save) | |
)) | |
;;https://gist.github.com/CodyReichert/9dbc8bd2a104780b64891d8736682cea | |
;; use eslint with rjsx-mode for jsx files | |
(flycheck-add-mode 'javascript-eslint 'rjsx-mode) | |
;; Enable eslint checker for web-mode | |
(flycheck-add-mode 'javascript-eslint 'web-mode) | |
;; Enable flycheck globally | |
(add-hook 'after-init-hook #'global-flycheck-mode) | |
(add-hook 'rjsx-mode-hook | |
(lambda () | |
(when (string-equal "tsx" (file-name-extension buffer-file-name)) | |
(setup-tide-mode)))) | |
(defun font-is-mono-p (font-family) | |
;; with-selected-window | |
(let ((wind (selected-window)) | |
m-width l-width) | |
(with-current-buffer "*Monospace Fonts*" | |
(set-window-buffer (selected-window) (current-buffer)) | |
(text-scale-set 4) | |
(insert (propertize "l l l l l" 'face `((:family ,font-family)))) | |
(goto-char (line-end-position)) | |
(setq l-width (car (posn-x-y (posn-at-point)))) | |
(newline) | |
(forward-line) | |
(insert (propertize "m m m m m" 'face `((:family ,font-family) italic))) | |
(goto-char (line-end-position)) | |
(setq m-width (car (posn-x-y (posn-at-point)))) | |
(eq l-width m-width)))) | |
(defun compare-monospace-fonts () | |
"Display a list of all monospace font faces." | |
(interactive) | |
(pop-to-buffer "*Monospace Fonts*") | |
(erase-buffer) | |
(dolist (font-family (font-family-list)) | |
(when (font-is-mono-p font-family) | |
(let ((str font-family)) | |
(newline) | |
(insert | |
(propertize (concat "The quick brown fox jumps over the lazy dog 1 l; 0 O o (" | |
font-family ")\n") 'face `((:family ,font-family))) | |
(propertize (concat "The quick brown fox jumps over the lazy dog 1 l; 0 O o (" | |
font-family ")\n") 'face `((:family ,font-family) italic))))))) | |
;; https://github.com/rememberYou/.emacs.d/blob/master/config.org/ | |
(use-package rainbow-delimiters | |
:ensure t | |
:hook (prog-mode . rainbow-delimiters-mode)) | |
(defun my/smarter-move-beginning-of-line (arg) | |
"Move point back to indentation of beginning of line. | |
Move point to the first non-whitespace character on this line. | |
If point is already there, move to the beginning of the line. | |
Effectively toggle between the first non-whitespace character and | |
the beginning of the line. | |
If ARG is not nil or 1, move forward ARG - 1 lines first. If | |
point reaches the beginning or end of the buffer, stop there." | |
(interactive "^p") | |
(setq arg (or arg 1)) | |
;; Move lines first | |
(when (/= arg 1) | |
(let ((line-move-visual nil)) | |
(forward-line (1- arg)))) | |
(let ((orig-point (point))) | |
(back-to-indentation) | |
(when (= orig-point (point)) | |
(move-beginning-of-line 1)))) | |
(global-set-key (kbd "C-a") 'my/smarter-move-beginning-of-line) | |
(use-package which-key | |
:ensure t | |
:defer 0.5 | |
:delight | |
:config (which-key-mode)) | |
;; IRC | |
(autoload 'erc "erc" "" t) | |
;; TODO: use erc-network if non-nil | |
;;(make-variable-buffer-local 'erc-prompt) | |
;;(setq erc-prompt (lambda () (concat "[" (erc-compute-server ) "@" (buffer-name) "]"))) | |
(setq erc-prompt (lambda () (concat "[" (buffer-name) "]"))) | |
(setq erc-autojoin-channels-alist | |
'(("freenode.net" "#emacs" "#perl" "##typescript" "#apache" "#nethack" "#erc" "#dungeon-mode") | |
("irc.prison.net" "#perl" "#javascript") | |
("irc.perl.org" "#perl" "#perlhelp"))) | |
;;(setq erc-prompt (lambda () (concat "[" (buffer-name) "]"))) | |
(setq erc-hide-list '("JOIN" "MODE" "NICK" "PART" "QUIT" ;;"KICK" | |
"301" ; away notice | |
"305" ; return from awayness | |
"306" ; set awayness | |
"324" ; modes | |
"329" ; channel creation date | |
"332" ; topic notice | |
"333" ; who set the topic | |
"353" ; Names notice | |
)) | |
;; nicely commented IRC message types | |
;; https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-erc.el | |
(setq erc-track-exclude-types '("NICK" "JOIN" "LEAVE" "QUIT" "PART" | |
"301" ; away notice | |
"305" ; return from awayness | |
"306" ; set awayness | |
"324" ; modes | |
"329" ; channel creation date | |
"332" ; topic notice | |
"333" ; who set the topic | |
"353" ; Names notice | |
)) | |
;; timestamps - kstroem's from https://www.emacswiki.org/emacs/ErcStamp | |
(make-variable-buffer-local | |
(defvar erc-last-datestamp nil)) | |
(defun ks-timestamp (string) | |
(erc-insert-timestamp-left string) | |
(let ((datestamp (erc-format-timestamp (current-time) erc-datestamp-format))) | |
(unless (string= datestamp erc-last-datestamp) | |
(erc-insert-timestamp-left datestamp) | |
(setq erc-last-datestamp datestamp)))) | |
(setq erc-timestamp-only-if-changed-flag t | |
erc-timestamp-format "%H:%M " | |
erc-datestamp-format " === [%Y-%m-%d %a] ===\n" ; mandatory ascii art | |
erc-fill-prefix " " | |
erc-insert-timestamp-function 'ks-timestamp) | |
;; https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-erc.el | |
(defun cofi/erc-previous-url-button () | |
"Go to the previous URL button in this buffer." | |
(interactive) | |
(when (eq (get-text-property (point) 'erc-callback) 'browse-url) | |
(backward-word)) | |
(let ((url-pos (do ((point (point) (previous-single-property-change point 'erc-callback))) | |
((or (null point) (eq (get-text-property point 'erc-callback) 'browse-url)) point)))) | |
(when url-pos | |
(goto-char url-pos)))) | |
;; from emacswiki | |
(defmacro asf-erc-bouncer-connect (command server port nick ssl pass) | |
"Create interactive command `COMMAND'. | |
Connect to IRC `SERVER` on `PORT`as `NICK` with `SSL` or `PASS`. | |
The command uses interactive mode if passed an argument." | |
(fset command | |
`(lambda (arg) | |
(interactive "p") | |
(if (not (= 1 arg)) | |
(call-interactively 'erc) | |
(let ((erc-connect-function ',(if ssl | |
'erc-open-ssl-stream | |
'open-network-stream))) | |
(erc :server ,server :port ,port :nick ,nick :password ,pass)))))) | |
(asf-erc-bouncer-connect erc-fn "irc.freenode.net" 6667 "q[corwin]" nil "q[corwin]:r3@lsmr7") | |
(asf-erc-bouncer-connect erc-ef "irc.prison.net" 6667 "corwin" nil nil) | |
(asf-erc-bouncer-connect erc-pl "irc.perl.org" 6667 "corwin" nil nil) | |
(defun my-irc () | |
"Start to waste time on IRC with ERC." | |
(interactive) | |
(select-frame (make-frame '((name . "Emacs IRC") (minibuffer . t)))) | |
(call-interactively 'erc-pl) | |
(sit-for 5) | |
;;(call-interactively 'erc-ef) | |
;;(sit-for 1) | |
(call-interactively 'erc-fn)) | |
;;;;;;;;;; | |
;;; ALERT: authors devel work | |
;; (use-package erc-frames-mode | |
;; ;;:load-path | |
;; :config (setq erc-connection-alist | |
;; '((efnet . (:frame | |
;; :erc (:server "irc.servercentral.net" :nick "corwin") | |
;; :join "#cezb-1" | |
;; ;; )))) | |
;; :split :switch | |
;; :join "#cezb-2" | |
;; :split nil 'right;; 50% | |
;; :switch | |
;; :join "#cezb-3"))))) | |
;; (require 'erc-frames-mode) | |
;; (efm-start) | |
;; (progn | |
;; (efm-make-frame) | |
;; (erc :server "irc.servercentral.net" :nick "corwin") | |
;; (let | |
;; ((efm--once-on-erc-after-connect | |
;; (lambda | |
;; (&rest ignored) | |
;; (remove-hook 'erc-after-connect 'efm--once-on-erc-after-connect) | |
;; (erc-join-channel "#cezb-1")))) | |
;; (add-hook 'erc-after-connect efm--once-on-erc-after-connect))) | |
;;;;;;;;;; | |
;;; ALERT! local sources! | |
(require 'easymenu) | |
(easy-menu-add-item nil '("tools") ["IRC with ERC" efm-start t]) | |
;;(easy-menu-add-item nil '("tools") ["IRC with ERC" my-irc t]) | |
(require 'erc-match) | |
(setq erc-keywords '("brust" "taltos" "dragaera" "zelazny" "dungeon-mode" "erc-frames-mode" "efm-" "burnt-toast")) | |
(erc-match-mode t) | |
(use-package erc-image :ensure t :defer t) | |
;;(require `erc-burnt-toast) | |
;;(erc-notifications-mode) | |
(use-package erc-youtube | |
:config | |
(add-to-list 'erc-modules 'youtube) | |
(erc-update-modules) | |
(setq erc-youtube-apiv3-key | |
"AIzaSyBzMZGKPhcD9fMc_1mW_MixMdluxGsmXGo")) | |
;; lots of good stuff here! | |
;; https://github.com/jwiegley/dot-emacs/blob/master/init.el | |
(eval-after-load 'erc-identd | |
'(defun erc-identd-start (&optional port) | |
"Start an identd server listening to port 8113. | |
Port 113 (auth) will need to be redirected to port 8113 on your | |
machine -- using iptables, or a program like redir which can be | |
run from inetd. The idea is to provide a simple identd server | |
when you need one, without having to install one globally on | |
your system." | |
(interactive (list (read-string "Serve identd requests on port: " "8113"))) | |
(unless port (setq port erc-identd-port)) | |
(when (stringp port) | |
(setq port (string-to-number port))) | |
(when erc-identd-process | |
(delete-process erc-identd-process)) | |
(setq erc-identd-process | |
(make-network-process :name "identd" | |
:buffer nil | |
:host 'local :service port | |
:server t :noquery t | |
:filter 'erc-identd-filter)) | |
(set-process-query-on-exit-flag erc-identd-process nil))) | |
(require 'erc-identd) | |
(use-package emojify | |
:ensure t | |
:after erc | |
:defer 15 | |
:config | |
(global-emojify-mode) | |
(global-emojify-mode-line-mode -1)) | |
;; TODO: quelpa | |
;;(require 'erc-status) | |
;; (quelpa '(rainbow-mode :url "http://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/packages/rainbow-mode/rainbow-mode.el" :fetcher url)) | |
;; TODO: fixme | |
;; (use-package erc-spelling-mode | |
;; :ensure t | |
;; :quelpa ;; https://raw.githubusercontent.com/hober/erc/master/erc-spelling.el | |
;; (erc-spelling-mode :fetcher url | |
;; :url "https://raw.githubusercontent.com/hober/erc/master/erc-spelling.el")) | |
(require `erc-spelling) | |
(erc-spelling-mode t) | |
(require 'erc-pcomplete) | |
;; logging? | |
(setq erc-log-insert-log-on-open nil) | |
(setq erc-log-channels t) | |
(setq erc-log-channels-directory "~/.irclogs/") | |
(setq erc-save-buffer-on-part t) | |
(setq erc-hide-timestamps nil) | |
(defadvice save-buffers-kill-emacs (before save-logs (arg) activate) | |
"Save ERC buffers before killing Emacs. Use ARG for something." | |
(save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode) | |
(not (null buffer-file-name))))))) | |
(add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) | |
(add-hook 'erc-mode-hook '(lambda () (when (not (featurep 'xemacs)) | |
(set (make-variable-buffer-local | |
'coding-system-for-write) | |
'emacs-mule)))) | |
;; end logging | |
;; Truncate buffers so they don't hog core. | |
(setq erc-max-buffer-size 20000) ;noflycheck | |
(defvar erc-insert-post-hook) | |
(add-hook 'erc-insert-post-hook 'erc-truncate-buffer) | |
(setq erc-truncate-buffer-on-save t) ;noflycheck | |
(use-package rainbow-delimiters | |
:ensure t) | |
(setq erc-interpret-mirc-color t) | |
(use-package powershell | |
:ensure t) | |
;; firefox/chrome "Edit in Emacs" integration | |
(use-package edit-server | |
:ensure t | |
:config | |
(edit-server-start)) | |
;; (require 'doremi-frm) | |
;; ;; Suggested key bindings: | |
;; (defalias 'doremi-prefix (make-sparse-keymap)) | |
;; (defvar doremi-map (symbol-function 'doremi-prefix) | |
;; "Keymap for Do Re Mi commands.") | |
;; (define-key global-map "\M-gt" 'doremi-prefix) | |
;; (define-key doremi-map "a" 'doremi-all-faces-fg+) ; "All" | |
;; (define-key doremi-map "c" 'doremi-bg+) ; "Color" | |
;; (define-key doremi-map "f" 'doremi-face-fg+) ; Face" | |
;; (define-key doremi-map "h" 'doremi-frame-height+) | |
;; (define-key doremi-map "t" 'doremi-font+) ; "Typeface" | |
;; (define-key doremi-map "u" 'doremi-frame-configs+) ; "Undo" | |
;; (define-key doremi-map "x" 'doremi-frame-horizontally+) | |
;; (define-key doremi-map "y" 'doremi-frame-vertically+) | |
;; (define-key doremi-map "z" 'doremi-font-size+) ; "Zoom" | |
;; (setq cycle-themes-theme-list | |
;; '(leuven monokai solarized-dark)) | |
;; (require 'cycle-themes) | |
;; (cycle-themes-mode) | |
;; sticking with tide for now | |
;(add-to-list 'load-path "d:/projects/tern/tern/emacs") | |
;(autoload 'tern-mode "tern.el" nil t) | |
;; '(package-selected-packages | |
;; (quote | |
;; (edit-server edit-server-htmlize espuds ansi package-build shut-up epl commander f dash s cask cask-mode yasnippet yasnippet-snippets yatemplate helm-org helm-org-rifle helm-bind-key helm-company helm-flycheck helm-flyspell helm-projectile helm emojify emojify-logos webpaste quelpa quelpa-use-package rainbow-delimiters powershell erc-hl-nicks erc-image erc-scrolltoplace erc-social-graph erc-status-sidebar erc-track-score erc-tweet erc-twitch erc-view-log erc-youtube erc-yt ercn which-key yaml-mode writegood-mode winum web-mode use-package treemacs-projectile treemacs-magit treemacs-icons-dired tide tern term-projectile solarized-theme smex rjsx-mode rainbow-mode projectile-git-autofetch projectile-direnv org-projectile ob-typescript neotree lsp-typescript lsp-treemacs lsp-sh lsp-php lsp-javascript-typescript lsp-javascript-flow lsp-html lsp-css json-mode indium htmlize graphviz-dot-mode git ggtags feature-mode eshell-git-prompt elpy dumb-jump doom-themes doom-modeline doom cycle-themes cyberpunk-theme cyberpunk-2019-theme company-quickhelp color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized color-theme-approximate autopair atomic-chrome atom-one-dark-theme atom-dark-theme arjen-grey-theme arc-dark-theme apropospriate-theme anti-zenburn-theme ample-zen-theme ample-theme all-the-icons-dired alect-themes airline-themes ahungry-theme afternoon-theme ac-slime abyss-theme))) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(auto-insert-mode t) | |
'(column-number-mode t) | |
'(cperl-mode nil) | |
'(custom-enabled-themes (quote (cyberpunk))) | |
'(erc-spelling-mode nil) | |
'(flycheck-display-errors-delay 0.3) | |
'(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#51afef")) | |
'(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#98be65")) | |
'(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#3f444a")) | |
'(menu-bar-mode nil) | |
'(objed-cursor-color "#ff6c6b") | |
'(package-selected-packages | |
(quote | |
(yarn-mode org-caldav org-agenda-property idle-org-agenda dimish paredit gif-screencast gist git-auto-commit-mode fullframe forge org-beautify-theme org-bullets diminish diminish-buffer pdf-tools ascii-art-to-unicode plsense plsense-direx company-plsense company company-box company-emoji lsp-treemacs treemacs-icons-dired treemacs-projectile use-ttf tramp doom-themes treemacs darktooth-theme erc-colorize erc-status-sidebar erc-tweet erc-twitch erc-view-log erc-youtube erc-yt erc-hl-nicks webpaste emojify erc-image easymenu all-the-icons cyberpunk-theme yaml-mode ob-typescript writegood-mode smex tide rjsx-mode markdown-mode treemacs-magit magit htmlize graphviz-dot-mode flycheck feature-mode elpy autopair ac-slime helpful))) | |
'(pdf-view-midnight-colors (quote ("#FDF4C1" . "#282828"))) | |
'(pos-tip-background-color "#36473A") | |
'(pos-tip-foreground-color "#FFFFC8") | |
'(safe-local-variable-values (quote ((lexical-bindings . t)))) | |
'(show-paren-mode t) | |
'(tool-bar-mode nil) | |
'(vc-annotate-background "#282c34") | |
'(vc-annotate-color-map | |
(list | |
(cons 20 "#98be65") | |
(cons 40 "#b4be6c") | |
(cons 60 "#d0be73") | |
(cons 80 "#ECBE7B") | |
(cons 100 "#e6ab6a") | |
(cons 120 "#e09859") | |
(cons 140 "#da8548") | |
(cons 160 "#d38079") | |
(cons 180 "#cc7cab") | |
(cons 200 "#c678dd") | |
(cons 220 "#d974b7") | |
(cons 240 "#ec7091") | |
(cons 260 "#ff6c6b") | |
(cons 280 "#cf6162") | |
(cons 300 "#9f585a") | |
(cons 320 "#6f4e52") | |
(cons 340 "#5B6268") | |
(cons 360 "#5B6268"))) | |
'(vc-annotate-very-old-color nil) | |
'(windmove-wrap-around t)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(default ((t (:family "Hack" :foundry "outline" :slant normal :weight bold :height 98 :width normal))))) | |
;; -*- no linting -*- | |
;;; .emacs end here ;noflycheck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment