parent
88a3732ae7
commit
79fbaf3d98
6 changed files with 1087 additions and 2 deletions
45
modules/private/default/autoload/default.el
Normal file
45
modules/private/default/autoload/default.el
Normal file
|
@ -0,0 +1,45 @@
|
|||
;; private/default/autoload/default.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/yank-buffer-filename ()
|
||||
"Copy the current buffer's path to the kill ring."
|
||||
(interactive)
|
||||
(if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory))))
|
||||
(message (kill-new (abbreviate-file-name filename)))
|
||||
(error "Couldn't find filename in current buffer")))
|
||||
|
||||
(defmacro +default--def-browse-in! (name dir &optional prefix)
|
||||
(let ((prefix (cdr (doom-module-from-path load-file-name))))
|
||||
`(defun ,(intern (format "%s/browse-%s" (or prefix '+default) name)) ()
|
||||
(interactive)
|
||||
(doom-project-browse ,dir))))
|
||||
|
||||
(defmacro +default--def-find-in! (name dir)
|
||||
(let ((prefix (cdr (doom-module-from-path load-file-name))))
|
||||
`(defun ,(intern (format "+%s/find-in-%s" prefix name)) ()
|
||||
(interactive)
|
||||
(doom-project-find-file ,dir))))
|
||||
|
||||
|
||||
;;;###autoload (autoload '+default/browse-project "private/default/autoload" nil t)
|
||||
(+default--def-browse-in project (doom-project-root))
|
||||
|
||||
;;;###autoload (autoload '+default/find-in-templates "private/default/autoload" nil t)
|
||||
(+default--def-find-in! templates +file-templates-dir)
|
||||
;;;###autoload (autoload '+default/browse-templates "private/default/autoload" nil t)
|
||||
(+default--def-browse-in! templates +file-templates-dir)
|
||||
|
||||
;;;###autoload (autoload '+default/find-in-emacsd "private/default/autoload" nil t)
|
||||
(+default--def-find-in! emacsd doom-emacs-dir)
|
||||
;;;###autoload (autoload '+default/browse-emacsd "private/default/autoload" nil t)
|
||||
(+default--def-browse-in! emacsd doom-emacs-dir)
|
||||
|
||||
;;;###autoload (autoload '+default/find-in-notes "private/default/autoload" nil t)
|
||||
(+default--def-find-in! notes +org-dir)
|
||||
;;;###autoload (autoload '+default/browse-notes "private/default/autoload" nil t)
|
||||
(+default--def-browse-in! notes +org-dir)
|
||||
|
||||
;;;###autoload (autoload '+default/find-in-snippets "private/default/autoload" nil t)
|
||||
(+default--def-find-in! snippets +default-snippets-dir)
|
||||
;; NOTE No need for a browse-snippets variant, use `yas-visit-snippet-file'
|
||||
|
38
modules/private/default/autoload/evil.el
Normal file
38
modules/private/default/autoload/evil.el
Normal file
|
@ -0,0 +1,38 @@
|
|||
;; private/default/autoload/evil.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! :feature evil)
|
||||
|
||||
;;;###autoload (autoload '+default:multi-next-line "private/default/autoload/evil" nil t)
|
||||
(evil-define-motion +default:multi-next-line (count)
|
||||
"Move down 6 lines."
|
||||
:type line
|
||||
(let ((line-move-visual (or visual-line-mode (derived-mode-p 'text-mode))))
|
||||
(evil-line-move (* 6 (or count 1)))))
|
||||
|
||||
;;;###autoload (autoload '+default:multi-previous-line "private/default/autoload/evil" nil t)
|
||||
(evil-define-motion +default:multi-previous-line (count)
|
||||
"Move up 6 lines."
|
||||
:type line
|
||||
(let ((line-move-visual (or visual-line-mode (derived-mode-p 'text-mode))))
|
||||
(evil-line-move (- (* 6 (or count 1))))))
|
||||
|
||||
;;;###autoload (autoload '+default:cd "private/default/autoload/evil" nil t)
|
||||
(evil-define-command +default:cd ()
|
||||
"Change `default-directory' with `cd'."
|
||||
(interactive "<f>")
|
||||
(cd input))
|
||||
|
||||
;;;###autoload (autoload '+default:kill-all-buffers "private/default/autoload/evil" nil t)
|
||||
(evil-define-command +default:kill-all-buffers (&optional bang)
|
||||
"Kill all buffers. If BANG, kill current session too."
|
||||
(interactive "<!>")
|
||||
(if bang
|
||||
(+workspace/kill-session)
|
||||
(doom/kill-all-buffers)))
|
||||
|
||||
;;;###autoload (autoload '+default:kill-matching-buffers "private/default/autoload/evil" nil t)
|
||||
(evil-define-command +default:kill-matching-buffers (&optional bang pattern)
|
||||
"Kill all buffers matching PATTERN regexp. If BANG, only match project
|
||||
buffers."
|
||||
(interactive "<a>")
|
||||
(doom/kill-matching-buffers pattern bang))
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue