config: minimal dirvish attributes for VoiceOver
Remove file-time and file-size from default dirvish-attributes so screen reader reads only filenames. Add D keybinding to toggle full details on/off in dirvish buffers.
This commit is contained in:
16
config.el
16
config.el
@@ -884,9 +884,23 @@ Skip for beamer exports — beamer uses adjustbox on plain tabular."
|
||||
:init (dirvish-override-dired-mode)
|
||||
:config
|
||||
(setq dirvish-mode-line-format '(:left (sort symlink) :right (omit yank index))
|
||||
dirvish-attributes '(vc-state subtree-state nerd-icons collapse git-msg file-time file-size)
|
||||
;; Minimal attributes for VoiceOver: no file-time/file-size by
|
||||
;; default so screen reader reads only filenames. Toggle full
|
||||
;; details with "D" in dirvish buffers.
|
||||
dirvish-attributes '(vc-state subtree-state nerd-icons collapse git-msg)
|
||||
dirvish-side-width 35)
|
||||
(defun my/dirvish-toggle-details ()
|
||||
"Toggle file-time and file-size dirvish attributes."
|
||||
(interactive)
|
||||
(if (memq 'file-size dirvish-attributes)
|
||||
(setq-local dirvish-attributes
|
||||
(seq-remove (lambda (a) (memq a '(file-time file-size)))
|
||||
dirvish-attributes))
|
||||
(setq-local dirvish-attributes
|
||||
(append dirvish-attributes '(file-time file-size))))
|
||||
(revert-buffer))
|
||||
(map! :map dirvish-mode-map
|
||||
:n "D" #'my/dirvish-toggle-details
|
||||
:n "q" #'dirvish-quit
|
||||
:n "h" #'dired-up-directory
|
||||
:n "l" #'dired-find-file
|
||||
|
||||
Reference in New Issue
Block a user