Compare commits

...

5 Commits

2 changed files with 32 additions and 58 deletions

View File

@ -354,3 +354,21 @@
;; (add-to-list 'page-break-lines-modes 'prog-mode)
;; (add-to-list 'page-break-lines-modes 'text-mode)
;; (add-to-list 'page-break-lines-modes 'helpful-mode))
;; (use-package js-comint
;; :bind (:map js-ts-mode-map
;; ("C-x C-e" . js-send-last-sexp)
;; ("C-c C-b" . js-send-buffer)
;; ("C-c C-r" . js-send-region)
;; ("C-M-x" . my/js-send-defun))
;; :hook (js-comint-mode . my/-setup-js-comint-mode)
;; :config
;; (my/setup-c-style-newline-keys js-ts-mode-map)
;; (defun my/-setup-js-comint-mode ()
;; (setq-local comint-highlight-input nil))
;; (defun my/js-send-defun ()
;; "Send the defun under point to the inferior JavaScript process."
;; (interactive)
;; (if-let ((code (thing-at-point 'defun)))
;; (js-comint-send-string code)
;; (user-error "No defun under point"))))

72
init.el
View File

@ -81,10 +81,15 @@
(describe-symbol form))))
;; Trusted buffer stuff
(defvar-local my/-trusted-content-segment-cache nil
"Cache variable used in my/-trusted-content-segment.
This is a single element list with that element being the file's trusted status.")
(defun my/temp-trust-buffer ()
"Set the current buffers local value of `trusted-content' to \\=:all."
(interactive)
(setq-local trusted-content :all)
(setq-local trusted-content :all
;; reset the cache
my/-trusted-content-segment-cache nil)
(cond
((and (buffer-modified-p) (y-or-n-p "Save and reload buffer?"))
(save-buffer)
@ -100,7 +105,11 @@
(equal trusted-content :all)
buffer-file-name)
(propertize "[Temp. Trusted]" 'face 'warning))
((not (trusted-content-p))
((progn
(unless my/-trusted-content-segment-cache
(setq-local my/-trusted-content-segment-cache
(list (trusted-content-p))))
(not (car my/-trusted-content-segment-cache)))
(propertize "[Untrusted]" 'face 'error)))))
(add-to-list 'mode-line-misc-info
'(:eval (my/-trusted-content-segment)))
@ -214,6 +223,7 @@
"socket" "slice" "mount")
eos)
. conf-mode))
(add-to-list 'auto-mode-alist `(,(rx (or bos "/") "README" eos) . markdown-mode))
(keymap-set emacs-lisp-mode-map "C-c C-r" #'eval-region)
(defun my/-fix-emacs-lisp-mode-system-files ()
(when (string-prefix-p lisp-directory buffer-file-name)
@ -967,12 +977,6 @@ visual states."
(cl-pushnew "Replace" val :test 'equal)
(setopt minibuffer-regexp-prompts val)))
;; better `align-regexp'
(use-package ialign
:defer t
:custom
(ialign-initial-repeat t))
;; ace-window
(use-package ace-window
:diminish ace-window-mode
@ -2008,23 +2012,6 @@ This is :around advice, so OLDFUN is the real function
(use-package js
:ensure nil
:hook (js-ts-mode . my/eglot-if-trusted))
(use-package js-comint
:bind (:map js-ts-mode-map
("C-x C-e" . js-send-last-sexp)
("C-c C-b" . js-send-buffer)
("C-c C-r" . js-send-region)
("C-M-x" . my/js-send-defun))
:hook (js-comint-mode . my/-setup-js-comint-mode)
:config
(my/setup-c-style-newline-keys js-ts-mode-map)
(defun my/-setup-js-comint-mode ()
(setq-local comint-highlight-input nil))
(defun my/js-send-defun ()
"Send the defun under point to the inferior JavaScript process."
(interactive)
(if-let ((code (thing-at-point 'defun)))
(js-comint-send-string code)
(user-error "No defun under point"))))
;; TypeScript
(use-package typescript-ts-mode
@ -2035,22 +2022,6 @@ This is :around advice, so OLDFUN is the real function
:config
(my/setup-c-style-newline-keys typescript-ts-mode-map))
;; Polymode
(use-package polymode
:config
(define-hostmode my/poly-web-hostmode
:mode 'web-mode)
(define-innermode my/poly-php-innermode
:mode 'php-ts-mode
:head-matcher (regexp-quote "<?php")
:tail-matcher (regexp-quote "?>")
:head-mode 'body
:tail-mode 'body)
(define-polymode my/poly-web-mode
:hostmode 'my/poly-web-hostmode
:innermodes '(my/poly-php-innermode))
(add-to-list 'auto-mode-alist '("\\.php\\|\\.phtml\\'" . my/poly-web-mode)))
;; shell-mode
(use-package sh-script
:ensure nil
@ -2129,9 +2100,6 @@ This is :around advice, so OLDFUN is the real function
(setq indent-line-function #'yaml-indent-line)))
(use-package yaml-mode)
;; yuck (config language for eww)
(use-package yuck-mode)
;; Some Elisp indentation stuff
;; Source: https://github.com/magit/emacsql
;; emacsql.el line 394
@ -2496,6 +2464,7 @@ current buffer is a Jupyter buffer, just use that."
(use-package doc-view
:ensure nil
:hook (doc-view-mode . my/-setup-doc-view-mode)
:custom (doc-view-odf->pdf-converter-program "/usr/bin/soffice")
:init
(defun my/-setup-doc-view-mode ()
(display-line-numbers-mode -1)
@ -2877,13 +2846,6 @@ If no name is given, list all bookmarks instead."
(list (car entry)))))
(directory-files-and-attributes dir-path))
path-end))))))))
(use-package esh-help
:hook (eshell-mode . my/-setup-eshell-help-func)
:init
(defun my/-setup-eshell-help-func ()
(eldoc-mode 1)
(setq-local evil-lookup-func #'esh-help-run-help))
(setup-esh-help-eldoc))
(use-package eshell-syntax-highlighting
:init
(eshell-syntax-highlighting-global-mode 1))
@ -3162,8 +3124,6 @@ R is rest of the arguments to OLDFUN."
;; ledger
(use-package ledger-mode)
(use-package flycheck-ledger
:hook (ledger-mode . my/flycheck-if-trusted))
;; khard contacts
(require 'khard)
@ -3507,7 +3467,7 @@ Color can be any color which can be passed to `color-values'."
;; rainbow-delimiters
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode)
:hook (lisp-data-mode . rainbow-delimiters-mode)
:config
;; generate dark version of the rainbow delimiters faces
(defun my/-rainbow-delimiters-recalc-dark-faces (&optional frame)
@ -3585,10 +3545,6 @@ one of the normal rainbow-delimiters-depth-N-face faces."
;; Highlight todos
(use-package hl-todo
:hook (prog-mode . hl-todo-mode))
(use-package magit-todos
:after (hl-todo magit)
:config
(magit-todos-mode 1))
;; icons
(use-package nerd-icons)