Lots of other changes
This commit is contained in:
parent
9b9d026b61
commit
f0294f7fb4
32
init.el
32
init.el
|
@ -37,7 +37,12 @@
|
||||||
"M-j" nil
|
"M-j" nil
|
||||||
"C-x o" (lambda () (interactive) (switch-to-buffer nil))
|
"C-x o" (lambda () (interactive) (switch-to-buffer nil))
|
||||||
"C-x C-o" #'+open-paragraph
|
"C-x C-o" #'+open-paragraph
|
||||||
"C-w" #'+kill-word-backward-or-region)
|
"C-w" #'+kill-word-backward-or-region
|
||||||
|
"C-x C-1" #'delete-other-windows
|
||||||
|
"C-x 2" #'+split-window-below-then
|
||||||
|
"C-x C-2" #'+split-window-below-then
|
||||||
|
"C-x 3" #'+split-window-right-then
|
||||||
|
"C-x C-3" #'+split-window-right-then)
|
||||||
;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
|
;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
|
||||||
(global-set-key (kbd "C-h") 'delete-backward-char)
|
(global-set-key (kbd "C-h") 'delete-backward-char)
|
||||||
(keyboard-translate ?\C-h ?\C-?)
|
(keyboard-translate ?\C-h ?\C-?)
|
||||||
|
@ -741,11 +746,11 @@
|
||||||
(:also-load +consult)
|
(:also-load +consult)
|
||||||
;; from Consult wiki
|
;; from Consult wiki
|
||||||
(:option register-preview-delay 0
|
(:option register-preview-delay 0
|
||||||
register-preview-function 'consult-register-format
|
register-preview-function #'consult-register-format
|
||||||
xref-show-xrefs-function 'consult-xref
|
xref-show-xrefs-function #'consult-xref
|
||||||
xref-show-definitions-function 'consult-xref
|
xref-show-definitions-function #'consult-xref
|
||||||
tab-always-indent 'complete
|
tab-always-indent 'complete
|
||||||
completion-in-region-function 'consult-completion-in-region)
|
completion-in-region-function #'consult-completion-in-region)
|
||||||
(advice-add #'register-preview :override #'consult-register-window)
|
(advice-add #'register-preview :override #'consult-register-window)
|
||||||
(advice-add #'completing-read-multiple :override
|
(advice-add #'completing-read-multiple :override
|
||||||
#'consult-completing-read-multiple)
|
#'consult-completing-read-multiple)
|
||||||
|
@ -819,6 +824,12 @@
|
||||||
(with-eval-after-load 'orderless
|
(with-eval-after-load 'orderless
|
||||||
(:option consult--regexp-compiler 'consult--orderless-regexp-compiler))))
|
(:option consult--regexp-compiler 'consult--orderless-regexp-compiler))))
|
||||||
|
|
||||||
|
(setup (:straight consult-dir)
|
||||||
|
(:+key "C-x C-d" #'consult-dir)
|
||||||
|
(:with-map vertico-map
|
||||||
|
(:bind "C-x C-d" #'consult-dir
|
||||||
|
"C-x C-j" #'consult-dir-jump-file)))
|
||||||
|
|
||||||
(setup (:straight crux)
|
(setup (:straight crux)
|
||||||
;; yes it's silly I have an addon to this addon.
|
;; yes it's silly I have an addon to this addon.
|
||||||
(:also-load +crux)
|
(:also-load +crux)
|
||||||
|
@ -902,7 +913,8 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(setup (:straight elpher))
|
(setup (:straight elpher))
|
||||||
|
|
||||||
(setup (:straight embark)
|
(setup (:straight embark)
|
||||||
(:option prefix-help-command 'embark-prefix-help-command)
|
(:option prefix-help-command 'embark-prefix-help-command
|
||||||
|
embark-keymap-prompter-key ";")
|
||||||
(:+key "C-." #'embark-act
|
(:+key "C-." #'embark-act
|
||||||
"M-." #'embark-dwim
|
"M-." #'embark-dwim
|
||||||
"<f1> B" #'embark-bindings)
|
"<f1> B" #'embark-bindings)
|
||||||
|
@ -1162,8 +1174,10 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(setup (:straight paredit)
|
(setup (:straight paredit)
|
||||||
(:bind "DEL" #'paredit-backward-delete
|
(:bind "DEL" #'paredit-backward-delete
|
||||||
"C-<backspace>" #'paredit-backward-kill-word
|
"C-<backspace>" #'paredit-backward-kill-word
|
||||||
"C-w" (lambda (r) (interactive "P")
|
"C-w" (lambda (arg) (interactive "P")
|
||||||
(+kill-word-backward-or-region r #'paredit-backward-kill-word)))
|
(+kill-word-backward-or-region arg
|
||||||
|
#'paredit-backward-kill-word))
|
||||||
|
"M-s" nil)
|
||||||
(dolist (hook '(emacs-lisp-mode-hook
|
(dolist (hook '(emacs-lisp-mode-hook
|
||||||
eval-expression-minibuffer-setup-hook
|
eval-expression-minibuffer-setup-hook
|
||||||
ielm-mode-hook
|
ielm-mode-hook
|
||||||
|
@ -1224,6 +1238,8 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(simple-modeline-mode +1))
|
(simple-modeline-mode +1))
|
||||||
|
|
||||||
(setup (:straight smartscan)
|
(setup (:straight smartscan)
|
||||||
|
(:with-map smartscan-map
|
||||||
|
(:bind "M-'" nil))
|
||||||
(:hook-into prog-mode))
|
(:hook-into prog-mode))
|
||||||
|
|
||||||
(setup (:straight (sophomore
|
(setup (:straight (sophomore
|
||||||
|
|
50
lisp/acdw.el
50
lisp/acdw.el
|
@ -185,5 +185,55 @@ three blank lines, then place the point on the second one."
|
||||||
(newline 2)
|
(newline 2)
|
||||||
(previous-line)))
|
(previous-line)))
|
||||||
|
|
||||||
|
(defun +split-window-then (&optional where arg)
|
||||||
|
"Split the window into a new buffer.
|
||||||
|
With non-nil ARG (\\[universal-argument] interactively), don't
|
||||||
|
prompt for a buffer to switch to. This function will split the
|
||||||
|
window using `split-window-sensibly', or open the new window in
|
||||||
|
the direction specified by WHERE. WHERE is ignored when called
|
||||||
|
interactively; if you want specific splitting, use
|
||||||
|
`+split-window-right-then' or `+split-window-below-then'."
|
||||||
|
(interactive "i\nP")
|
||||||
|
;; TODO: Canceling at the switching phase leaves the point in the other
|
||||||
|
;; window. Ideally, the user would see this as one action, meaning a cancel
|
||||||
|
;; would return to the original window.
|
||||||
|
(pcase where
|
||||||
|
;; These directions are 'backward' to the OG Emacs split-window commands,
|
||||||
|
;; because by default Emacs leaves the cursor in the original window. Most
|
||||||
|
;; users probably expect a switch to the new window, at least I do.
|
||||||
|
((or 'right :right) (split-window-right) (other-window 1))
|
||||||
|
((or 'left :left) (split-window-right))
|
||||||
|
((or 'below :below) (split-window-below) (other-window 1))
|
||||||
|
((or 'above :above) (split-window-below))
|
||||||
|
((pred null)
|
||||||
|
(or (split-window-sensibly)
|
||||||
|
(if (< (window-height) (window-width))
|
||||||
|
(split-window-below)
|
||||||
|
(split-window-right)))
|
||||||
|
(other-window 1))
|
||||||
|
(_ (user-error "Unknown WHERE paramater: %s" where)))
|
||||||
|
(unless arg
|
||||||
|
(condition-case nil
|
||||||
|
(call-interactively
|
||||||
|
(pcase (read-char "(B)uffer or (F)ile?")
|
||||||
|
(?b (if (fboundp #'consult-buffer)
|
||||||
|
#'consult-buffer
|
||||||
|
#'switch-to-buffer))
|
||||||
|
(?f #'find-file)
|
||||||
|
(_ #'ignore)))
|
||||||
|
(quit (delete-window)))))
|
||||||
|
|
||||||
|
(defun +split-window-right-then (&optional arg)
|
||||||
|
"Split window right, then prompt for a new buffer.
|
||||||
|
With optional ARG (\\[universal-argument]), just split."
|
||||||
|
(interactive "P")
|
||||||
|
(+split-window-then :right arg))
|
||||||
|
|
||||||
|
(defun +split-window-below-then (&optional arg)
|
||||||
|
"Split window below, then prompt for a new buffer.
|
||||||
|
With optional ARG (\\[universal-argument]), just split."
|
||||||
|
(interactive "P")
|
||||||
|
(+split-window-then :below arg))
|
||||||
|
|
||||||
(provide 'acdw)
|
(provide 'acdw)
|
||||||
;;; acdw.el ends here
|
;;; acdw.el ends here
|
||||||
|
|
Loading…
Reference in New Issue