From 0d1af13ccb4484fc91e836ad7dc85f38a79bd006 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Sun, 13 Jul 2025 21:35:45 +0200 Subject: [PATCH] add dirvish config --- lisp/dirvish/dirvish-autoloads.el | 355 ++++++++++++++++++++++++++++++ lisp/update-autoloads.el | 1 + settings/gui-settings.el | 61 +++++ 3 files changed, 417 insertions(+) create mode 100644 lisp/dirvish/dirvish-autoloads.el diff --git a/lisp/dirvish/dirvish-autoloads.el b/lisp/dirvish/dirvish-autoloads.el new file mode 100644 index 00000000..c604d09c --- /dev/null +++ b/lisp/dirvish/dirvish-autoloads.el @@ -0,0 +1,355 @@ +;;; dirvish-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + + +;;; Generated autoloads from dirvish.el + +(defvar dirvish-override-dired-mode nil "\ +Non-nil if Dirvish-Override-Dired mode is enabled. +See the `dirvish-override-dired-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `dirvish-override-dired-mode'.") +(custom-autoload 'dirvish-override-dired-mode "dirvish" nil) +(autoload 'dirvish-override-dired-mode "dirvish" "\ +Let Dirvish take over Dired globally. + +This is a global minor mode. If called interactively, toggle the +`Dirvish-Override-Dired mode' mode. If the prefix argument is positive, +enable the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `(default-value \\='dirvish-override-dired-mode)'. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +(fn &optional ARG)" t) +(autoload 'dirvish "dirvish" "\ +Open PATH in a fullframe Dirvish session. +Prompt for PATH if called with \\[universal-arguments], otherwise PATH +defaults to `default-directory'. + +(fn &optional PATH)" t) +(autoload 'dirvish-dwim "dirvish" "\ +Open PATH in a fullframe session if selected window is the only window. +Prompt for PATH if called with \\[universal-arguments], otherwise PATH +defaults to `default-directory'. If there are other windows exist in the +selected frame, the session occupies only the selected window. + +(fn &optional PATH)" t) +(register-definition-prefixes "dirvish" '("dirvish-")) + + +;;; Generated autoloads from dirvish-collapse.el + +(register-definition-prefixes "dirvish-collapse" '("dirvish-collapse-")) + + +;;; Generated autoloads from dirvish-emerge.el + +(autoload 'dirvish-emerge-menu "dirvish-emerge" "\ +Manage pinned files in Dirvish." t) +(autoload 'dirvish-emerge-mode "dirvish-emerge" "\ +Toggle grouping of files in Dirvish. + +This is a minor mode. If called interactively, toggle the +`Dirvish-Emerge mode' mode. If the prefix argument is positive, enable +the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate the variable `dirvish-emerge-mode'. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +(fn &optional ARG)" t) +(register-definition-prefixes "dirvish-emerge" '("dirvish-emerge-")) + + +;;; Generated autoloads from dirvish-extras.el + + (autoload 'dirvish-setup-menu "dirvish-extras" nil t) +(autoload 'dirvish-copy-file-name "dirvish-extras" "\ +Copy filename of marked files. +If MULTI-LINE, make every name occupy a new line. + +(fn &optional MULTI-LINE)" t) +(autoload 'dirvish-copy-file-path "dirvish-extras" "\ +Copy filepath of marked files. +If MULTI-LINE, make every path occupy a new line. + +(fn &optional MULTI-LINE)" t) +(autoload 'dirvish-total-file-size "dirvish-extras" "\ +Echo total file size of FILESET. +FILESET defaults to `dired-get-marked-files'. + +(fn &optional FILESET)" t) +(autoload 'dirvish-layout-switch "dirvish-extras" "\ +Switch Dirvish layout according to RECIPE. +If RECIPE is not provided, switch to the recipe next to the +current layout defined in `dirvish-layout-recipes'. + +(fn &optional RECIPE)" t) + (autoload 'dirvish-file-info-menu "dirvish-extras" nil t) + (autoload 'dirvish-chxxx-menu "dirvish-extras" nil t) + (autoload 'dirvish-mark-menu "dirvish-extras" nil t) + (autoload 'dirvish-renaming-menu "dirvish-extras" nil t) + (autoload 'dirvish-dired-cheatsheet "dirvish-extras" nil t) + (autoload 'dirvish-dispatch "dirvish-extras" nil t) +(register-definition-prefixes "dirvish-extras" '("dirvish-")) + + +;;; Generated autoloads from dirvish-fd.el + + (autoload 'dirvish-fd-switches-menu "dirvish-fd" nil t) +(autoload 'dirvish-fd "dirvish-fd" "\ +Run `fd' on DIR and go into Dired mode on a buffer of the output. +The command run is essentially: + + fd --color=never `dirvish-fd-switches' + --and PATTERN [--and PATTERN1 --and PATTERN2 … ] + --exec-batch `dirvish-fd-ls-program' `dired-listing-switches' --directory + +If called with \\`C-u', prompt for the target directory, +`default-directory' is used. If prefixed with \\`C-u' twice, also +prompt for the search regex PATTERN as a comma separated list. + +(fn DIR PATTERN)" t) +(register-definition-prefixes "dirvish-fd" '("dirvish-fd-")) + + +;;; Generated autoloads from dirvish-history.el + +(autoload 'dirvish-history-jump "dirvish-history" "\ +Read a recently visited directory from minibuffer and revisit it." t) +(autoload 'dirvish-history-last "dirvish-history" "\ +Switch to the most recently visited dirvish buffer." t) +(autoload 'dirvish-history-go-forward "dirvish-history" "\ +Navigate to next ARG directory in history. +ARG defaults to 1. + +(fn ARG)" t) +(autoload 'dirvish-history-go-backward "dirvish-history" "\ +Navigate to previous ARG directory in history. +ARG defaults to 1. + +(fn ARG)" t) + (autoload 'dirvish-history-menu "dirvish-history" nil t) +(register-definition-prefixes "dirvish-history" '("dirvish-history-")) + + +;;; Generated autoloads from dirvish-icons.el + +(register-definition-prefixes "dirvish-icons" '("dirvish-")) + + +;;; Generated autoloads from dirvish-ls.el + + (autoload 'dirvish-quicksort "dirvish-ls" nil t) + (autoload 'dirvish-ls-switches-menu "dirvish-ls" nil t) +(register-definition-prefixes "dirvish-ls" '("dirvish-ls--")) + + +;;; Generated autoloads from dirvish-narrow.el + +(autoload 'dirvish-narrow "dirvish-narrow" "\ +Narrow a Dirvish buffer to the files matching a regex." '(dired-mode)) +(register-definition-prefixes "dirvish-narrow" '("dirvish-narrow-")) + + +;;; Generated autoloads from dirvish-peek.el + +(defvar dirvish-peek-mode nil "\ +Non-nil if Dirvish-Peek mode is enabled. +See the `dirvish-peek-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `dirvish-peek-mode'.") +(custom-autoload 'dirvish-peek-mode "dirvish-peek" nil) +(autoload 'dirvish-peek-mode "dirvish-peek" "\ +Show file preview when narrowing candidates using minibuffer. + +This is a global minor mode. If called interactively, toggle the +`Dirvish-Peek mode' mode. If the prefix argument is positive, enable +the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `(default-value \\='dirvish-peek-mode)'. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +(fn &optional ARG)" t) +(register-definition-prefixes "dirvish-peek" '("dirvish-peek-")) + + +;;; Generated autoloads from dirvish-quick-access.el + + (autoload 'dirvish-quick-access "dirvish-quick-access" nil t) +(register-definition-prefixes "dirvish-quick-access" '("dirvish-quick-access-function")) + + +;;; Generated autoloads from dirvish-rsync.el + +(autoload 'dirvish-rsync "dirvish-rsync" "\ +Rsync marked files to DEST, prompt for DEST if not called with. +If either the sources or the DEST is located in a remote host, the +`dirvish-rsync-program' and `dirvish-rsync-args' are used to transfer +the files. + +This command requires proper ssh authentication setup to work correctly +for file transfer involving remote hosts, because rsync command is +always run locally, the password prompts may lead to unexpected errors. + +(fn DEST)" t) + (autoload 'dirvish-rsync-switches-menu "dirvish-rsync" nil t) +(register-definition-prefixes "dirvish-rsync" '("dirvish-rsync-")) + + +;;; Generated autoloads from dirvish-side.el + +(defvar dirvish-side-follow-mode nil "\ +Non-nil if Dirvish-Side-Follow mode is enabled. +See the `dirvish-side-follow-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `dirvish-side-follow-mode'.") +(custom-autoload 'dirvish-side-follow-mode "dirvish-side" nil) +(autoload 'dirvish-side-follow-mode "dirvish-side" "\ +Toggle `dirvish-side-follow-mode'. + +When enabled the visible side session will select the current +buffer's filename. It will also visits the latest `project-root' +after switching to a new project. + +This is a global minor mode. If called interactively, toggle the +`Dirvish-Side-Follow mode' mode. If the prefix argument is positive, +enable the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the mode +if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `(default-value \\='dirvish-side-follow-mode)'. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +(fn &optional ARG)" t) +(autoload 'dirvish-side "dirvish-side" "\ +Toggle a Dirvish session at the side window. + +- If the current window is a side session window, hide it. +- If a side session is visible, select it. +- If a side session exists but is not visible, show it. +- If there is no side session exists, create a new one with PATH. + +If called with \\[universal-arguments], prompt for PATH, +otherwise it defaults to `project-current'. + +(fn &optional PATH)" t) +(register-definition-prefixes "dirvish-side" '("dirvish-side-")) + + +;;; Generated autoloads from dirvish-subtree.el + +(autoload 'dirvish-subtree-up "dirvish-subtree" "\ +Jump to beginning of current subtree." t) +(autoload 'dirvish-subtree-remove "dirvish-subtree" "\ +Remove subtree at point." t) +(autoload 'dirvish-subtree-clear "dirvish-subtree" "\ +Clear all subtrees in the buffer." t) +(autoload 'dirvish-subtree-toggle "dirvish-subtree" "\ +Insert subtree at point or remove it if it was not present." t) + (autoload 'dirvish-subtree-menu "dirvish-subtree" nil t) +(register-definition-prefixes "dirvish-subtree" '("dirvish-")) + + +;;; Generated autoloads from dirvish-tramp.el + +(register-definition-prefixes "dirvish-tramp" '("dirvish-tramp-")) + + +;;; Generated autoloads from dirvish-vc.el + + (autoload 'dirvish-vc-menu "dirvish-vc" nil t) +(register-definition-prefixes "dirvish-vc" '("dirvish-vc-")) + + +;;; Generated autoloads from dirvish-widgets.el + +(register-definition-prefixes "dirvish-widgets" '("dirvish-")) + + +;;; Generated autoloads from dirvish-yank.el + + (autoload 'dirvish-yank-menu "dirvish-yank" nil t) +(autoload 'dirvish-yank "dirvish-yank" "\ +Paste marked files to DEST. +Prompt for DEST when prefixed with \\[universal-argument], it defaults +to `dired-current-directory.' + +(fn &optional DEST)" t) +(autoload 'dirvish-move "dirvish-yank" "\ +Move marked files to DEST. +Prompt for DEST when prefixed with \\[universal-argument], it defaults +to `dired-current-directory'. + +(fn &optional DEST)" t) +(autoload 'dirvish-symlink "dirvish-yank" "\ +Symlink marked files to DEST. +Prompt for DEST when prefixed with \\[universal-argument], it defaults +to `dired-current-directory'. + +(fn &optional DEST)" t) +(autoload 'dirvish-relative-symlink "dirvish-yank" "\ +Similar to `dirvish-symlink', but link files relatively. +Prompt for DEST when prefixed with \\[universal-argument], it defaults +to `dired-current-directory'. + +(fn &optional DEST)" t) +(autoload 'dirvish-hardlink "dirvish-yank" "\ +Hardlink marked files to DEST. +Prompt for DEST when prefixed with \\[universal-argument], it defaults +to `dired-current-directory'. + +(fn &optional DEST)" t) +(register-definition-prefixes "dirvish-yank" '("dirvish-yank-")) + +;;; End of scraped data + +(provide 'dirvish-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; dirvish-autoloads.el ends here diff --git a/lisp/update-autoloads.el b/lisp/update-autoloads.el index 7bdbc723..507a82ec 100644 --- a/lisp/update-autoloads.el +++ b/lisp/update-autoloads.el @@ -46,6 +46,7 @@ (package-generate-autoloads "awesome-tray" (concat config-dir "lisp/awesome-tray")) (package-generate-autoloads "dashboard" (concat config-dir "lisp/dashboard")) (package-generate-autoloads "diff-hl" (concat config-dir "lisp/diff-hl")) + (package-generate-autoloads "dirvish" (concat config-dir "lisp/dirvish")) (package-generate-autoloads "flycheck" (concat config-dir "lisp/flycheck")) (package-generate-autoloads "flycheck-posframe" (concat config-dir "lisp/flycheck-posframe")) (package-generate-autoloads "focus" (concat config-dir "lisp/focus")) diff --git a/settings/gui-settings.el b/settings/gui-settings.el index e25d08ea..7234fe00 100644 --- a/settings/gui-settings.el +++ b/settings/gui-settings.el @@ -351,6 +351,67 @@ see `awesome-tray-mode-hook'" (format "%s" (buffer-name)))) ) +(use-package dired + :defer t + :config + (setq dired-listing-switches + "-l --almost-all --human-readable --group-directories-first --no-group") + ;; this command is useful when you want to close the window of `dirvish-side' + ;; automatically when opening a file + ;; (put 'dired-find-alternate-file 'disabled nil) + (setq dired-mouse-drag-files t) + (setq mouse-drag-and-drop-region-cross-program t) + ) + +(use-package dirvish + :defer t + :init + (require 'dirvish-autoloads) + (dirvish-override-dired-mode) + :bind ; Bind `dirvish-fd|dirvish-side|dirvish-dwim' as you see fit + (("C-c f" . dirvish) + :map dirvish-mode-map ; Dirvish inherits `dired-mode-map' + (";" . dired-up-directory) ; So you can adjust `dired' bindings here + ("?" . dirvish-dispatch) ; [?] a helpful cheatsheet + ("a" . dirvish-setup-menu) ; [a]ttributes settings:`t' toggles mtime, `f' toggles fullframe, etc. + ("f" . dirvish-file-info-menu) ; [f]ile info + ("o" . dirvish-quick-access) ; [o]pen `dirvish-quick-access-entries' + ("s" . dirvish-quicksort) ; [s]ort flie list + ("r" . dirvish-history-jump) ; [r]ecent visited + ("l" . dirvish-ls-switches-menu) ; [l]s command flags + ("v" . dirvish-vc-menu) ; [v]ersion control commands + ("*" . dirvish-mark-menu) + ("y" . dirvish-yank-menu) + ("N" . dirvish-narrow) + ("^" . dirvish-history-last) + ("TAB" . dirvish-subtree-toggle) + ("M-f" . dirvish-history-go-forward) + ("M-b" . dirvish-history-go-backward) + ("M-e" . dirvish-emerge-menu) + ("" . dirvish-subtree-toggle-or-open) + ("" . dired-mouse-find-file-other-window) + ("" . dired-mouse-find-file)) + :config + (setq mouse-1-click-follows-link nil) + (setq dirvish-quick-access-entries + '(("h" "~/" "Home") + ("d" "~/Downloads/" "Downloads") + ("m" "/mnt/" "Drives") + ;; ("s" "/ssh:my-remote-server") "SSH server" + ;; ("e" "/sudo:root@localhost:/etc") "Modify program settings" + ;; ("t" "~/.local/share/Trash/files/" "TrashCan") + )) + ;; (dirvish-peek-mode) ; Preview files in minibuffer + (dirvish-side-follow-mode) ; similar to `treemacs-follow-mode' + (setq dirvish-mode-line-format + '(:left (sort symlink) :right (omit yank index))) + (setq dirvish-attributes ; The order *MATTERS* for some attributes + '(vc-state subtree-state nerd-icons collapse git-msg file-time file-size) + dirvish-side-attributes + '(vc-state nerd-icons collapse file-size)) + ;; open large directory (over 20000 files) asynchronously with `fd' command + (setq dirvish-large-directory-threshold 20000)) + (use-package doc-view :defer t :delight (doc-view-mode "Doc") ;; "DocView" "\u01F153\uFF4F\uFF43"