Add '+' character for custom defined functions

This commit is contained in:
Wojciech Kozlowski 2022-04-10 22:01:32 +02:00
parent 61b4dd0437
commit cc8efb8ca4

View File

@ -165,10 +165,10 @@
:bind :bind
(("C-x C-g" . deadgrep)) (("C-x C-g" . deadgrep))
(:map deadgrep-mode-map (:map deadgrep-mode-map
("C-o" . deadgrep-open-result-other-window) ("C-o" . +deadgrep-open-result-other-window)
("<RET>" . deadgrep-visit-result-other-window)) ("<RET>" . deadgrep-visit-result-other-window))
:config :config
(defun deadgrep-open-result-other-window () (defun +deadgrep-open-result-other-window ()
"Open the result in other window without changing to it." "Open the result in other window without changing to it."
(interactive) (interactive)
(save-selected-window (deadgrep-visit-result-other-window)))) (save-selected-window (deadgrep-visit-result-other-window))))
@ -221,14 +221,14 @@
(defalias #'end-of-visual-line #'end-of-line) (defalias #'end-of-visual-line #'end-of-line)
(defalias #'beginning-of-visual-line #'beginning-of-line) (defalias #'beginning-of-visual-line #'beginning-of-line)
(defun indent-region-or-buffer () (defun +indent-region-or-buffer ()
"Indent a region if selected, otherwise the whole buffer." "Indent a region if selected, otherwise the whole buffer."
(interactive) (interactive)
(if (region-active-p) (if (region-active-p)
(indent-region (region-beginning) (region-end)) (indent-region (region-beginning) (region-end))
(indent-region (point-min) (point-max)))) (indent-region (point-min) (point-max))))
(defun unfill-paragraph (&optional region) (defun +unfill-paragraph (&optional region)
"Takes a multi-line paragraph and makes it into a single line of text." "Takes a multi-line paragraph and makes it into a single line of text."
(interactive (progn (barf-if-buffer-read-only) '(t))) (interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max)) (let ((fill-column (point-max))
@ -242,8 +242,8 @@
(map! (map!
;; For functions defined above. ;; For functions defined above.
"M-Q" #'unfill-paragraph "M-Q" #'+unfill-paragraph
"C-M-\\" #'indent-region-or-buffer "C-M-\\" #'+indent-region-or-buffer
;; Create binding before dired is loaded. ;; Create binding before dired is loaded.
"C-x C-j" #'dired-jump "C-x C-j" #'dired-jump
;; More convenient window switching. ;; More convenient window switching.