2015-10-07 14:16:41 -04:00
|
|
|
;;; Emacs Config
|
|
|
|
;;;; various options
|
2017-09-02 18:15:37 -04:00
|
|
|
(setq read-file-name-completion-ignore-case t
|
2015-08-16 21:32:07 -04:00
|
|
|
inhibit-startup-screen t
|
2015-10-04 16:01:32 -04:00
|
|
|
vc-follow-symlinks t
|
2015-11-19 16:24:55 -05:00
|
|
|
custom-file (expand-file-name "~/.emacs.d/custom.el")
|
|
|
|
gc-cons-threshold 100000000)
|
2019-08-15 18:28:38 -04:00
|
|
|
(load custom-file t)
|
2021-05-26 00:46:42 -04:00
|
|
|
(load-theme 'tango-dark t)
|
2015-05-03 09:45:48 -04:00
|
|
|
(load-theme 'fred t)
|
2016-03-01 15:19:56 -05:00
|
|
|
(column-number-mode 1)
|
2019-05-30 00:36:01 -04:00
|
|
|
(setq standard-indent 2)
|
|
|
|
(setq-default tab-width 4
|
|
|
|
indent-tabs-mode nil)
|
2018-05-11 00:55:59 -04:00
|
|
|
;;;; enable disabled functions
|
2016-03-01 15:18:30 -05:00
|
|
|
(put 'upcase-region 'disabled nil)
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
|
|
(put 'narrow-to-region 'disabled nil)
|
2020-08-12 20:35:11 -04:00
|
|
|
(put 'TeX-narrow-to-group 'disabled nil)
|
|
|
|
(put 'LaTeX-narrow-to-environment 'disabled nil)
|
2016-03-01 15:18:30 -05:00
|
|
|
|
2015-10-07 14:16:41 -04:00
|
|
|
;;;; save backups and autosaves in tmp
|
2015-08-16 21:32:07 -04:00
|
|
|
(setq backup-directory-alist `((".*" . ,temporary-file-directory))
|
2015-11-19 16:24:55 -05:00
|
|
|
auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
|
2015-04-25 21:51:54 -04:00
|
|
|
|
2015-10-07 14:16:41 -04:00
|
|
|
;;; Packages
|
2018-11-23 15:48:27 -05:00
|
|
|
;;;; packaging related stuff
|
2021-10-22 16:12:30 -04:00
|
|
|
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
2016-09-19 23:52:15 -04:00
|
|
|
(require 'package)
|
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
2021-12-09 03:07:06 -05:00
|
|
|
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
|
2015-08-16 21:32:07 -04:00
|
|
|
(package-initialize)
|
2018-12-12 20:34:30 -05:00
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
(package-refresh-contents)
|
|
|
|
(package-install 'use-package))
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package use-package
|
|
|
|
:config
|
|
|
|
(setq use-package-check-before-init t
|
|
|
|
use-package-always-defer t))
|
|
|
|
(use-package quelpa :ensure :demand
|
2018-11-23 15:48:27 -05:00
|
|
|
:init
|
|
|
|
(setq quelpa-update-melpa-p nil)
|
|
|
|
:config
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package quelpa-use-package :ensure :demand))
|
2015-04-25 21:51:54 -04:00
|
|
|
|
2019-01-12 15:29:42 -05:00
|
|
|
;;;; not sure where to put this
|
|
|
|
(defun open-thunar-in-current-directory ()
|
|
|
|
(interactive)
|
2023-09-29 23:08:03 -04:00
|
|
|
(call-process "setsid" nil 0 nil "thunar" "."))
|
2019-01-12 15:29:42 -05:00
|
|
|
|
|
|
|
(defun open-term-in-current-directory ()
|
|
|
|
(interactive)
|
2023-09-29 23:08:03 -04:00
|
|
|
(call-process "setsid" nil 0 nil "alacritty"))
|
2019-01-12 15:29:42 -05:00
|
|
|
|
|
|
|
(bind-key "<s-return>" 'open-term-in-current-directory)
|
|
|
|
(bind-key "s-t" 'open-thunar-in-current-directory)
|
|
|
|
|
2015-10-07 14:16:41 -04:00
|
|
|
;;;; internal packages
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package tool-bar :demand
|
2019-05-30 00:36:01 -04:00
|
|
|
:config
|
|
|
|
(when (fboundp 'tool-bar-mode)
|
|
|
|
(tool-bar-mode -1)))
|
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package savehist :demand
|
2019-05-30 00:36:01 -04:00
|
|
|
:config
|
2021-01-04 13:29:09 -05:00
|
|
|
(savehist-mode)
|
|
|
|
(defun savehist-file-name-history-cleanup ()
|
|
|
|
"Delete all the files in file-name-history that don't exist anymore"
|
|
|
|
(interactive)
|
|
|
|
(setq file-name-history
|
|
|
|
(seq-filter
|
|
|
|
(lambda (file)
|
|
|
|
(or (file-remote-p file) (file-exists-p file)))
|
|
|
|
file-name-history))))
|
2019-05-30 00:36:01 -04:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package paren :demand
|
2019-02-19 02:02:55 -05:00
|
|
|
:config
|
2019-05-30 00:36:01 -04:00
|
|
|
(show-paren-mode 1))
|
2019-01-20 02:28:12 -05:00
|
|
|
|
|
|
|
(use-package sh-script
|
|
|
|
:config
|
|
|
|
(add-hook 'sh-mode-hook (lambda () (setq tab-width 4))))
|
|
|
|
|
2015-10-04 16:32:35 -04:00
|
|
|
(use-package ibuffer
|
2016-03-01 15:08:31 -05:00
|
|
|
:bind ("C-x C-b" . ibuffer)
|
2015-10-04 16:32:35 -04:00
|
|
|
:config
|
|
|
|
(setq ibuffer-saved-filter-groups
|
2015-11-19 16:24:55 -05:00
|
|
|
(quote (("default"
|
|
|
|
("emacs" (or
|
|
|
|
(name . "^\\*scratch\\*$")
|
|
|
|
(name . "^\\*Messages\\*$")))))))
|
2015-10-04 16:32:35 -04:00
|
|
|
(add-hook 'ibuffer-mode-hook (lambda ()
|
2015-11-19 16:24:55 -05:00
|
|
|
(ibuffer-auto-mode 1)
|
|
|
|
(setq ibuffer-show-empty-filter-groups nil))))
|
2015-10-04 16:32:35 -04:00
|
|
|
|
2019-01-20 02:28:12 -05:00
|
|
|
(use-package sgml-mode
|
2019-01-20 02:28:38 -05:00
|
|
|
:hook ((sgml-mode nxml-mode html-mode web-mode)
|
|
|
|
. sgml-electric-tag-pair-mode)
|
2019-01-20 02:28:12 -05:00
|
|
|
:config
|
|
|
|
(setq sgml-basic-offset 4))
|
|
|
|
|
2015-11-17 15:59:53 -05:00
|
|
|
(use-package compile
|
2016-02-18 23:25:36 -05:00
|
|
|
:commands (compile recompile)
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (("C-z" . recompile)
|
|
|
|
("C-S-z" . compile))
|
2015-11-17 15:59:53 -05:00
|
|
|
:config
|
2017-09-02 18:15:37 -04:00
|
|
|
(setq compilation-scroll-output 'first-error)
|
2017-09-21 03:28:13 -04:00
|
|
|
|
|
|
|
(require 'ansi-color)
|
|
|
|
(add-hook 'compilation-filter-hook
|
|
|
|
(lambda ()
|
|
|
|
(toggle-read-only 0)
|
|
|
|
(ansi-color-apply-on-region compilation-filter-start (point))
|
|
|
|
(toggle-read-only 1)))
|
|
|
|
|
2017-09-02 18:15:37 -04:00
|
|
|
(add-hook 'compilation-start-hook
|
2017-09-03 04:54:03 -04:00
|
|
|
(lambda (x) (setq-local scroll-up-aggressively 0.0))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-11-18 00:16:17 -05:00
|
|
|
(use-package verilog-mode
|
|
|
|
:config
|
|
|
|
(setq verilog-indent-level 4
|
2015-11-19 16:24:55 -05:00
|
|
|
verilog-indent-level-behavioral 4
|
|
|
|
verilog-indent-level-declaration 4
|
|
|
|
verilog-indent-level-module 4
|
2016-09-19 23:43:02 -04:00
|
|
|
verilog-auto-newline nil
|
|
|
|
verilog-linter "verilator --lint-only")
|
2016-09-19 23:50:42 -04:00
|
|
|
(add-hook 'verilog-mode-hook (lambda () (setq indent-tabs-mode nil)))
|
|
|
|
(add-to-list 'company-keywords-alist (cons 'verilog-mode verilog-keywords)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-02-19 00:08:14 -05:00
|
|
|
(use-package python
|
|
|
|
:config
|
2016-09-13 13:19:09 -04:00
|
|
|
(when (executable-find "ipython")
|
|
|
|
(setq python-shell-interpreter "ipython")
|
|
|
|
(setq python-shell-interpreter-args "-i --simple-prompt")
|
|
|
|
(add-to-list 'python-shell-completion-native-disabled-interpreters "ipython")))
|
2016-02-19 00:08:14 -05:00
|
|
|
|
2016-03-01 15:28:17 -05:00
|
|
|
(use-package tramp
|
2017-08-05 12:35:19 -04:00
|
|
|
:bind ("C-c C-f" . find-file-as-root)
|
2016-03-01 15:28:17 -05:00
|
|
|
:config
|
|
|
|
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
|
2017-08-05 12:35:19 -04:00
|
|
|
(setq tramp-default-method "ssh")
|
|
|
|
(defun find-file-as-root ()
|
|
|
|
(interactive)
|
2018-02-20 15:40:22 -05:00
|
|
|
(find-alternate-file (concat "/sudo::" (buffer-file-name)))))
|
2016-04-08 11:20:59 -04:00
|
|
|
|
|
|
|
(use-package comint
|
|
|
|
:config
|
2018-11-09 11:39:58 -05:00
|
|
|
(setq-default
|
|
|
|
comint-scroll-to-bottom-on-input t ; always insert at the bottom
|
|
|
|
comint-scroll-to-bottom-on-output nil ; always add output at the bottom
|
|
|
|
comint-scroll-show-maximum-output t ; scroll to show max possible output
|
|
|
|
;; comint-completion-autolist t ; show completion list when ambiguous
|
|
|
|
comint-input-ignoredups t ; no duplicates in command history
|
|
|
|
comint-completion-addsuffix t ; insert space/slash after file completion
|
|
|
|
comint-buffer-maximum-size 20000 ; max length of the buffer in lines
|
|
|
|
comint-get-old-input (lambda () "") ; what to run when i press enter on a
|
|
|
|
; line above the current prompt
|
|
|
|
comint-input-ring-size 500) ; max shell history size
|
2016-04-08 11:20:59 -04:00
|
|
|
(add-hook 'comint-mode-hook
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (setq-local show-trailing-whitespace nil))))
|
2016-03-01 15:28:17 -05:00
|
|
|
|
2016-04-25 23:54:45 -04:00
|
|
|
(use-package semantic
|
2018-03-23 01:25:11 -04:00
|
|
|
:hook (c-mode . semantic-mode)
|
2016-04-25 23:54:45 -04:00
|
|
|
:config
|
2017-04-21 15:48:02 -04:00
|
|
|
(setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
|
|
|
|
global-semanticdb-minor-mode
|
|
|
|
global-semantic-decoration-mode
|
|
|
|
global-semantic-highlight-func-mode
|
|
|
|
global-semantic-show-unmatched-syntax-mode
|
|
|
|
global-semantic-idle-summary-mode
|
|
|
|
global-semantic-stickyfunc-mode
|
|
|
|
global-semantic-idle-local-symbol-highlight-mode)
|
|
|
|
semantic-idle-scheduler-idle-time 0.2)
|
|
|
|
|
|
|
|
; inhibit semantic outside of specific modes
|
2017-06-01 19:00:40 -04:00
|
|
|
(setq semantic-inhibit-functions
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (not (member major-mode '(c-mode cc-mode java-mode)))))
|
2017-04-21 15:48:02 -04:00
|
|
|
|
|
|
|
(eval-after-load "cc-mode"
|
2018-11-06 12:10:47 -05:00
|
|
|
'(bind-key "M-." 'semantic-ia-fast-jump c-mode-map)))
|
2016-04-25 23:54:45 -04:00
|
|
|
|
2016-04-07 20:34:51 -04:00
|
|
|
(use-package term
|
|
|
|
:config
|
2016-04-08 11:20:59 -04:00
|
|
|
(add-hook 'term-mode-hook
|
2018-11-09 11:39:58 -05:00
|
|
|
; if this is t, it breaks shell-command
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (setq-local comint-prompt-read-only nil))))
|
2016-04-08 11:20:59 -04:00
|
|
|
|
|
|
|
(use-package gud
|
|
|
|
:config
|
|
|
|
(add-hook 'gud-mode-hook
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (setq-local comint-prompt-read-only t))))
|
2016-04-07 20:34:51 -04:00
|
|
|
|
2021-05-07 18:33:55 -04:00
|
|
|
(use-package org
|
2018-08-28 22:25:02 -04:00
|
|
|
:bind (:map org-mode-map (("C-z" . org-latex-export-to-pdf-no-kr)
|
|
|
|
("M-[" . org-metaleft)
|
2018-09-02 19:22:56 -04:00
|
|
|
("M-]" . org-metaright)
|
2020-02-29 15:43:58 -05:00
|
|
|
("C-{" . org-shiftleft)
|
|
|
|
("C-}" . org-shiftright)
|
2018-10-04 14:56:23 -04:00
|
|
|
("C-M-[" . org-shiftmetaleft)
|
|
|
|
("C-M-]" . org-shiftmetaright)
|
2018-09-02 19:22:56 -04:00
|
|
|
("M-P" . org-metaup)
|
|
|
|
("M-N" . org-metadown))
|
2018-08-28 22:25:02 -04:00
|
|
|
:map org-src-mode-map ("C-z" . org-src-export-to-pdf))
|
2016-09-19 23:46:41 -04:00
|
|
|
:config
|
2023-01-02 00:07:46 -05:00
|
|
|
(add-to-list 'org-modules 'org-tempo t) ; enable org-tempo templates
|
2019-03-28 13:01:40 -04:00
|
|
|
|
2016-09-19 23:46:41 -04:00
|
|
|
;; Make windmove work in org-mode:
|
|
|
|
(add-hook 'org-shiftup-final-hook 'windmove-up)
|
|
|
|
(add-hook 'org-shiftleft-final-hook 'windmove-left)
|
|
|
|
(add-hook 'org-shiftdown-final-hook 'windmove-down)
|
|
|
|
(add-hook 'org-shiftright-final-hook 'windmove-right)
|
|
|
|
|
2018-09-13 22:17:32 -04:00
|
|
|
(setq org-special-ctrl-a/e t
|
|
|
|
org-special-ctrl-k t
|
2018-11-06 12:12:41 -05:00
|
|
|
org-special-ctrl-o t
|
|
|
|
org-preview-latex-default-process 'dvisvgm
|
|
|
|
org-confirm-babel-evaluate nil)
|
2018-09-13 22:17:32 -04:00
|
|
|
|
2016-09-19 23:46:41 -04:00
|
|
|
;; enable line wraping
|
2021-09-13 19:58:44 -04:00
|
|
|
(add-hook 'org-mode-hook (lambda () (setq truncate-lines nil word-wrap t)))
|
2016-09-19 23:46:41 -04:00
|
|
|
|
2018-01-20 16:38:07 -05:00
|
|
|
(defun org-latex-open-pdf ()
|
|
|
|
(interactive)
|
|
|
|
(call-process "evince" nil 0 nil (org-latex-export-to-pdf)))
|
2018-03-15 00:32:55 -04:00
|
|
|
(defun org-latex-export-to-pdf-no-kr ()
|
|
|
|
(interactive)
|
|
|
|
(org-latex-export-to-pdf)
|
|
|
|
(pop kill-ring)) ; remove most recent element of kill ring
|
2018-01-20 16:37:40 -05:00
|
|
|
(defun org-src-export-to-pdf ()
|
|
|
|
(interactive)
|
2019-04-10 13:27:18 -04:00
|
|
|
(with-current-buffer (org-src-source-buffer)
|
2018-11-05 15:28:11 -05:00
|
|
|
(org-latex-export-to-pdf-no-kr)))
|
2018-11-06 12:12:41 -05:00
|
|
|
|
2018-01-20 16:40:37 -05:00
|
|
|
(org-babel-do-load-languages
|
|
|
|
'org-babel-load-languages
|
|
|
|
'((emacs-lisp . t)
|
|
|
|
(dot . t)
|
|
|
|
(python . t)))
|
2018-09-23 20:47:51 -04:00
|
|
|
|
2018-01-16 20:47:07 -05:00
|
|
|
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
|
2018-09-23 20:47:51 -04:00
|
|
|
(add-to-list 'org-src-lang-modes '("dot2tex" . graphviz-dot))
|
|
|
|
|
|
|
|
(defvar org-babel-default-header-args:dot2tex
|
|
|
|
'((:results . "latex") (:exports . "results"))
|
|
|
|
"Default arguments to use when evaluating a dot2tex source block.")
|
|
|
|
(defun org-babel-execute:dot2tex (body params)
|
|
|
|
"Execute a block of Dot code via dot2tex with org-babel.
|
|
|
|
This function is called by `org-babel-execute-src-block'."
|
|
|
|
(let* ((cmdline (concat (cdr (assoc :cmdline params))
|
|
|
|
" --figonly"))
|
|
|
|
(cmd (or (cdr (assq :cmd params)) "dot2tex")))
|
|
|
|
(org-babel-eval (concat cmd " " cmdline)
|
|
|
|
(org-babel-expand-body:dot body params))))
|
|
|
|
(defun org-babel-prep-session:dot2tex (session params)
|
|
|
|
"Return an error because dot2tex does not support sessions."
|
|
|
|
(error "dot2tex does not support sessions"))
|
|
|
|
|
2018-01-16 20:47:07 -05:00
|
|
|
(defun org-insert-homework-header ()
|
2018-05-11 00:55:59 -04:00
|
|
|
""
|
2018-01-16 20:47:07 -05:00
|
|
|
(interactive)
|
2018-10-04 14:56:55 -04:00
|
|
|
(yas-minor-mode t)
|
2018-11-06 12:50:41 -05:00
|
|
|
(yas-expand-snippet (yas-lookup-snippet "Homework Header" 'org-mode)))
|
|
|
|
|
|
|
|
(use-package ob-ipython
|
|
|
|
:config
|
|
|
|
(org-babel-do-load-languages
|
|
|
|
'org-babel-load-languages
|
2020-04-14 03:22:29 -04:00
|
|
|
'((ipython . t))))
|
|
|
|
|
|
|
|
(defun org-link--open-pdf (path)
|
|
|
|
(let ((path-parts (split-string path "::")))
|
|
|
|
(apply 'call-process "evince" nil 0 nil (car path-parts)
|
|
|
|
(when (cadr path-parts) (list "--page-index" (cadr path-parts))))))
|
|
|
|
|
|
|
|
(org-link-set-parameters "pdf" :follow 'org-link--open-pdf))
|
2016-09-19 23:46:41 -04:00
|
|
|
|
2023-01-01 21:57:17 -05:00
|
|
|
(use-package outline
|
|
|
|
:bind (:map outline-minor-mode-map ("<backtab>" . outline-cycle)))
|
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package windmove :demand
|
2017-03-23 20:45:56 -04:00
|
|
|
:config
|
|
|
|
(windmove-default-keybindings))
|
|
|
|
|
2017-08-05 12:25:53 -04:00
|
|
|
(use-package help-mode
|
|
|
|
:config
|
|
|
|
; bind "g" to revert help buffers with no prompt
|
|
|
|
(bind-key "g" (lambda () (interactive) (revert-buffer t t)) help-mode-map))
|
|
|
|
|
|
|
|
(use-package files
|
|
|
|
:config
|
|
|
|
; bind a key to revert buffers with no prompt
|
|
|
|
(bind-key "C-x M-v" (lambda () (interactive) (revert-buffer t t t))))
|
|
|
|
|
2017-08-05 12:28:26 -04:00
|
|
|
(use-package prog-mode
|
|
|
|
:config
|
|
|
|
(add-hook 'prog-mode-hook
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (setq-local show-trailing-whitespace t))))
|
2017-08-05 12:28:26 -04:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package frame :demand
|
2021-05-26 00:44:51 -04:00
|
|
|
:bind ("C-x C-S-c" . delete-invisible-frames)
|
2018-04-01 21:26:58 -04:00
|
|
|
:config
|
|
|
|
(defun suspend-frame ()
|
|
|
|
"If running in a secondary tty, call `suspend-tty', else nop"
|
|
|
|
(interactive)
|
|
|
|
(when (eq (framep (selected-frame)) t)
|
2021-05-26 00:44:51 -04:00
|
|
|
(suspend-tty)))
|
|
|
|
(defun delete-invisible-frames ()
|
|
|
|
"Delete all non-visible frames, to fix \"Attempt to delete a surrogate minibuffer frame\" issues"
|
|
|
|
(interactive)
|
|
|
|
(mapc (lambda (frame)
|
|
|
|
(unless (frame-visible-p frame) (delete-frame frame)))
|
|
|
|
(frame-list))))
|
2018-04-01 21:26:58 -04:00
|
|
|
|
2018-05-11 00:53:00 -04:00
|
|
|
(use-package cc-styles
|
|
|
|
:config
|
|
|
|
(setq c-default-style "linux"
|
|
|
|
c-basic-offset 4)
|
|
|
|
(c-set-offset `inline-open 0))
|
|
|
|
|
2018-08-28 21:42:59 -04:00
|
|
|
(use-package antlr-mode
|
|
|
|
:mode "\\.g4\\'")
|
|
|
|
|
2018-08-23 23:54:29 -04:00
|
|
|
(use-package paragraphs
|
|
|
|
:bind (("M-p" . backward-paragraph)
|
|
|
|
("M-n" . forward-paragraph)))
|
|
|
|
|
2019-02-19 01:57:10 -05:00
|
|
|
(use-package ns-win
|
|
|
|
:config
|
2019-05-30 00:39:03 -04:00
|
|
|
(setq ns-command-modifier 'hyper)
|
2020-08-04 11:52:52 -04:00
|
|
|
(server-start)
|
|
|
|
; disable focus stealing
|
|
|
|
(defun raise-frame (frame) (interactive) nil))
|
2019-02-19 01:57:10 -05:00
|
|
|
|
2020-04-02 15:33:53 -04:00
|
|
|
(use-package yaml-mode
|
|
|
|
:config
|
|
|
|
(add-hook 'yaml-mode-hook
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda () (setq-local show-trailing-whitespace t))))
|
2020-04-02 15:33:53 -04:00
|
|
|
|
2023-08-16 14:10:49 -04:00
|
|
|
(use-package auth-source-pass :demand
|
|
|
|
:config
|
|
|
|
(auth-source-pass-enable)
|
|
|
|
(defun auth-source-pass--remap (orig-fun host &optional user port)
|
|
|
|
(let ((new-host (pcase host
|
|
|
|
("hosting" "hosting.tardisventures.net")
|
|
|
|
(_ host)))
|
|
|
|
(new-user (if (string= port "sudo") (user-login-name) user)))
|
|
|
|
(message "remapped %s@%s:%s -> %s@%s:%s" host user port new-host new-user port)
|
|
|
|
(funcall orig-fun new-host new-user port)))
|
|
|
|
|
|
|
|
(advice-add 'auth-source-pass--find-match-unambiguous :around #'auth-source-pass--remap))
|
|
|
|
|
2022-08-07 22:45:08 -04:00
|
|
|
(use-package calc
|
|
|
|
:bind ("C-x M-e" . calc-eval-in-place)
|
|
|
|
:init
|
|
|
|
(defun calc-eval-in-place ()
|
|
|
|
(interactive)
|
|
|
|
(let ((result (calc-eval (buffer-substring-no-properties (point) (mark)))))
|
|
|
|
(if (stringp result)
|
|
|
|
(progn
|
|
|
|
(delete-region (point) (mark))
|
|
|
|
(insert result))
|
|
|
|
(apply 'user-error "Error at charater %d: %s" result)))))
|
|
|
|
|
2023-04-07 23:57:32 -04:00
|
|
|
(use-package xt-mouse :demand
|
|
|
|
:config
|
|
|
|
(xterm-mouse-mode 1))
|
|
|
|
|
2020-08-12 20:25:58 -04:00
|
|
|
;;;; external packages (required)
|
|
|
|
(use-package auto-package-update :ensure
|
2020-04-19 01:17:55 -04:00
|
|
|
:commands auto-package-update-cli
|
|
|
|
:config
|
2021-06-15 16:57:31 -04:00
|
|
|
(setq auto-package-update-delete-old-versions t)
|
2020-04-19 01:17:55 -04:00
|
|
|
;; wrap apu-now to print to stdout for batch calling
|
|
|
|
(defun auto-package-update-cli ()
|
|
|
|
(cl-letf (((symbol-function 'apu--write-results-buffer) 'princ))
|
|
|
|
(auto-package-update-now))))
|
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package delight :ensure :demand)
|
2018-11-30 13:43:00 -05:00
|
|
|
|
2018-11-09 11:39:58 -05:00
|
|
|
(use-package company :ensure :demand
|
2018-11-30 13:43:00 -05:00
|
|
|
:delight
|
2018-11-09 11:39:58 -05:00
|
|
|
:bind ("<C-tab>" . company-manual-begin)
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
|
|
|
(global-company-mode)
|
|
|
|
(setq company-idle-delay 0.1
|
2018-11-09 11:39:58 -05:00
|
|
|
company-dabbrev-downcase nil
|
|
|
|
company-dabbrev-ignore-case nil)
|
|
|
|
|
|
|
|
|
2020-08-12 20:31:05 -04:00
|
|
|
(use-package company-statistics
|
|
|
|
:config
|
|
|
|
(company-statistics-mode))
|
|
|
|
|
2018-11-09 11:39:58 -05:00
|
|
|
(use-package company-c-headers
|
|
|
|
:config
|
|
|
|
(add-to-list 'company-backends 'company-c-headers))
|
2020-08-12 20:31:05 -04:00
|
|
|
|
2020-08-12 20:34:34 -04:00
|
|
|
(use-package company-ansible
|
|
|
|
:config
|
|
|
|
(add-to-list 'company-backends 'company-ansible))
|
|
|
|
|
2020-08-12 20:31:05 -04:00
|
|
|
(use-package company-auctex
|
2018-11-09 11:39:58 -05:00
|
|
|
:config
|
2020-08-12 20:31:05 -04:00
|
|
|
(company-auctex-init)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package smart-mode-line :ensure :demand
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
|
|
|
(setq sml/no-confirm-load-theme t)
|
|
|
|
(sml/setup)
|
|
|
|
(sml/apply-theme 'respectful)
|
2017-04-21 14:44:42 -04:00
|
|
|
(setq sml/replacer-regexp-list '(("^~/\\.dotfiles/" ":dots:")
|
|
|
|
("^:dots:emacs/\\.emacs\\.d/" ":ED:")
|
|
|
|
("^~/Documents/" ":Doc:")
|
|
|
|
("^~/Programs/" ":Prog:")
|
|
|
|
("^:Doc:WPI/" ":WPI:")
|
|
|
|
("^/sshx:ccc:" ">ccc:")
|
2018-11-30 13:43:00 -05:00
|
|
|
("^>ccc:/home/asgoldsmith" ":>ccc:~"))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package avy :ensure
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
|
|
|
(eval-after-load "isearch"
|
2018-11-06 12:10:47 -05:00
|
|
|
'(bind-key "C-'" 'avy-isearch isearch-mode-map))
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (("C-;" . avy-goto-char)
|
|
|
|
("C-'" . avy-goto-char-2)))
|
2016-01-20 21:38:08 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package smex :ensure
|
2016-03-02 13:18:52 -05:00
|
|
|
:bind ("M-X" . smex-major-mode-commands))
|
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package swiper :ensure
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (("C-s" . swiper)
|
|
|
|
("C-r" . swiper)
|
|
|
|
("C-c C-r" . ivy-resume)
|
2018-11-30 13:43:00 -05:00
|
|
|
:map swiper-map (("C-r" . ivy-previous-line-or-history)
|
|
|
|
("M-," . swiper-mc))
|
2017-06-23 12:22:47 -04:00
|
|
|
:map ivy-minibuffer-map ("C-'" . ivy-avy))
|
2016-03-02 02:08:41 -05:00
|
|
|
:init
|
2017-04-09 17:14:47 -04:00
|
|
|
(bind-key "C-S-s" 'isearch-forward)
|
|
|
|
(bind-key "C-S-r" 'isearch-backward)
|
2016-03-02 02:15:30 -05:00
|
|
|
:config
|
2018-11-30 13:43:00 -05:00
|
|
|
(use-package ivy :ensure
|
|
|
|
:delight
|
|
|
|
:config
|
|
|
|
(ivy-mode 1))
|
2020-05-23 15:39:01 -04:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package ivy-hydra :ensure)
|
|
|
|
|
2017-06-07 13:23:04 -04:00
|
|
|
(defun ivy-backward-delete-char ()
|
|
|
|
"Forward to `backward-delete-char'.
|
|
|
|
Do less dumb things with directories
|
|
|
|
On error (read-only), call `ivy-on-del-error-function'."
|
|
|
|
(interactive)
|
|
|
|
(if (and ivy--directory (= (minibuffer-prompt-end) (point)))
|
|
|
|
(progn
|
|
|
|
(let ((old-dir (file-name-nondirectory
|
|
|
|
(directory-file-name
|
|
|
|
(expand-file-name
|
|
|
|
ivy--directory)))))
|
|
|
|
(ivy--cd (file-name-directory
|
|
|
|
(directory-file-name
|
|
|
|
(expand-file-name
|
|
|
|
ivy--directory))))
|
|
|
|
(insert old-dir))
|
|
|
|
(ivy--exhibit))
|
|
|
|
(condition-case nil
|
|
|
|
(backward-delete-char 1)
|
|
|
|
(error
|
|
|
|
(when ivy-on-del-error-function
|
2017-06-23 12:22:47 -04:00
|
|
|
(funcall ivy-on-del-error-function)))))))
|
2016-03-02 02:08:41 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package counsel :ensure
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (("M-x" . counsel-M-x)
|
|
|
|
("C-M-y" . counsel-yank-pop)
|
2017-06-23 12:22:47 -04:00
|
|
|
("C-x C-f" . counsel-find-file)
|
2017-12-15 00:44:58 -05:00
|
|
|
:map counsel-find-file-map (("C-M-i" . counsel-find-file-edit-path)
|
|
|
|
("C-DEL" . ivy-backward-kill-word)
|
|
|
|
("C-<backspace>" . ivy-backward-kill-word)
|
|
|
|
("M-DEL" . counsel-up-directory)
|
2020-04-02 15:33:18 -04:00
|
|
|
("M-<backspace>" . counsel-up-directory))
|
|
|
|
:map comint-mode-map (("C-s" . counsel-shell-history)
|
|
|
|
("C-r" . counsel-shell-history)
|
|
|
|
("M-s" . swiper)
|
|
|
|
("M-r" . swiper)))
|
2017-04-09 17:14:47 -04:00
|
|
|
:init
|
|
|
|
(bind-key "C-c C-c M-x" 'execute-extended-command) ;;normal M-x.
|
2016-01-20 21:38:08 -05:00
|
|
|
:config
|
2020-07-12 16:58:48 -04:00
|
|
|
(setq ivy-extra-directories nil
|
2021-07-22 17:23:53 -04:00
|
|
|
counsel-preselect-current-file t
|
|
|
|
;; ignore "Dotfiles and Lockfiles" by default
|
|
|
|
counsel-find-file-ignore-regexp "\\(?:\\`\\|[/\\]\\)\\(?:[#.]\\)")
|
2017-06-23 12:22:47 -04:00
|
|
|
(assq-delete-all 'counsel-M-x ivy-initial-inputs-alist)
|
|
|
|
|
|
|
|
(defun counsel-find-file-edit-path ()
|
|
|
|
"Edit the current path in ivy find-file"
|
|
|
|
(interactive)
|
|
|
|
(let ((old-path
|
|
|
|
(substring (concat (expand-file-name ivy--directory) ivy-text) 1 -1)))
|
|
|
|
(ivy--cd "/")
|
|
|
|
(insert old-path))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package ace-window :ensure
|
2018-08-23 23:54:29 -04:00
|
|
|
:bind ("M-S-p" . ace-window))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package undo-tree :ensure :demand
|
2018-11-30 13:43:00 -05:00
|
|
|
:delight
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
2017-04-09 17:14:47 -04:00
|
|
|
(bind-key "M-/" 'undo-tree-visualize)
|
2018-10-28 21:14:11 -04:00
|
|
|
(global-undo-tree-mode)
|
2022-03-14 01:31:05 -04:00
|
|
|
(setq undo-tree-enable-undo-in-region nil
|
|
|
|
undo-tree-history-directory-alist
|
|
|
|
`(("." . ,(concat user-emacs-directory "undo-tree-hist")))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2019-08-13 15:42:18 -04:00
|
|
|
(use-package hydra :ensure :demand
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
|
|
|
;config is in separate file because it is really big
|
2019-06-15 17:31:47 -04:00
|
|
|
(load-file "~/.emacs.d/hydra-defs.el")
|
2017-12-15 00:45:28 -05:00
|
|
|
:bind (("C-c w" . 'hydra-window/body)
|
|
|
|
("C-c s" . 'hydra-shortcuts/body)
|
|
|
|
("C-c a" . 'hydra-avy/body)
|
2019-02-06 00:20:57 -05:00
|
|
|
("C-c c" . 'hydra-mc-manual/body)
|
|
|
|
("C-^" . 'hydra-smerge/body))
|
|
|
|
:bind* ("C-," . 'hydra-mc/body)) ; I like my binding, stop messing with it
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2019-08-13 15:42:18 -04:00
|
|
|
(use-package multiple-cursors :ensure :demand)
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package expand-region :ensure
|
2015-09-28 19:18:26 -04:00
|
|
|
:bind ("C-=" . er/expand-region))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package magit :ensure
|
2018-12-30 06:25:26 -05:00
|
|
|
:bind (("C-x g" . magit-status)
|
2019-03-02 13:50:34 -05:00
|
|
|
(:map magit-status-mode-map (("i" . magit-gitignore-in-topdir)
|
2020-06-01 00:18:51 -04:00
|
|
|
("I" . magit-gitignore-in-gitdir))))
|
2020-07-12 17:00:20 -04:00
|
|
|
:init
|
2020-06-01 00:18:51 -04:00
|
|
|
(defun magit-status-no-new-window (directory)
|
|
|
|
(interactive "D")
|
2020-08-04 20:55:03 -04:00
|
|
|
(let ((magit-display-buffer-function
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda (buffer)
|
|
|
|
(display-buffer buffer '(display-buffer-same-window))))
|
2020-08-04 20:55:03 -04:00
|
|
|
(default-directory directory))
|
2021-05-26 00:49:51 -04:00
|
|
|
(magit-status)))
|
|
|
|
:config
|
2023-03-27 20:01:49 -04:00
|
|
|
(setq magit-bury-buffer-function 'magit-mode-quit-window
|
|
|
|
magit-diff-refine-hunk t)
|
2022-01-31 23:43:40 -05:00
|
|
|
|
|
|
|
(use-package magit-todos :demand :if (package-installed-p 'magit-todos)
|
|
|
|
:config
|
|
|
|
(magit-todos-mode)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-09-19 23:52:15 -04:00
|
|
|
(use-package popwin :ensure
|
2018-03-15 01:18:38 -04:00
|
|
|
:disabled
|
2015-10-04 16:07:00 -04:00
|
|
|
:config
|
2017-09-02 18:18:15 -04:00
|
|
|
(popwin-mode 1)
|
|
|
|
(delete 'help-mode popwin:special-display-config)
|
|
|
|
(add-to-list 'popwin:special-display-config '(help-mode :stick t)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2018-06-22 00:49:03 -04:00
|
|
|
(use-package dired+
|
2020-09-09 01:27:47 -04:00
|
|
|
:quelpa (dired+ :fetcher github :repo "emacsmirror/dired-plus")
|
2015-10-10 12:53:33 -04:00
|
|
|
:init
|
|
|
|
(setq diredp-hide-details-initially-flag nil)
|
2015-10-07 15:09:37 -04:00
|
|
|
:config
|
2015-10-10 12:53:33 -04:00
|
|
|
(toggle-diredp-find-file-reuse-dir 1))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package column-enforce-mode :ensure :demand
|
2018-11-30 13:43:00 -05:00
|
|
|
:delight
|
2021-01-04 13:21:14 -05:00
|
|
|
:hook prog-mode
|
2017-10-02 04:17:43 -04:00
|
|
|
:config
|
2021-01-04 13:21:14 -05:00
|
|
|
(setq column-enforce-column 100))
|
2017-10-02 04:17:43 -04:00
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package immortal-scratch :ensure :demand
|
2018-02-20 15:45:08 -05:00
|
|
|
:config
|
|
|
|
(setq immortal-scratch-switch-to-respawned-scratch t)
|
|
|
|
(immortal-scratch-mode t))
|
|
|
|
|
2019-07-21 00:42:18 -04:00
|
|
|
(use-package frames-only-mode :ensure :demand
|
2018-03-15 01:18:38 -04:00
|
|
|
:config
|
2018-12-14 02:28:46 -05:00
|
|
|
; seems to need to be before mode init
|
|
|
|
(add-to-list 'frames-only-mode-use-window-functions 'undo-tree-visualize)
|
2020-04-07 12:11:30 -04:00
|
|
|
(setq server-raise-frame nil)
|
|
|
|
(defun x-focus-frame (FRAME &optional NOACTIVATE))
|
2018-03-15 01:18:38 -04:00
|
|
|
(frames-only-mode t)
|
2018-03-23 01:25:46 -04:00
|
|
|
(menu-bar-mode 0)
|
2021-01-04 13:13:32 -05:00
|
|
|
|
|
|
|
(defun split-window-below-i3 ()
|
|
|
|
"It's like `split-window-below', but uses i3 stuff when available"
|
|
|
|
(interactive)
|
|
|
|
(cond ((not (display-graphic-p)) (split-window-below))
|
|
|
|
((executable-find "i3")
|
|
|
|
(call-process "i3" nil nil nil "split v")
|
|
|
|
(make-frame))
|
|
|
|
(t (make-frame))))
|
|
|
|
|
|
|
|
(defun split-window-right-i3 ()
|
|
|
|
"It's like `split-window-right', but uses i3 stuff when available"
|
|
|
|
(interactive)
|
|
|
|
(cond ((not (display-graphic-p)) (split-window-right))
|
|
|
|
((executable-find "i3")
|
|
|
|
(call-process "i3" nil nil nil "split h")
|
|
|
|
(make-frame))
|
|
|
|
(t (make-frame))))
|
|
|
|
(bind-key "C-x 2" 'split-window-below-i3)
|
|
|
|
(bind-key "C-x 3" 'split-window-right-i3))
|
2018-03-15 01:18:38 -04:00
|
|
|
|
2018-08-23 23:54:29 -04:00
|
|
|
(use-package crux :ensure
|
|
|
|
:bind (("C-a" . crux-move-beginning-of-line)))
|
|
|
|
|
2019-02-19 01:55:33 -05:00
|
|
|
(use-package flycheck :ensure)
|
|
|
|
|
2021-05-07 18:08:47 -04:00
|
|
|
(use-package lsp-mode
|
2022-02-01 00:05:14 -05:00
|
|
|
:hook ((python-mode html-mode web-mode css-mode js2-mode typescript-mode java-mode rust-mode) . lsp)
|
2021-06-17 22:19:23 -04:00
|
|
|
:bind (:map lsp-mode-map ("C-M-z" . lsp-compile-in-root))
|
2018-05-03 17:37:54 -04:00
|
|
|
:config
|
2021-06-17 22:16:35 -04:00
|
|
|
(setq lsp-prefer-flymake nil
|
|
|
|
lsp-inhibit-message t
|
|
|
|
lsp-eldoc-render-all nil
|
|
|
|
lsp-pylsp-plugins-jedi-use-pyenv-environment t
|
|
|
|
lsp-pylsp-plugins-pycodestyle-enabled nil
|
|
|
|
lsp-pylsp-plugins-pydocstyle-enabled nil
|
|
|
|
lsp-pylsp-plugins-flake8-enabled t)
|
2018-09-13 22:19:27 -04:00
|
|
|
|
2022-02-12 10:43:51 -05:00
|
|
|
(when (executable-find "rust-analyzer")
|
|
|
|
(setq lsp-rust-server 'rust-analyzer))
|
|
|
|
|
2023-05-04 00:26:13 -04:00
|
|
|
(lsp-register-custom-settings
|
|
|
|
'(("pylsp.plugins.pyls_mypy.enabled" t t)
|
|
|
|
("pylsp.plugins.pyls_mypy.live_mode" nil t)
|
|
|
|
("pylsp.plugins.ruff.enabled" t t)))
|
|
|
|
|
|
|
|
|
2021-06-17 22:19:23 -04:00
|
|
|
(defun lsp-compile-in-root ()
|
|
|
|
"Do compilation in the root dir of a project"
|
|
|
|
(interactive)
|
|
|
|
(let ((default-directory (lsp-workspace-root)))
|
|
|
|
(call-interactively 'compile)))
|
|
|
|
|
2018-05-03 17:37:54 -04:00
|
|
|
(use-package lsp-ui :ensure
|
2018-10-04 15:02:11 -04:00
|
|
|
:bind (:map lsp-ui-mode-map
|
|
|
|
([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
|
|
|
|
([remap xref-find-references] . lsp-ui-peek-find-references))
|
2018-05-03 17:37:54 -04:00
|
|
|
:config
|
2018-09-13 22:19:27 -04:00
|
|
|
(setq lsp-ui-sideline-ignore-duplicate t
|
2021-05-26 00:51:23 -04:00
|
|
|
lsp-ui-doc-max-height 5
|
|
|
|
lsp-ui-doc-max-width 70
|
2018-12-12 11:58:36 -05:00
|
|
|
;; lsp-ui-sideline-update-mode 'point
|
2021-05-26 00:51:23 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
(defun adjust-lsp-ui-doc-frame-pos (orig-fun &rest args)
|
|
|
|
(let* ((y-position-in-window (nth 1 (pos-visible-in-window-p (point) nil t)))
|
|
|
|
(edges (window-absolute-body-pixel-edges))
|
|
|
|
(bottom-edge (- (nth 3 edges) (nth 1 edges)))
|
|
|
|
(lsp-ui-doc-max-height (/ (window-height) 5))
|
|
|
|
(lsp-ui-doc-position (if (< (/ (float y-position-in-window) bottom-edge) 0.5) 'bottom 'top)))
|
|
|
|
(when (lsp-ui-doc--get-frame)
|
|
|
|
(lsp-ui-doc--move-frame (lsp-ui-doc--get-frame)))
|
|
|
|
(apply orig-fun args)))
|
|
|
|
(advice-add 'lsp-ui-doc--display :around #'adjust-lsp-ui-doc-frame-pos))
|
2018-05-03 17:37:54 -04:00
|
|
|
|
2020-08-07 14:11:31 -04:00
|
|
|
(use-package lsp-java :demand :if (package-installed-p 'lsp-java)
|
2018-09-13 22:19:27 -04:00
|
|
|
:config
|
2018-12-12 11:58:36 -05:00
|
|
|
(setq lsp-java-save-action-organize-imports nil)))
|
2018-05-03 17:37:54 -04:00
|
|
|
|
2018-12-12 20:39:44 -05:00
|
|
|
(use-package highlight-indent-guides :ensure
|
|
|
|
:delight
|
|
|
|
:config
|
|
|
|
:hook (prog-mode . highlight-indent-guides-mode))
|
|
|
|
|
2019-09-09 11:06:20 -04:00
|
|
|
(use-package editorconfig :ensure t :demand
|
2019-01-15 22:13:55 -05:00
|
|
|
:delight
|
2019-01-15 21:27:44 -05:00
|
|
|
:config
|
|
|
|
(editorconfig-mode 1))
|
|
|
|
|
2019-05-30 00:40:05 -04:00
|
|
|
(use-package exec-path-from-shell :ensure
|
|
|
|
:if (memq window-system '(mac ns))
|
|
|
|
:config
|
|
|
|
(exec-path-from-shell-initialize))
|
|
|
|
|
2019-05-31 12:56:35 -04:00
|
|
|
(use-package helpful :ensure
|
|
|
|
:bind (("C-h f" . helpful-callable)
|
|
|
|
("C-h v" . helpful-variable)
|
|
|
|
("C-h k" . helpful-key)
|
|
|
|
("C-h C-c" . helpful-at-point)
|
|
|
|
("C-h F" . helpful-function)
|
|
|
|
("C-h C" . helpful-command)))
|
|
|
|
|
2015-10-07 14:16:41 -04:00
|
|
|
;;;; optional external packages
|
2015-08-16 21:32:07 -04:00
|
|
|
(use-package arduino-mode
|
|
|
|
:mode "\\.pde\\'"
|
|
|
|
:mode "\\.ino\\'")
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2017-02-24 01:11:33 -05:00
|
|
|
(use-package circe
|
|
|
|
:config
|
|
|
|
(setq circe-default-nick "ad1217"
|
|
|
|
circe-reduce-lurker-spam t)
|
|
|
|
(enable-circe-color-nicks)
|
|
|
|
(setq circe-network-options
|
|
|
|
'(("Freenode"
|
|
|
|
:tls t
|
|
|
|
:nick "ad1217"
|
|
|
|
:sasl-username "ad1217"
|
|
|
|
:sasl-password "ablablop"
|
2017-05-20 03:14:03 -04:00
|
|
|
:channels ("#emacs-circe" "#qutebrowser" "#archlinux" "##linux"))
|
2017-02-24 01:11:33 -05:00
|
|
|
("WPI"
|
|
|
|
:host "irc.wpiirc.net"
|
|
|
|
:port 9999
|
2017-05-20 03:14:03 -04:00
|
|
|
:use-tls t))
|
|
|
|
circe-default-part-message ""))
|
2017-02-24 01:11:33 -05:00
|
|
|
|
2016-03-01 15:16:49 -05:00
|
|
|
(use-package dtrt-indent
|
2018-11-30 13:43:00 -05:00
|
|
|
:delight
|
2016-03-01 15:16:49 -05:00
|
|
|
:config
|
2018-05-11 00:54:06 -04:00
|
|
|
(dtrt-indent-global-mode 1))
|
2016-03-01 15:16:49 -05:00
|
|
|
|
2018-08-23 23:57:52 -04:00
|
|
|
(use-package graphviz-dot-mode
|
|
|
|
:config
|
|
|
|
; don't auto-newline on semicolon
|
|
|
|
(defun electric-graphviz-dot-semi ()
|
|
|
|
"Terminate line and indent next line."
|
|
|
|
(interactive)
|
|
|
|
(insert ";")
|
|
|
|
(when (and graphviz-dot-auto-indent-on-semi
|
|
|
|
(not (graphviz-dot-comment-or-string-p)))
|
|
|
|
(save-excursion
|
|
|
|
(beginning-of-line)
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
(graphviz-dot-indent-line))
|
|
|
|
(delete-horizontal-space))))
|
|
|
|
|
2015-08-16 21:32:07 -04:00
|
|
|
(use-package gnuplot-mode
|
|
|
|
:mode ("\\.gp$" . gnuplot-mode))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-08-16 21:32:07 -04:00
|
|
|
(use-package markdown-mode
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (:map markdown-mode-map
|
|
|
|
("<tab>" . markdown-demote)
|
|
|
|
("S-<tab>" . markdown-promote))
|
2020-03-25 01:46:14 -04:00
|
|
|
:mode "\\.md\\'"
|
|
|
|
:config
|
|
|
|
(setq markdown-command "markdown_py -x markdown.extensions.wikilinks -x markdown.extensions.smarty -x markdown.extensions.extra -x latex -x markdown.extensions.sane_lists -x markdown.extensions.toc -x markdown_checklist.extension -c ~/.emacs.d/markdownConfig.yml"
|
|
|
|
markdown-enable-math t)
|
|
|
|
(use-package grip-mode
|
|
|
|
:bind (:map markdown-mode-command-map ("g" . grip-mode))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-03-01 15:11:53 -05:00
|
|
|
(use-package projectile
|
2018-09-02 19:23:36 -04:00
|
|
|
:bind (:map projectile-mode-map (("C-S-z" . projectile-compile-project)
|
|
|
|
("C-c p" . projectile-command-map)))
|
2018-11-30 13:43:00 -05:00
|
|
|
:delight '(:eval (if (file-remote-p default-directory)
|
|
|
|
" P"
|
|
|
|
(format " P[%s]" (projectile-project-name))))
|
2016-03-01 15:11:53 -05:00
|
|
|
:config
|
2018-09-02 19:27:50 -04:00
|
|
|
(use-package counsel-projectile :ensure))
|
2016-03-01 15:11:53 -05:00
|
|
|
|
2015-08-25 12:04:23 -04:00
|
|
|
(use-package scad-mode
|
2015-11-17 16:12:47 -05:00
|
|
|
:mode "\\.scad$"
|
|
|
|
:config
|
|
|
|
(defun scad-compile (ext)
|
2015-11-19 16:24:55 -05:00
|
|
|
"Compile current buffer using 'scad-command' and the extention 'ext'"
|
|
|
|
(interactive (list (completing-read "Extension: " '("stl" "off" "amf" "dxf" "svg" "csg" "png"))))
|
2022-10-07 14:55:45 -04:00
|
|
|
(compile (combine-and-quote-strings
|
|
|
|
`(,scad-command "-o" ,(file-name-with-extension buffer-file-name ext) ,buffer-file-name))))
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (:map scad-mode-map ("C-c z" . scad-compile)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-10-10 13:59:54 -04:00
|
|
|
(use-package smart-tabs-mode
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
|
|
|
(smart-tabs-insinuate 'c 'c++ 'javascript))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-08-16 21:32:07 -04:00
|
|
|
(use-package todotxt-mode
|
2017-04-21 14:31:58 -04:00
|
|
|
:commands (todotxt-open-file todotxt-mode)
|
|
|
|
:bind ("C-c t" . todotxt-open-file)
|
|
|
|
:init
|
|
|
|
(setq todotxt-base-path (expand-file-name "~/Documents/todo")
|
|
|
|
todotxt-default-file (concat todotxt-base-path "/todo.txt")
|
|
|
|
todotxt-default-archive-file (concat todotxt-base-path "/done.txt"))
|
|
|
|
(add-to-list 'auto-mode-alist `(,(concat todotxt-base-path "/.*\\.txt$") . todotxt-mode))
|
2015-08-16 21:32:07 -04:00
|
|
|
:config
|
2017-04-21 14:31:58 -04:00
|
|
|
(setq todotxt-due-tag "due"
|
2015-11-19 16:24:55 -05:00
|
|
|
todotxt-mode-keywords
|
|
|
|
'(("^x .*$" 0 '(:foreground "gray80" :strike-through t))
|
|
|
|
("^(A) " 0 '(:foreground "red"))
|
|
|
|
("^(B) " 0 '(:foreground "orange"))
|
|
|
|
("^(C) " 0 '(:foreground "teal"))
|
|
|
|
("^(D) " 0 '(:foreground "light green"))
|
|
|
|
("^(Y) " 0 '(:foreground "light grey"))
|
|
|
|
("([A-Z]+)" . font-lock-builtin-face)
|
|
|
|
("\\([a-zA-Z0-9_-]+\\):\\([a-zA-Z0-9._-]+\\)" . font-lock-variable-name-face)
|
|
|
|
("+\\w+" . font-lock-function-name-face)
|
|
|
|
("@\\w+" . font-lock-type-face)
|
|
|
|
("#important" 0 '(:foreground "orange red")) ; special tag
|
|
|
|
("#waiting" 0 '(:foreground "dark orange")) ; special tag
|
|
|
|
("#\\w+" . font-lock-comment-face)
|
|
|
|
("-\\([a-zA-Z_-]+\\)" . font-lock-variable-name-face)
|
2017-04-21 14:31:58 -04:00
|
|
|
("^[0-9]+-[0-9]+-[0-9]+" 0 '(:foreground "gray90"))))
|
|
|
|
(defun todotxt-open-sub ()
|
|
|
|
"Opens the todotxt sub on current line"
|
|
|
|
(interactive)
|
|
|
|
(let ((line (thing-at-point 'line t)))
|
|
|
|
(string-match "\\([^ ]+\\)/:\\([.A-Za-z0-9_]+\\)" line)
|
|
|
|
(find-file (concat (match-string 1 line) "/" (match-string 2 line))))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-10-10 14:16:56 -04:00
|
|
|
(use-package latex
|
2018-11-30 13:46:53 -05:00
|
|
|
:defer
|
2017-04-09 17:14:47 -04:00
|
|
|
:bind (:map LaTeX-mode-map
|
|
|
|
("C-z" . latex-save-and-compile)
|
|
|
|
("C-c e" . tex-close-latex-block))
|
2015-08-29 13:43:41 -04:00
|
|
|
:config
|
2016-03-01 15:24:54 -05:00
|
|
|
(setq-default TeX-command-extra-options "-shell-escape")
|
2016-03-01 15:26:21 -05:00
|
|
|
(defun latex-save-and-compile ()
|
2019-05-30 00:41:02 -04:00
|
|
|
"Pretty much what it says on the tin"
|
2016-03-01 15:26:21 -05:00
|
|
|
(interactive)
|
|
|
|
(save-buffer)
|
|
|
|
(TeX-command "LaTeX" 'TeX-master-file -1))
|
2015-10-10 14:17:46 -04:00
|
|
|
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
|
2015-10-04 16:09:42 -04:00
|
|
|
(defun latex-tsv-to-table ()
|
2015-11-19 16:24:55 -05:00
|
|
|
"Converts tab-seperated-values to a LaTeX table."
|
|
|
|
(interactive)
|
|
|
|
(let ((beg (region-beginning)) (end-line (line-number-at-pos (region-end))))
|
|
|
|
(save-excursion
|
|
|
|
(goto-line end-line)
|
|
|
|
(indent-region beg (point-at-eol))
|
|
|
|
(replace-regexp "\t" " & " nil beg (point-at-eol))
|
|
|
|
(replace-regexp "$" " \\\\\\\\" nil beg (point-at-eol))
|
|
|
|
(align beg (point))))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2020-08-12 20:23:52 -04:00
|
|
|
(use-package fasd :if (package-installed-p 'fasd)
|
|
|
|
:bind ("C-x C-S-f" . fasd-find-file)
|
|
|
|
:init (global-fasd-mode 1)
|
2015-09-28 19:21:04 -04:00
|
|
|
:config
|
2016-02-29 13:38:18 -05:00
|
|
|
(setq fasd-enable-initial-prompt nil
|
|
|
|
fasd-completing-read-function 'ivy-completing-read))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2015-09-17 12:52:19 -04:00
|
|
|
(use-package yasnippet
|
2020-08-12 20:31:40 -04:00
|
|
|
:commands yas-minor-mode
|
2015-12-17 00:20:12 -05:00
|
|
|
:init
|
|
|
|
(add-hook 'LaTeX-mode-hook
|
2021-09-13 19:58:44 -04:00
|
|
|
(lambda ()
|
|
|
|
(yas-minor-mode)
|
|
|
|
(bind-key "<backtab>" 'company-to-yasnippet company-active-map)
|
|
|
|
(bind-key "<backtab>" 'company-yasnippet) (current-local-map)))
|
2015-09-17 12:52:19 -04:00
|
|
|
:config
|
2015-12-17 00:20:12 -05:00
|
|
|
(yas-reload-all)
|
2015-09-17 12:52:19 -04:00
|
|
|
(defun company-to-yasnippet ()
|
2015-11-19 16:24:55 -05:00
|
|
|
(interactive)
|
|
|
|
(company-abort)
|
2015-12-17 00:20:12 -05:00
|
|
|
(call-interactively 'company-yasnippet)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2021-01-04 13:25:28 -05:00
|
|
|
(use-package counsel-dash
|
2018-03-15 01:16:19 -04:00
|
|
|
:hook (python-mode . (lambda ()(setq-local helm-dash-docsets '("Python 3")))))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-01-19 10:02:29 -05:00
|
|
|
(use-package pkgbuild-mode
|
2019-07-17 22:10:09 -04:00
|
|
|
:bind (:map pkgbuild-mode-map ("C-c i" . pkgbuild-printsrcinfo))
|
2016-01-19 10:02:29 -05:00
|
|
|
:config
|
|
|
|
(setq pkgbuild-user-full-name "Adam Goldsmith"
|
2016-03-01 15:12:30 -05:00
|
|
|
pkgbuild-user-mail-address "contact@adamgoldsmith.name"
|
2019-07-17 22:10:09 -04:00
|
|
|
pkgbuild-makepkg-command "PKGEXT='.pkg.tar' makepkg -mf")
|
|
|
|
(defun pkgbuild-printsrcinfo ()
|
|
|
|
(interactive)
|
2021-01-04 13:22:01 -05:00
|
|
|
(shell-command "makepkg --printsrcinfo > .SRCINFO"))
|
|
|
|
(defun pkgbuild-update-sums-line ()
|
|
|
|
(interactive)
|
|
|
|
(shell-command "updpkgsums")
|
|
|
|
(pkgbuild-printsrcinfo)
|
|
|
|
(revert-buffer t t t)))
|
2016-01-20 21:33:32 -05:00
|
|
|
|
2016-03-01 15:23:17 -05:00
|
|
|
(use-package qml-mode
|
2018-11-09 11:39:58 -05:00
|
|
|
:mode "\\.qml\\'"
|
2018-05-11 00:53:20 -04:00
|
|
|
:config
|
2018-11-09 11:39:58 -05:00
|
|
|
(use-package company-qml
|
|
|
|
:config
|
|
|
|
(add-to-list 'company-backends 'company-qml)))
|
2018-05-11 00:53:20 -04:00
|
|
|
|
2016-11-03 23:00:44 -04:00
|
|
|
(use-package jdee
|
|
|
|
:defer
|
|
|
|
:config
|
|
|
|
(setq jdee-server-dir "~/.emacs.d/jdee-server/target"
|
|
|
|
jdee-mode-line-format mode-line-format))
|
|
|
|
|
2017-09-10 03:06:26 -04:00
|
|
|
(use-package web-mode
|
|
|
|
:mode "\\.html?\\'"
|
2018-08-28 21:53:06 -04:00
|
|
|
:mode "\\.vue?\\'"
|
2021-01-04 13:26:15 -05:00
|
|
|
:mode "\\.dtl?\\'"
|
|
|
|
:mode "\\.djhtml?\\'"
|
2020-08-12 20:39:07 -04:00
|
|
|
:bind (:map web-mode-map
|
|
|
|
("M-<return>" . web-mode-comment-indent-new-line))
|
2017-09-10 03:06:26 -04:00
|
|
|
:config
|
2019-01-15 21:27:27 -05:00
|
|
|
(add-to-list 'web-mode-indentation-params '("lineup-calls" . nil))
|
2020-03-25 01:43:11 -04:00
|
|
|
(setq-default web-mode-markup-indent-offset 2
|
|
|
|
web-mode-css-indent-offset 2
|
|
|
|
web-mode-code-indent-offset 2
|
|
|
|
web-mode-script-padding nil
|
2020-04-14 03:20:34 -04:00
|
|
|
web-mode-style-padding nil
|
2020-08-12 20:38:27 -04:00
|
|
|
web-mode-enable-auto-indentation nil
|
2022-02-01 00:01:13 -05:00
|
|
|
web-mode-enable-comment-annotation t)
|
|
|
|
|
|
|
|
(let ((regexps (cdr (assoc "django" web-mode-engine-file-regexps))))
|
|
|
|
(unless (string-match-p "dj\\.html" regexps)
|
|
|
|
(push `("django" . ,(replace-regexp-in-string "djhtml" "dj\\\\.html\\\\|djhtml" regexps))
|
|
|
|
web-mode-engine-file-regexps))))
|
2017-09-10 03:06:26 -04:00
|
|
|
|
2019-02-06 00:24:06 -05:00
|
|
|
(use-package vue-mode
|
|
|
|
:config
|
|
|
|
(add-hook 'vue-mode-hook (lambda () (highlight-indent-guides-mode t)))
|
|
|
|
(set-face-background 'mmm-default-submode-face nil))
|
|
|
|
|
2017-09-10 03:06:26 -04:00
|
|
|
(use-package js2-mode
|
|
|
|
:mode "\\.js\\'"
|
|
|
|
:config
|
2018-11-06 12:05:25 -05:00
|
|
|
(setq js2-basic-offset 2)
|
|
|
|
(use-package js2-refactor
|
|
|
|
:hook (js2-mode . js2-refactor-mode)
|
|
|
|
:config
|
|
|
|
(js2r-add-keybindings-with-prefix "C-c C-m")))
|
2017-09-10 03:06:26 -04:00
|
|
|
|
2018-11-20 11:59:08 -05:00
|
|
|
(use-package nodejs-repl
|
|
|
|
:bind* (:map js2-mode-map
|
|
|
|
("C-x C-e" . nodejs-repl-send-last-expression)
|
|
|
|
("C-c C-r" . nodejs-repl-send-region)
|
|
|
|
("C-c C-l" . nodejs-repl-load-file)
|
|
|
|
("C-c C-z" . nodejs-repl-switch-to-repl)
|
|
|
|
("C-c C-c" . nodejs-repl-send-buffer))
|
|
|
|
:config
|
|
|
|
(unbind-key "C-c C-c" tern-mode-keymap))
|
|
|
|
|
2018-01-25 12:17:41 -05:00
|
|
|
(use-package nm
|
2021-05-07 18:09:33 -04:00
|
|
|
:if (executable-find "notmuch")
|
2018-12-02 22:44:02 -05:00
|
|
|
:quelpa (nm :fetcher github :repo "ad1217/nevermore")
|
2018-01-28 03:15:15 -05:00
|
|
|
:bind (:map nm-mode-map
|
|
|
|
("n" . nm-read)
|
2018-11-20 11:58:45 -05:00
|
|
|
("s" . nm-spam)
|
2019-11-24 09:59:43 -05:00
|
|
|
("G" . nm-update-remote-fast)
|
|
|
|
("C-G" . nm-update-remote)
|
|
|
|
("M-g" . nm-reset)
|
2018-11-20 11:59:08 -05:00
|
|
|
("j" . next-line)
|
2019-02-14 21:42:20 -05:00
|
|
|
("k" . previous-line)
|
|
|
|
("N" . nm-sticky-tag-and-next))
|
2018-01-25 12:17:41 -05:00
|
|
|
:config
|
2019-08-13 15:42:47 -04:00
|
|
|
|
2018-11-20 11:58:45 -05:00
|
|
|
(defun nm-tag-and-next (tags)
|
|
|
|
"Apply some changes to a message, then move to the next line"
|
|
|
|
(nm-apply-to-result (lambda (q) (notmuch-tag q tags)))
|
|
|
|
(nm-update-tags)
|
|
|
|
(forward-line))
|
2018-01-25 12:17:41 -05:00
|
|
|
(defun nm-read ()
|
|
|
|
"Mark message as read."
|
|
|
|
(interactive)
|
2018-11-20 11:58:45 -05:00
|
|
|
(nm-tag-and-next '("-unread")))
|
|
|
|
(defun nm-spam ()
|
|
|
|
"Mark message as read."
|
|
|
|
(interactive)
|
|
|
|
(nm-tag-and-next '("+spam" "-unread" "-inbox")))
|
2018-01-28 03:15:15 -05:00
|
|
|
(defun nm-update-remote ()
|
|
|
|
"Pull email from remote mailbox"
|
|
|
|
(interactive)
|
2019-04-15 09:50:54 -04:00
|
|
|
(shell-command "muchsync --upbg ag")
|
2018-02-20 15:48:51 -05:00
|
|
|
(nm-refresh))
|
2019-11-24 09:59:43 -05:00
|
|
|
(defun nm-update-remote-fast ()
|
|
|
|
"Pull email from remote mailbox"
|
|
|
|
(interactive)
|
|
|
|
(shell-command "muchsync --upbg ag --nonew")
|
|
|
|
(nm-refresh))
|
2019-02-14 21:42:20 -05:00
|
|
|
(defvar nm-sticky-tags nil)
|
|
|
|
(defun nm-sticky-tag-and-next (tags)
|
|
|
|
(interactive
|
|
|
|
(if (or current-prefix-arg (null nm-sticky-tags))
|
|
|
|
(list (notmuch-tag-change-list (split-string
|
|
|
|
(read-string
|
|
|
|
"tags: " (mapconcat 'identity nm-sticky-tags " ")))))
|
|
|
|
(list nm-sticky-tags)))
|
|
|
|
(setq nm-sticky-tags tags)
|
|
|
|
(nm-tag-and-next tags))
|
2018-11-20 12:08:50 -05:00
|
|
|
|
2018-03-15 01:18:05 -04:00
|
|
|
(setq message-kill-buffer-on-exit t
|
|
|
|
mail-host-address "adamgoldsmith.name"
|
|
|
|
mail-specify-envelope-from t
|
2018-02-20 15:48:51 -05:00
|
|
|
message-sendmail-envelope-from 'header
|
|
|
|
message-send-mail-function 'message-send-mail-with-sendmail
|
2019-02-19 01:56:28 -05:00
|
|
|
sendmail-program (executable-find "msmtp")
|
2020-02-25 00:10:42 -05:00
|
|
|
notmuch-fcc-dirs "Sent +sent"
|
|
|
|
message-forward-as-mime nil
|
|
|
|
message-make-forward-subject-function '(message-forward-subject-fwd)
|
|
|
|
))
|
2018-01-25 12:17:41 -05:00
|
|
|
|
2019-11-24 10:01:10 -05:00
|
|
|
(use-package fortune-cookie :demand :if (package-installed-p 'fortune-cookie)
|
2018-02-20 15:45:35 -05:00
|
|
|
:config
|
|
|
|
; change message every time scratch buffer created
|
|
|
|
(setq initial-major-mode
|
|
|
|
(lambda ()
|
|
|
|
(setq initial-scratch-message
|
|
|
|
(concat (fortune-cookie-comment
|
|
|
|
(fortune-cookie) fortune-cookie-comment-start) "\n\n"))
|
|
|
|
(lisp-interaction-mode))))
|
|
|
|
|
2018-05-11 00:56:17 -04:00
|
|
|
(use-package git-timemachine
|
|
|
|
:bind ("C-x M-g" . git-timemachine-toggle))
|
|
|
|
|
2018-09-02 19:27:32 -04:00
|
|
|
(use-package darkroom
|
|
|
|
:config
|
|
|
|
(setq darkroom-text-scale-increase 1
|
|
|
|
darkroom-margins .1))
|
|
|
|
|
2019-02-06 00:03:47 -05:00
|
|
|
(use-package rainbow-identifiers
|
|
|
|
:config
|
|
|
|
(setq rainbow-identifiers-choose-face-function 'rainbow-identifiers-cie-l*a*b*-choose-face
|
|
|
|
rainbow-identifiers-cie-l*a*b*-lightness 90
|
|
|
|
rainbow-identifiers-cie-l*a*b*-saturation 75))
|
|
|
|
|
2019-02-06 00:24:12 -05:00
|
|
|
(use-package atomic-chrome
|
|
|
|
:config
|
2019-02-20 15:15:06 -05:00
|
|
|
(atomic-chrome-start-server)
|
|
|
|
(setq atomic-chrome-url-major-mode-alist
|
|
|
|
'(("github\\.com" . markdown-mode)
|
|
|
|
("overleaf\\.com" . LaTeX-mode)
|
|
|
|
;; ("claremontmakerspace\\.org/\\(w\\|wiki\\)/" . mediawiki-mode)
|
|
|
|
("claremontmakerspace\\.org" . mediawiki-mode)
|
|
|
|
)))
|
2019-02-06 00:24:12 -05:00
|
|
|
|
2020-04-12 15:19:48 -04:00
|
|
|
(use-package which-key :demand :if (package-installed-p 'which-key)
|
2019-05-30 00:35:26 -04:00
|
|
|
:delight
|
2019-05-19 19:24:54 -04:00
|
|
|
:config
|
2019-05-30 00:35:26 -04:00
|
|
|
(which-key-mode)
|
2019-08-15 18:26:04 -04:00
|
|
|
(use-package which-key-posframe :ensure :demand
|
2019-05-30 00:35:26 -04:00
|
|
|
:config
|
2019-05-31 16:25:37 -04:00
|
|
|
(which-key-posframe-mode)
|
|
|
|
(set-face-background 'which-key-posframe "#333333")))
|
2019-05-19 19:24:54 -04:00
|
|
|
|
2020-04-12 15:19:29 -04:00
|
|
|
(use-package show-marks
|
|
|
|
:config
|
|
|
|
:bind ("C-S-<left>" . backward-mark)
|
|
|
|
:bind ("C-S-<right>" . forward-mark)
|
|
|
|
:bind ("C-S-<down>" . show-marks))
|
|
|
|
|
2020-04-14 21:37:48 -04:00
|
|
|
(use-package org-lookup-dnd
|
2021-05-07 18:28:39 -04:00
|
|
|
:if (file-exists-p "~/Documents/DnD/dnd-phb-5e-index/indexes.org")
|
2020-07-12 16:58:08 -04:00
|
|
|
:quelpa (org-lookup-dnd :fetcher gitlab :repo "ad1217/org-lookup-dnd" :branch "no-pdfview")
|
|
|
|
:bind (:map org-mode-map ("C-c d" . org-lookup-dnd-at-point))
|
2020-04-14 21:37:48 -04:00
|
|
|
:config
|
|
|
|
(setq org-lookup-dnd-chose 'org-lookup-dnd-chose-ivy
|
|
|
|
org-lookup-dnd-link-format "[[pdf:%s::%d][%s]]")
|
|
|
|
(setq org-lookup-dnd-sources t)
|
|
|
|
;; '(("~/Documents/DnD/Books/D&D 5E - Player's Handbook.pdf" 1 4 4)
|
|
|
|
;; ("~/Documents/DnD/Books/D&D 5E - Dungeon Master's Guide.pdf" 0 317 320)
|
|
|
|
;; ("~/Documents/DnD/Books/D&D 5E - Monster Manual.pdf" 1 352 353)))
|
|
|
|
(setq org-lookup-dnd-extra-index "~/Documents/DnD/dnd-phb-5e-index/indexes.org")
|
|
|
|
|
|
|
|
;; roughly org-lookup-dnd-parse, but without the pdf parsing
|
|
|
|
(setq org-lookup-dnd-db
|
|
|
|
(make-hash-table :test #'equal :size 256 :rehash-size 2.0 :rehash-threshold .97))
|
|
|
|
(org-lookup-dnd-parse-extras)
|
|
|
|
(org-lookup-dnd-dump-vars-to-file '(org-lookup-dnd-db) org-lookup-dnd-db-file))
|
|
|
|
|
2020-08-12 20:39:07 -04:00
|
|
|
(use-package typescript-mode
|
|
|
|
:bind (:map typescript-mode-map
|
|
|
|
("<M-return>" . c-indent-new-comment-line)))
|
|
|
|
|
2022-02-12 10:48:31 -05:00
|
|
|
(use-package rustic
|
|
|
|
:config
|
2023-01-01 22:10:24 -05:00
|
|
|
(setq rustic-format-on-save t
|
|
|
|
rustic-format-display-method 'ignore))
|
2022-02-12 10:48:31 -05:00
|
|
|
|
2022-02-18 01:18:24 -05:00
|
|
|
(use-package git-gutter :demand :if (package-installed-p 'git-gutter)
|
|
|
|
:delight
|
|
|
|
:config
|
|
|
|
(global-git-gutter-mode t)
|
2022-03-14 01:31:35 -04:00
|
|
|
(setq git-gutter:update-interval 0.2)
|
2023-01-01 22:04:30 -05:00
|
|
|
|
|
|
|
;; Disable git-gutter on remote files
|
|
|
|
(defun git-gutter--turn-on ()
|
|
|
|
(when (and (buffer-file-name)
|
|
|
|
(not (memq major-mode git-gutter:disabled-modes))
|
|
|
|
(not (file-remote-p (buffer-file-name))))
|
|
|
|
(git-gutter-mode +1)))
|
|
|
|
|
2022-02-18 01:18:24 -05:00
|
|
|
(use-package git-gutter-fringe :ensure :demand
|
|
|
|
:config
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:added [224] nil nil '(center repeated))
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:modified [224] nil nil '(center repeated))
|
|
|
|
(define-fringe-bitmap 'git-gutter-fr:deleted [224] nil nil '(center repeated))))
|
|
|
|
|
2023-05-04 00:24:50 -04:00
|
|
|
(use-package apheleia :demand :if (package-installed-p 'apheleia)
|
|
|
|
:config
|
|
|
|
(setf (alist-get 'djlint apheleia-formatters) '("djlint" "--reformat" "-"))
|
|
|
|
(setf (alist-get "\\.dj\\.html$" apheleia-mode-alist) '(djlint))
|
|
|
|
|
|
|
|
(defun apheleia--pyproject-contains-section (section)
|
|
|
|
(when-let (parent (locate-dominating-file default-directory "pyproject.toml"))
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents (concat parent "pyproject.toml"))
|
|
|
|
(re-search-forward (concat "^\\[" section "\\]$") nil t 1))))
|
|
|
|
|
|
|
|
(defun apheleia--check-formatter-configured ()
|
|
|
|
"Disable apheleia when a formatter's configuration does not exist"
|
|
|
|
(not (let ((formatters (apheleia--get-formatters)))
|
|
|
|
(cond
|
|
|
|
((member 'black formatters) (apheleia--pyproject-contains-section "tool.black"))
|
|
|
|
((member 'djlint formatters) (apheleia--pyproject-contains-section "tool.djlint"))
|
2023-05-04 20:37:02 -04:00
|
|
|
((seq-some (lambda (f) (string-prefix-p "prettier" (symbol-name f))) formatters)
|
2023-05-04 20:12:56 -04:00
|
|
|
(when (= 0 (call-process "prettier" nil nil nil "--find-config-path" (buffer-file-name)))
|
|
|
|
(let* ((config-file (shell-command-to-string (concat "prettier --find-config-path " (buffer-file-name))))
|
|
|
|
(default-directory (file-name-directory (expand-file-name config-file)))
|
|
|
|
(file-info (shell-command-to-string (concat "prettier --file-info " (buffer-file-name))))
|
|
|
|
(file-ignored (gethash "ignored" (json-parse-string file-info))))
|
|
|
|
(eq file-ignored :false))))))))
|
2023-05-04 00:24:50 -04:00
|
|
|
|
|
|
|
(add-to-list 'apheleia-inhibit-functions 'apheleia--check-formatter-configured)
|
|
|
|
|
|
|
|
(apheleia-global-mode t))
|
|
|
|
|
2023-06-02 15:16:51 -04:00
|
|
|
(use-package smali-mode
|
|
|
|
:quelpa (smali-mode :fetcher github :repo "strazzere/Emacs-Smali")
|
|
|
|
:if (package-installed-p 'smali-mode)
|
|
|
|
:autoload smali-mode
|
|
|
|
:mode "\\.smali\\'")
|
|
|
|
|
2015-10-07 15:07:33 -04:00
|
|
|
;;; Local Variables
|
2015-10-10 14:23:44 -04:00
|
|
|
(add-to-list 'safe-local-eval-forms '(outline-hide-body))
|
2015-10-07 15:07:33 -04:00
|
|
|
;; Local Variables:
|
2015-11-19 16:26:59 -05:00
|
|
|
;; indent-tabs-mode: nil
|
2015-10-07 15:07:33 -04:00
|
|
|
;; eval: (outline-minor-mode)
|
|
|
|
;; eval: (outline-hide-body)
|
|
|
|
;; End:
|