Random stuff

This commit is contained in:
Case Duckworth 2022-01-31 00:54:53 -06:00
parent 90e13f3aac
commit 195618bcf3
3 changed files with 31 additions and 6 deletions

13
init.el
View File

@ -186,7 +186,7 @@
(seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos)
;; music
"soundcloud.com" "bandcamp.com"
(seq "." (or "ogg" "mp3") eos)))
(seq "." (or "ogg" "mp3" "opus" "m4a") eos)))
(lambda (&rest args)
(apply (if (executable-find "mpv")
#'+browse-url-with-mpv
@ -302,7 +302,10 @@
eshell-scroll-to-bottom-on-input 'all
eshell-smart-space-goes-to-end t
eshell-where-to-jump 'begin
eshell-banner-message "")
eshell-banner-message ""
eshell-prompt-regexp (rx bol (* (not (any ?# ?$ ?\n)))
" " (any ?# ?$)
(* " ")))
(with-eval-after-load 'mwim
(setf (alist-get 'eshell-mode mwim-beginning-of-line-function)
#'eshell-bol))
@ -318,7 +321,7 @@
(concat eshell-prompt-regexp
"\\(.*\\)")
1))
truncate-lines t))
(cons 'truncate-lines t)))
(set (make-local-variable (car setting)) (cdr setting)))
;; Bind keys
(dolist (binding '(("C-d" . +eshell-quit-or-delete-char)))
@ -1442,8 +1445,8 @@ See also `crux-reopen-as-root-mode'."
(setup (:straight macrostep)
(:require macrostep)
(:with-mode emacs-lisp-mode
(:bind "C-c e" #'macrostep-expand)))
(:bind-into (emacs-lisp-mode lisp-interaction-mode)
"C-c e" #'macrostep-expand))
(setup (:straight (magit :host github :repo "magit/magit")))

View File

@ -29,7 +29,12 @@ any directory proferred by `consult-dir'."
"Delete the character to the right, or quit eshell on an empty line."
(interactive "p")
(if (and (eolp) (looking-back eshell-prompt-regexp))
(eshell-life-is-too-much)
(progn (eshell-life-is-too-much)
(when (and (<= 1 (count-windows))
;; I'm guessing the extra frame is for the server?
(> (length (frame-list)) 2)
server-process)
(delete-frame)))
(delete-forward-char arg)))
;;; Insert previous arguments

View File

@ -94,5 +94,22 @@ replace itself with the RECIPE's package."
:indent 1
:shorthand #'+setup-straight-shorthand)
;;; Redefines of `setup' forms
(setup-define :bind-into
(lambda (feature-or-map &rest rest)
(cl-loop for f/m in (ensure-list feature-or-map)
collect (if (string-match-p "-map\\'" (symbol-name f/m))
`(:with-map ,f/m (:bind ,@rest))
`(:with-feature ,f/m (:bind ,@rest)))
into forms
finally return `(progn ,@forms)))
:documentation "Bind into keys into the map(s) of FEATURE-OR-MAP.
FEATURE-OR-MAP can be a feature or map name or a list of them.
The arguments REST are handled as by `:bind'."
:debug '(sexp &rest form sexp)
:indent 1)
(provide '+setup)
;;; +setup.el ends here