Created
November 25, 2019 18:54
-
-
Save christian-blades-cb/5aa97c547b6d28b0bdd3f87ab6b54ee1 to your computer and use it in GitHub Desktop.
This file contains 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
;; Added by Package.el. This must come before configurations of | |
;; installed packages. Don't delete this line. If you don't want it, | |
;; just comment it out by adding a semicolon to the start of the line. | |
;; You may delete these explanatory comments. | |
(package-initialize) | |
;; make sure use-package is installed | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/")) | |
(unless package-archive-contents | |
(package-refresh-contents)) | |
(unless (package-installed-p 'use-package) | |
(package-install 'use-package)) | |
;; my settings broken out into their own packages | |
(add-to-list 'load-path (expand-file-name (concat user-emacs-directory "extras"))) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; SET ME IF YOU'RE USING ENTERPRISE GITHUB ;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; (setq cb/enterprise-github "github.enterprise.tld") | |
;; utility! | |
(defun cb/read-lines (filePath) | |
"Return a list of lines from the file at filePath" | |
(with-temp-buffer | |
(insert-file-contents filePath) | |
(split-string (buffer-string) "\n" t))) | |
(defun cb/read-lines-or-nil (filePath) | |
"Return list of lines from the file at filePath, or nil if it's unreadable" | |
(when (file-readable-p filePath) | |
(cb/read-lines filePath))) | |
(defun file-if-exists (filename) "return file if it exists, else nil" nil | |
(if (file-exists-p filename) | |
filename | |
nil)) | |
(global-set-key (kbd "<select>") 'move-end-of-line) ;; weirdness with keyboard over ssh | |
;; useful if you're on a mac keyboard, useless otherwise | |
;; TODO figure out how to detect this situation to make this conditional | |
(setq x-alt-keysym 'meta) | |
(setq x-meta-keysym 'super) | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(menu-bar-mode -1) | |
(setq inhibit-startup-screen t) | |
(display-time-mode t) | |
(setq display-time-mail-string "") | |
(setq ring-bell-function 'ignore) | |
(use-package delight :ensure t) | |
(use-package helm | |
:ensure t | |
:delight | |
:config | |
(require 'helm-config) | |
(helm-mode 1) | |
(global-set-key (kbd "M-x") 'helm-M-x) | |
(global-set-key (kbd "C-x C-f") 'helm-find-files) | |
(global-set-key (kbd "C-x b") 'helm-buffers-list) | |
(global-set-key (kbd "M-w") 'copy-region-as-kill) | |
(global-set-key (kbd "C-s") 'helm-occur) | |
(setq helm-mode-fuzzy-match t) | |
(setq helm-gtags-path-style (quote relative)) | |
(setq helm-gtags-auto-update t) | |
(setq helm-gtags-ignore-case t) | |
) | |
(use-package helm-ag :ensure t :after helm) | |
(use-package projectile | |
:ensure t | |
:delight '(:eval (concat " p[" (projectile-project-name) "]")) | |
:config | |
(projectile-global-mode) | |
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) | |
) | |
(use-package projectile-ripgrep | |
:ensure t | |
:after (projectile)) | |
(use-package helm-projectile | |
:ensure t | |
:after (helm projectile) | |
:config | |
(helm-projectile-on) | |
(global-set-key (kbd "C-c p p") 'helm-projectile) | |
) | |
(use-package python-mode | |
:bind (:map python-mode-map | |
("C-c >" . python-indent-shift-right) | |
("C-c <" . python-indent-shift-left)) | |
:config | |
(add-hook 'python-mode-hook '(lambda () (setq fill-column 110))) | |
) | |
(use-package company-lsp | |
:ensure t | |
:after (company lsp-mode) | |
:config | |
(add-to-list 'company-backends 'company-lsp) | |
) | |
;; pip install 'python-language-server[all]' | |
(when (executable-find "pyls") | |
(add-hook 'python-mode-hook #'company-mode) | |
(add-hook 'python-mode-hook #'lsp)) | |
(use-package flycheck | |
:ensure t | |
:after helm | |
:bind (:map flycheck-mode-map | |
("C-c ! h" . helm-flycheck)) | |
:config | |
(setq flycheck-flake8-error-level-alist | |
(quote (("^E9.*$" . error) | |
("^F82.*$" . error) | |
("^F83.*$" . error) | |
("^D.*$" . info) | |
("^N.*$" . info) | |
("^E501$" . info)))) | |
(setq flycheck-flake8rc ".flake8") | |
(setq flycheck-flake8-maximum-complexity 10) | |
(setq flycheck-flake8-maximum-line-length 120) | |
(add-hook 'python-mode-hook 'flycheck-mode) | |
(add-to-list 'flycheck-disabled-checkers 'python-flake8) | |
(add-to-list 'flycheck-disabled-checkers 'python-pylint) | |
;; (define-key flycheck-mode-map (kbd "C-c ! h") 'helm-flycheck) | |
) | |
(use-package flycheck-mypy | |
:after flycheck | |
:ensure t | |
:config | |
(setq flycheck-python-mypy-args "--py2")) | |
;; autocomplete | |
(use-package auto-complete | |
:ensure t | |
:bind (:map ac-completing-map | |
("C-:" . ac-complete-with-helm) | |
:map ac-complete-mode-map | |
("C-:" . ac-complete-with-helm) | |
:map ac-mode-map | |
("C-:" . ac-complete-with-helm)) | |
:config | |
(require 'auto-complete-config) | |
) | |
(use-package ac-helm | |
:ensure t | |
:after (helm auto-complete) | |
:config | |
(global-set-key (kbd "C-:") 'ac-complete-with-helm) | |
(define-key ac-completing-map (kbd "C-:") 'ac-complete-with-helm)) | |
(global-set-key (kbd "<f10>") 'org-agenda) | |
(global-set-key (kbd "<XF86Eject>") 'org-agenda) | |
(global-set-key (kbd "C-c r") 'revert-buffer) | |
(dolist (key '("\C-z" "\C-x\C-z")) (global-unset-key key)) ;; I don't want/need a shortcut for suspend-frame | |
;; Disable pesky auto-fill-mode | |
(auto-fill-mode -1) | |
(turn-off-auto-fill) | |
(remove-hook 'text-mode-hook #'turn-on-auto-fill) | |
;; Replace selection when you start typing | |
(delete-selection-mode t) | |
;; Write backup files to their own directory | |
(setq backup-directory-alist | |
`(("." . ,(expand-file-name | |
(concat user-emacs-directory "backups"))))) | |
(use-package moe-theme | |
:ensure t | |
:config | |
(moe-dark)) | |
;; (use-package material-theme :ensure t) | |
;; (defvar *blades-theme-dark* 'material) | |
;; (defvar *blades-theme-light* 'moe-light) | |
;; ;; (defvar *blades-theme-light* 'material-light) | |
;; (defvar *blades-theme-current* *blades-theme-light*) | |
;; (defun blades/next-theme (theme) | |
;; (if (eq theme 'default) | |
;; (disable-theme *blades-theme-current) | |
;; (progn (load-theme theme t)) | |
;; ) | |
;; (setq *blades-theme-current* theme)) | |
;; (defun blades/toggle-theme () | |
;; (interactive) | |
;; (cond ((eq *blades-theme-current* *blades-theme-dark*) (blades/next-theme *blades-theme-light*)) | |
;; ((eq *blades-theme-current* *blades-theme-light*) (blades/next-theme *blades-theme-dark*)) | |
;; ((eq *blades-theme-current* 'default) (blades/next-theme *blades-theme-dark*)))) | |
;; Git-Gutter | |
(use-package git-gutter | |
:ensure t | |
:delight | |
:config | |
(global-git-gutter-mode t)) | |
;; display remaining battery life | |
(display-battery-mode 1) | |
;; lisps | |
(use-package rainbow-delimiters | |
:ensure t | |
:hook | |
(((lisp-mode emacs-lisp-mode clojure-mode common-lisp-mode go-mode rust-mode) . rainbow-delimiters-mode)) | |
) | |
(use-package paredit | |
:ensure t | |
:delight | |
:hook | |
(((lisp-mode emacs-lisp-mode clojure-mode common-lisp-mode scheme-mode) . paredit-mode)) | |
) | |
(use-package company | |
:ensure t | |
:delight " co" | |
:hook | |
(((emacs-lisp-mode rust-mode) . company-mode)) | |
:config | |
(add-to-list 'company-backends 'company-elisp) | |
) | |
;;php | |
(use-package php-mode | |
:ensure t | |
:config | |
(add-hook 'php-mode-hook #'company-mode) | |
(add-hook 'php-mode-hook #'lsp) | |
) | |
;; (use-package flycheck-phpstan | |
;; :ensure t | |
;; :after flycheck | |
;; (add-hook 'php-mode-hook 'flycheck-mode)) | |
;; (use-package flymake-php | |
;; :ensure t) | |
;; scheme (for SICP) | |
(use-package geiser :ensure t) | |
;;golang | |
(use-package go-mode | |
:ensure t | |
:init | |
(setenv "PATH" "$GOPATH/bin:$PATH" t) | |
;; eshell nicety | |
(let ((cdpath (string-join (-non-nil (list | |
"." | |
(when (boundp 'cb/enterprise-github) (format "$GOPATH/src/%s" cb/enterprise-github)) | |
"$GOPATH/src/github.com" | |
"$GOPATH/src/" | |
)) | |
":"))) | |
(setenv "CDPATH" cdpath t)) | |
(add-hook 'go-mode-hook '(lambda () (local-set-key (kbd "RET") 'newline-and-indent))) | |
(add-hook 'go-mode-hook '(lambda () (setq tab-width 4))) | |
(add-hook 'before-save-hook #'gofmt-before-save) | |
:config | |
(setq gofmt-command "goimports") ;; use goimports for more better gofmting | |
(when (boundp 'cb/enterprise-github) | |
(setq gofmt-args (list "-local" cb/enterprise-github))) | |
;; one time shoving an entire buffer into go playground is plenty | |
(put 'go-play-buffer 'disabled t) | |
(put 'go-play-region 'disabled t) | |
) | |
(use-package yasnippet :ensure t) | |
(use-package go-impl :ensure t :after (go-mode)) | |
(use-package go-rename :ensure t :after (go-mode)) | |
(use-package go-guru | |
:ensure t | |
:after (go-mode) | |
:hook ((go-mode . go-guru-hl-identifier-mode)) | |
:config | |
(setq go-guru-build-tags '("servicetest"))) | |
;; (unless (executable-find "gocode") "Gocode not found, autocomplete not available in go-mode. Please run go get -u github.com/nsf/gocode") | |
;; ;; both this and the autocomplete one require gocode (go get -u github.com/nsf/gocode) | |
;; (use-package company-go | |
;; :ensure t | |
;; :if (executable-find "gocode") | |
;; :after (company go-mode) | |
;; :hook ((go-mode . company-mode)) | |
;; :config | |
;; (add-to-list 'company-backends 'company-go) | |
;; ) | |
(use-package go-scratch :ensure t :after go-mode) | |
(use-package flycheck-gometalinter | |
:ensure t | |
:after (go-mode flycheck) | |
:hook | |
((flycheck-mode . flycheck-gometalinter-setup) | |
(go-mode . flycheck-mode)) | |
:config | |
(setq flycheck-gometalinter-vendor t) | |
(setq flycheck-gometalinter-fast t) | |
(setq flycheck-gometalinter-tests t) | |
) | |
(use-package helm-go-package | |
:ensure t | |
:after (helm go-mode) | |
:config | |
(eval-after-load 'go-mode | |
'(substitute-key-definition 'go-import-add 'helm-go-package go-mode-map))) | |
(use-package go-eldoc | |
:after go-mode | |
:ensure t | |
:hook ((go-mode . go-eldoc-setup)) | |
) | |
(use-package diminish :ensure t) | |
(diminish 'eldoc-mode) | |
(diminish 'auto-revert-mode) | |
(use-package helm-company | |
:ensure t | |
:after (company helm) | |
:bind (:map company-mode-map | |
("C-:" . helm-company) | |
:map company-active-map | |
("C-:" . helm-company) | |
)) | |
(use-package rust-mode | |
:ensure t | |
:config | |
(add-hook 'rust-mode-hook #'rust-enable-format-on-save) | |
(setq rust-format-on-save t)) | |
(use-package rust-playground | |
:ensure t | |
:after (rust-mode)) | |
(use-package flycheck-rust | |
:ensure t | |
:after (rust-mode flycheck) | |
:config | |
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup) | |
(add-hook 'rust-mode-hook #'flycheck-mode)) | |
(use-package use-package-ensure-system-package :ensure t) | |
(use-package cargo | |
:ensure t | |
:after (rust-mode)) | |
;; rustup component add rls | |
;; GO111MODULE=on go get golang.org/x/tools/gopls@latest | |
(use-package lsp-mode | |
:ensure t | |
:hook ((rust-mode . lsp) | |
(go-mode . lsp) | |
(python-mode . lsp) | |
(js-mode . lsp)) | |
:config | |
(when (boundp 'cb/enterprise-github) | |
(setq lsp-clients-go-imports-local-prefix cb/enterprise-github) | |
) | |
) | |
(use-package lsp-ui | |
:ensure t | |
:after (lsp-mode) | |
:hook ((lsp-mode . lsp-ui-mode) | |
(lsp-mode . flycheck-mode)) | |
:config | |
(setq lsp-prefer-flymake nil) | |
) | |
(use-package default-text-scale | |
:ensure t | |
:config | |
(global-set-key (kbd "C-M-=") 'default-text-scale-increase) | |
(global-set-key (kbd "C-M--") 'default-text-scale-decrease)) | |
;; yaml | |
(use-package yaml-mode | |
:ensure t | |
:bind (:map yaml-mode-map | |
("\C-m" . newline-and-indent)) | |
:config | |
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yaml.tmpl\\'" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yml.tmpl\\'" . yaml-mode)) | |
) | |
;; toml | |
(add-to-list 'auto-mode-alist '("\\.toml\\'" . conf-unix-mode)) | |
;; c | |
(add-hook 'c-mode-hook | |
(lambda () | |
(add-to-list 'ac-sources 'ac-source-c-headers) | |
(add-to-list 'ac-sources 'ac-source-c-header-symbols t))) | |
;; docker | |
(use-package dockerfile-mode | |
:ensure t | |
:config | |
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)) | |
) | |
(defconst cb/fourspace-protobuf-style | |
'((c-basic-offset . 4) | |
(indent-tabs-mode . nil))) | |
;; protobuf | |
(use-package protobuf-mode | |
:ensure t | |
:config | |
(add-hook 'protobuf-mode-hook | |
(lambda () (c-add-style "four-space" cb/fourspace-protobuf-style t))) | |
(add-hook 'protobuf-mode-hook #'flycheck-mode) | |
) | |
;; magithub | |
;; | |
;; create a personal access token https://github.enterprise.tld/settings/tokens | |
;; add an entry to ~/.authinfo.gpg | |
;; | |
;; machine github.enterprise.tld/api/v3 login USERNAME^magithub password TOKEN | |
;; | |
;; do the following in EACH repo you want to use magithub | |
;; | |
;; git config github.host github.enterprise.tld/api/v3; git config github.enterprise.tld/api/v3.user USERNAME | |
;; (use-package magithub | |
;; :ensure t | |
;; :after magit | |
;; :config | |
;; (magithub-feature-autoinject t) | |
;; (setq magithub-github-hosts '("github.enterprise.tld" "github.com")) | |
;; ) | |
;; magit | |
(use-package magit :ensure t) | |
;; create a personal access token https://github.enterprise.tld/settings/tokens | |
;; add an entry to ~/.authinfo.gpg | |
;; | |
;; machine github.enterprise.tld/api/v3 login USERNAME^forge password TOKEN | |
;; | |
;; do the following in EACH repo you want to use magithub | |
;; | |
;; git config github.host github.enterprise.tld/api/v3; git config github.enterprise.tld/api/v3.user USERNAME | |
(use-package forge | |
:ensure t | |
:after magit | |
:config | |
(when (boundp 'cb/enterprise-github) | |
(add-to-list 'forge-alist (list cb/enterprise-github (format "%s/api/v3" cb/enterprise-github) cb/enterprise-github 'forge-github-repository)) | |
) | |
(add-to-list 'magit-status-sections-hook 'forge-insert-assigned-pullreqs) | |
(add-to-list 'magit-status-sections-hook 'forge-insert-topic-review-requests) | |
) | |
;; needs a personal access token | |
;; entry in ~/.authinfo.gpg | |
;; | |
;; machine github.enterprise.tld/api/v3 login USERNAME^github-review password TOKEN | |
(use-package github-review | |
:ensure t | |
:after forge | |
:config | |
(when (boundp 'cb/enterprise-github) | |
(setq github-review-host (format "%s/api/v3" cb/enterprise-github) ) | |
) | |
) | |
(use-package vdiff | |
:ensure t | |
:config | |
(setq vdiff-diff-algorithm 'git-diff-patience) | |
(define-key vdiff-mode-map (kbd "C-c") vdiff-mode-prefix-map) | |
(define-key vdiff-3way-mode-map (kbd "C-c") vdiff-mode-prefix-map) | |
) | |
(use-package vdiff-magit | |
:ensure t | |
:after (magit vdiff) | |
:bind (:map magit-mode-map | |
("e" . vdiff-magit-dwim) | |
("E" . vdiff-magit)) | |
:config | |
(transient-suffix-put 'magit-dispatch "e" :description "vdiff (dwim)") | |
(transient-suffix-put 'magit-dispatch "e" :command 'vdiff-magit-dwim) | |
(transient-suffix-put 'magit-dispatch "E" :description "vdiff") | |
(transient-suffix-put 'magit-dispatch "E" :command 'vdiff-magit) | |
) | |
;; (setq ediff-merge-split-window-function 'split-window-vertically) | |
(setq ediff-window-setup-function 'ediff-setup-windows-plain) ;; no popout frame plz! | |
;; python | |
;; (use-package jedi | |
;; :ensure t | |
;; :after (python-mode) | |
;; :hook | |
;; ((python-mode . jedi:setup)) | |
;; :config | |
;; ;; (add-hook 'python-mode-hook 'jedi:setup) | |
;; (setq jedi:complete-on-dot t) | |
;; ) | |
;; (use-package company-jedi | |
;; :ensure t | |
;; :config | |
;; (add-to-list 'company-backends 'company-jedi)) | |
(use-package sphinx-doc | |
:ensure t | |
:config | |
(add-hook 'python-mode-hook 'sphinx-doc-mode)) | |
;; haskell | |
(use-package haskell-mode | |
:ensure t | |
:init | |
(setenv "PATH" "$HOME/.ghcup/bin:$PATH" t) | |
(add-to-list 'exec-path (substitute-in-file-name "$HOME/.ghcup/bin")) | |
) | |
(use-package flycheck-haskell | |
:ensure t | |
:after (flycheck haskell-mode) | |
:hook | |
((flycheck-mode . flycheck-haskell-setup) | |
(haskell-mode . flycheck-mode)) | |
) | |
(use-package intero | |
:ensure t | |
:config | |
(add-hook 'haskell-mode-hook 'intero-mode)) | |
(use-package hl-todo | |
:ensure t | |
:config | |
(global-hl-line-mode) | |
(global-hl-todo-mode t) | |
(define-key hl-todo-mode-map (kbd "C-c C-t p") 'hl-todo-previous) | |
(define-key hl-todo-mode-map (kbd "C-c C-t n") 'hl-todo-next) | |
(define-key hl-todo-mode-map (kbd "C-c C-t o") 'hl-todo-occur)) | |
;;;;;;;;;;;;;;;;;; | |
;; key bindings ;; | |
;;;;;;;;;;;;;;;;;; | |
(use-package multiple-cursors | |
:ensure t | |
:bind | |
(("H-d" . mc/mark-next-like-this) | |
("C->" . mc/mark-next-like-this) | |
("C-<" . mc/mark-previous-like-this) | |
("C-c C-<" . mc/mark-all-like-this) | |
("C-S-c C-S-c" . mc/edit-lines) | |
("C-c m l" . mc/edit-lines) | |
("s-d" . mc/mark-next-like-this))) | |
;; (require 'multi-cursor-keybindings) | |
;; Scroll faster without a mouse | |
(global-set-key (kbd "C-c C-p") (lambda () (interactive) (next-line -20))) | |
(global-set-key (kbd "C-c C-n") (lambda () (interactive) (next-line 20))) | |
(use-package "helm-gtags" | |
:ensure t | |
:bind (:map helm-gtags-mode-map | |
("M-." . helm-gtags-dwim) | |
("M-t" . helm-gtags-find-tag) | |
("M-r" . helm-gtags-find-rtag) | |
("M-s" . helm-gtags-find-symbol) | |
("M-g M-p" . helm-gtags-parse-file) | |
("C-c <" . helm-gtags-previous-history) | |
("C-c >" . helm-gtags-next-history) | |
("M-," . helm-gtags-pop-stack)) | |
:hook | |
(((c-mode c++-mode asm-mode python-mode) . helm-gtags-mode))) | |
(use-package company-shell | |
:ensure t | |
:hook ((sh-mode . company-mode)) | |
:config | |
(add-to-list 'company-backends 'company-shell)) | |
(use-package jq-mode | |
:ensure t | |
:config | |
(add-to-list 'auto-mode-alist '("\\.jq$" . jq-mode)) | |
(with-eval-after-load "json-mode" | |
(define-key json-mode-map (kbd "C-c C-j") #'jq-interactively))) | |
;; org-mode | |
(setq org-src-preserve-indentation nil) | |
(setq org-src-tab-acts-natively t) | |
(add-hook 'org-mode-hook (lambda () (setq indent-tabs-mode nil))) | |
(setq org-src-fontify-natively t) | |
(use-package ob-async :ensure t) | |
(use-package ob-restclient :ensure t) | |
(use-package ob-rust :ensure t) | |
(use-package ob-go :ensure t) | |
(require 'org) | |
(require 'ob-python) | |
(org-babel-do-load-languages | |
'org-babel-load-languages | |
'((emacs-lisp . t) | |
(python . t) | |
(sql . t) | |
(haskell . t) | |
(dot . t) | |
(ditaa . t) | |
(rust . t) | |
(restclient . t) | |
(shell . t) | |
(go . t) | |
(jq . t) | |
(plantuml . t) | |
(scheme . t) | |
)) | |
(setq org-confirm-babel-evaluate t) | |
(setq org-ditaa-jar-path "/usr/share/ditaa/ditaa.jar") | |
(define-key global-map "\C-cc" 'org-capture) | |
(setq org-capture-templates | |
'(("t" "Todo" entry (file+headline "~/org/agenda.org" "Tasks") | |
"* TODO %?\n %i\n %a") | |
("j" "Journal" entry (file+datetree "~/org/journal.org") | |
"* %?\nEntered on %U\n %i\n %a") | |
("m" "TODO from mail" entry (file+headline "~/org/agenda.org" "Email") | |
"* TODO %?\nref: %a") | |
)) | |
;; use minted for better source blocks in latex export | |
(setq org-latex-listings 'minted | |
org-latex-packages-alist '(("" "minted")) | |
org-latex-pdf-process | |
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | |
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | |
(setq org-latex-minted-options '(("breaklines" "true") | |
("breakanywhere" "true"))) | |
;; (use-package ox-pandoc :ensure t) | |
(use-package ox-jira :ensure t) | |
(use-package ox-html5slide | |
:ensure t) | |
(use-package ox-ioslide | |
:ensure t) | |
(use-package beacon | |
:ensure t | |
:config | |
(beacon-mode 1)) | |
(use-package markdown-mode | |
:ensure t | |
:commands (markdown-mode gfm-mode) | |
:mode (("README\\.md\\'" . gfm-mode) | |
("\\.md\\'" . markdown-mode) | |
("\\.markdown\\'" . markdown-mode))) | |
(use-package groovy-mode | |
:ensure t | |
:mode (("Jenkinsfile" . groovy-mode))) | |
(use-package plantuml-mode | |
:ensure t | |
:config | |
(setq org-plantuml-jar-path "~/bin/plantuml.jar")) | |
(use-package emms | |
:ensure t | |
:config | |
(emms-standard) | |
(emms-default-players)) | |
(use-package fic-mode | |
:ensure t | |
:config | |
(add-hook 'prog-mode-hook 'fic-mode)) | |
(use-package git-link | |
:ensure t | |
:config | |
(when (boundp 'cb/enterprise-github) | |
(add-to-list 'git-link-remote-alist (list cb/enterprise-github 'git-link-github)) | |
(add-to-list 'git-link-commit-remote-alist (list cb/enterprise-github 'git-link-commit-github))) | |
) | |
(use-package ox-gfm :ensure t) | |
;; (use-package w3m | |
;; :ensure t | |
;; :config | |
;; (setq browse-url-browser-function 'w3m-browse-url)) | |
;;'(browse-url-browser-function (quote browse-url-w3)) | |
(use-package string-inflection | |
:ensure t) | |
(use-package figlet :ensure t) | |
(use-package yasnippet | |
:ensure t | |
:config | |
(yas-global-mode)) | |
(add-hook 'prog-mode-hook '(lambda() (add-hook 'before-save-hook 'copyright-update))) | |
(setq copyright-year-ranges t) | |
(use-package graphviz-dot-mode :ensure t) | |
(use-package weechat | |
:ensure t | |
:config | |
(setq weechat-host-default "204.48.29.163") | |
(setq weechat-port-default "9090") | |
) | |
(use-package helm-rg | |
:after (helm) | |
:ensure t) | |
(use-package emacsshot | |
:ensure t | |
:bind (("<XF86Launch6>" . 'emacsshot-snap-frame) | |
("<XF86Launch5>" . 'emacsshot-snap-window)) | |
:config | |
(setq emacsshot-with-timestamp t)) | |
(use-package org-present :ensure t) | |
(use-package nix-buffer :ensure t) | |
(use-package nix-mode :ensure t) | |
(use-package exec-path-from-shell | |
:ensure t | |
:config (when (memq window-system '(mac ns)) | |
(exec-path-from-shell-initialize))) | |
(use-package md4rd :ensure t | |
:config | |
(setq md4rd-subs-active '(rust emacs golang))) | |
(use-package twittering-mode :ensure t) | |
(use-package helm-lobsters | |
:after helm | |
:ensure t) | |
(use-package pulseaudio-control :ensure t | |
:config | |
(pulseaudio-control-default-keybindings)) | |
(use-package magit-todos | |
:ensure t | |
:after magit | |
:config | |
(setq magit-todos-exclude-globs '("**/vendor/*"))) | |
;;; Fira code | |
;; This works when using emacs --daemon + emacsclient | |
(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))) | |
;; This works when using emacs without server/client | |
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol") | |
;; I haven't found one statement that makes both of the above situations work, so I use both for now | |
(defconst fira-code-font-lock-keywords-alist | |
(mapcar (lambda (regex-char-pair) | |
`(,(car regex-char-pair) | |
(0 (prog1 () | |
(compose-region (match-beginning 1) | |
(match-end 1) | |
;; The first argument to concat is a string containing a literal tab | |
,(concat " " (list (decode-char 'ucs (cadr regex-char-pair))))))))) | |
'(("\\(www\\)" #Xe100) | |
("[^/]\\(\\*\\*\\)[^/]" #Xe101) | |
("\\(\\*\\*\\*\\)" #Xe102) | |
("\\(\\*\\*/\\)" #Xe103) | |
("\\(\\*>\\)" #Xe104) | |
("[^*]\\(\\*/\\)" #Xe105) | |
("\\(\\\\\\\\\\)" #Xe106) | |
("\\(\\\\\\\\\\\\\\)" #Xe107) | |
("\\({-\\)" #Xe108) | |
("\\(\\[\\]\\)" #Xe109) | |
("\\(::\\)" #Xe10a) | |
("\\(:::\\)" #Xe10b) | |
("[^=]\\(:=\\)" #Xe10c) | |
("\\(!!\\)" #Xe10d) | |
("\\(!=\\)" #Xe10e) | |
("\\(!==\\)" #Xe10f) | |
("\\(-}\\)" #Xe110) | |
("\\(--\\)" #Xe111) | |
("\\(---\\)" #Xe112) | |
("\\(-->\\)" #Xe113) | |
("[^-]\\(->\\)" #Xe114) | |
("\\(->>\\)" #Xe115) | |
("\\(-<\\)" #Xe116) | |
("\\(-<<\\)" #Xe117) | |
("\\(-~\\)" #Xe118) | |
("\\(#{\\)" #Xe119) | |
("\\(#\\[\\)" #Xe11a) | |
("\\(##\\)" #Xe11b) | |
("\\(###\\)" #Xe11c) | |
("\\(####\\)" #Xe11d) | |
("\\(#(\\)" #Xe11e) | |
("\\(#\\?\\)" #Xe11f) | |
("\\(#_\\)" #Xe120) | |
("\\(#_(\\)" #Xe121) | |
("\\(\\.-\\)" #Xe122) | |
("\\(\\.=\\)" #Xe123) | |
("\\(\\.\\.\\)" #Xe124) | |
("\\(\\.\\.<\\)" #Xe125) | |
("\\(\\.\\.\\.\\)" #Xe126) | |
("\\(\\?=\\)" #Xe127) | |
("\\(\\?\\?\\)" #Xe128) | |
("\\(;;\\)" #Xe129) | |
("\\(/\\*\\)" #Xe12a) | |
("\\(/\\*\\*\\)" #Xe12b) | |
("\\(/=\\)" #Xe12c) | |
("\\(/==\\)" #Xe12d) | |
("\\(/>\\)" #Xe12e) | |
("\\(//\\)" #Xe12f) | |
("\\(///\\)" #Xe130) | |
("\\(&&\\)" #Xe131) | |
("\\(||\\)" #Xe132) | |
("\\(||=\\)" #Xe133) | |
("[^|]\\(|=\\)" #Xe134) | |
("\\(|>\\)" #Xe135) | |
("\\(\\^=\\)" #Xe136) | |
("\\(\\$>\\)" #Xe137) | |
("\\(\\+\\+\\)" #Xe138) | |
("\\(\\+\\+\\+\\)" #Xe139) | |
("\\(\\+>\\)" #Xe13a) | |
("\\(=:=\\)" #Xe13b) | |
("[^!/]\\(==\\)[^>]" #Xe13c) | |
("\\(===\\)" #Xe13d) | |
("\\(==>\\)" #Xe13e) | |
("[^=]\\(=>\\)" #Xe13f) | |
("\\(=>>\\)" #Xe140) | |
("\\(<=\\)" #Xe141) | |
("\\(=<<\\)" #Xe142) | |
("\\(=/=\\)" #Xe143) | |
("\\(>-\\)" #Xe144) | |
("\\(>=\\)" #Xe145) | |
("\\(>=>\\)" #Xe146) | |
("[^-=]\\(>>\\)" #Xe147) | |
("\\(>>-\\)" #Xe148) | |
("\\(>>=\\)" #Xe149) | |
("\\(>>>\\)" #Xe14a) | |
("\\(<\\*\\)" #Xe14b) | |
("\\(<\\*>\\)" #Xe14c) | |
("\\(<|\\)" #Xe14d) | |
("\\(<|>\\)" #Xe14e) | |
("\\(<\\$\\)" #Xe14f) | |
("\\(<\\$>\\)" #Xe150) | |
("\\(<!--\\)" #Xe151) | |
("\\(<-\\)" #Xe152) | |
("\\(<--\\)" #Xe153) | |
("\\(<->\\)" #Xe154) | |
("\\(<\\+\\)" #Xe155) | |
("\\(<\\+>\\)" #Xe156) | |
("\\(<=\\)" #Xe157) | |
("\\(<==\\)" #Xe158) | |
("\\(<=>\\)" #Xe159) | |
("\\(<=<\\)" #Xe15a) | |
("\\(<>\\)" #Xe15b) | |
("[^-=]\\(<<\\)" #Xe15c) | |
("\\(<<-\\)" #Xe15d) | |
("\\(<<=\\)" #Xe15e) | |
("\\(<<<\\)" #Xe15f) | |
("\\(<~\\)" #Xe160) | |
("\\(<~~\\)" #Xe161) | |
("\\(</\\)" #Xe162) | |
("\\(</>\\)" #Xe163) | |
("\\(~@\\)" #Xe164) | |
("\\(~-\\)" #Xe165) | |
("\\(~=\\)" #Xe166) | |
("\\(~>\\)" #Xe167) | |
("[^<]\\(~~\\)" #Xe168) | |
("\\(~~>\\)" #Xe169) | |
("\\(%%\\)" #Xe16a) | |
;; ("\\(x\\)" #Xe16b) This ended up being hard to do properly so i'm leaving it out. | |
("[^:=]\\(:\\)[^:=]" #Xe16c) | |
("[^\\+<>]\\(\\+\\)[^\\+<>]" #Xe16d) | |
("[^\\*/<>]\\(\\*\\)[^\\*/<>]" #Xe16f)))) | |
(defun add-fira-code-symbol-keywords () | |
(font-lock-add-keywords nil fira-code-font-lock-keywords-alist)) | |
;; disabled for now, causing woes over ssh | |
;; (add-hook 'prog-mode-hook #'add-fira-code-symbol-keywords) | |
;; gpg pinentry in the minibuffer | |
;; (unless (memq window-system '(mac ns)) | |
;; (setq epa-pinentry-mode 'loopback) | |
;; (when (= emacs-major-version 25) (pinentry-start)) | |
;; (setq epg-gpg-program "/usr/local/bin/gpg2")) | |
;; high contrast html rendering in gnus | |
(setq shr-color-visible-distance-min 60) | |
(setq shr-color-visible-luminance-min 80) | |
;; contact harvesting from emails | |
(use-package bbdb | |
:ensure t | |
:config | |
(setq bbdb/news-auto-create-p t) | |
(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) | |
) | |
;; org-jira | |
;; (use-package org-jira | |
;; :ensure t | |
;; :config | |
;; (setq jiralib-url "https://jira.COMPANY.TLD") | |
;; (setq org-jira-custom-jqls | |
;; '( | |
;; ( | |
;; :jql " project = PD AND labels in (team-blades) AND status not in ('Ready to Release', done)" | |
;; :limit 50 | |
;; :filename "team-blades" | |
;; ) | |
;; )) | |
;; ) | |
;; org-gcal | |
;; (use-package org-gcal | |
;; :ensure t | |
;; :config | |
;; ;; authinfo line of the form: | |
;; ;; machine COMPANY.gcal login CLIENT_ID password CLIENT_SECRET port 9999 | |
;; (when-let ((secret (car (auth-source-search :host "COMPANY.gcal" :port "9999" :max 1)))) | |
;; (setq org-gcal-client-secret (funcall (plist-get secret :secret)) | |
;; org-gcal-client-id (plist-get secret :user))) | |
;; (setq org-gcal-file-alist '(("[email protected]" . "~/org/schedule.org") | |
;; ("[email protected]" . "~/org/company-events.org") | |
;; ))) | |
(setq org-agenda-files '("~/org/agenda.org" )) | |
(use-package undo-tree | |
:ensure t | |
:delight | |
:config | |
(global-undo-tree-mode)) | |
;; backslash (\) as escape character in sql | |
(add-hook 'sql-mode-hook | |
(lambda () | |
(modify-syntax-entry ?\\ "\\" sql-mode-syntax-table))) | |
(put 'downcase-region 'disabled nil) | |
(put 'narrow-to-region 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment