Alexander-Miller / treemacs

GNU General Public License v3.0
2.09k stars 153 forks source link

[QUESTION] Select multiple files #984

Closed jagjordi closed 1 year ago

jagjordi commented 1 year ago

Is it possible to select multiple files and move/delete/copy etc. them simultaneously?

quolpr commented 1 year ago

Same question 🙂

Alexander-Miller commented 1 year ago

Yes, it's possible. There is a hydra for handling multiple files in a dired-ish way bound to M-m. That hydra is the only way to handle multiple files at once, other commands like treemacs-delete-file will only act on the file at point.

The feature is relatively new (I still need to write documentation) and there might still be some rough corners, so make sure to report anything you find.

Chronal commented 1 year ago

An issue with M-m bindings in spacemacs, is that M-m is an alternative for the leader key. This means that M-m is always shadowed when I try to use it. It would be good to pick a bindings that's unused.

My temporary fix is to add this to (define-key treemacs-mode-map (kbd "U") #'treemacs-bulk-file-actions) to my dotspacemacs/user-config which triggers the hydra when I press U when in treemacs.

Alexander-Miller commented 1 year ago

The feature is relatively new (I still need to write documentation)

Correction: file marking is document in the chapter on file management: https://github.com/Alexander-Miller/treemacs#file-management There's also an entry in the helpful hydra.

You should also pull the latest version, I've fixed an issue with the way faces of marked files are handled.

This means that M-m is always shadowed when I try to use it. It would be good to pick a bindings that's unused.

I did. By default M-m is bound to back-to-indentation, which is not a conflict because that command does nothing in treemacs. Spacemacs using it as a global keybind is an unfortunate coincidence, but it is up to spacemacs' treemacs layer to use another keybind, I cannot possibly be expected to preempt conflicts with every Emacs distribution out there.

Chronal commented 1 year ago

I did. By default M-m is bound to back-to-indentation, which is not a conflict because that command does nothing in treemacs. Spacemacs using it as a global keybind is an unfortunate coincidence, but it is up to spacemacs' treemacs layer to use another keybind, I cannot possibly be expected to preempt conflicts with every Emacs distribution out there.

Thanks for info. I'll try put together a PR to the Spacemacs repo in order to fix the layer.