Is it possible to customize the selection behavior (for find-file minibuffer): it should be the inserting for directories but the ordinary selection for files?
It is but currently there is currently no straightforward way, see also #178. For now you could use the following (only tested it shortly, please test):
(add-hook 'minibuffer-setup-hook
(defun selectrum-setup+ ()
(when (and selectrum-active-p
minibuffer-completing-file-name)
(let ((map (copy-keymap (current-local-map))))
(define-key map (kbd "RET") 'selectrum-select-current-candidate+)
(use-local-map map)))))
(defun selectrum-select-current-candidate+ (&optional arg)
(interactive "P")
(let* ((index (selectrum--index-for-arg arg))
(candidate (selectrum--get-candidate index))
(path (selectrum--get-full candidate)))
(call-interactively
(if (file-directory-p path)
'selectrum-insert-current-candidate
'selectrum-select-current-candidate))))
It seems to work, thank you!
Most helpful comment
It is but currently there is currently no straightforward way, see also #178. For now you could use the following (only tested it shortly, please test):