Ticket #3450 (new enhancement)

Opened 5 years ago

Last modified 4 years ago

Quickly tag many adjacent files

Reported by: egmont Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


It happens to me very often that I want to tag many subsequent files in a large directory tree, to later perform some operation on them (typically to copy them to the other panel).

E.g. I have a folder of thousands of photos (all the photos copied from my camera), and I want to copy the ones that belong to a certain trip to the pendrive of my friend (e.g. some hundred photos made last weekend, which might happen to be e.g. from DSC_4863.JPG to DSC_5328.JPG).

Currently the easiest/quickest solution I'm aware of is to find the first photo somehow (e.g. based on the timestamp), hold Insert or Ctrl+T or Shift+Down and wait for some long tens of seconds until it reaches the end of the list, or a timestamp that's no longer in the desired interval.

I'd like to have an equally simple, yet much quicker way of selecting many adjacent files.

Approach 1: Faster navigation with keyboard

In xterm, pressing Shift+Pgdn highlights many files at once. This is because xterm itself synthesizes multiple Down keypresses, plus mc finds out via the X extension that Shift is pressed. Drawbacks of this method: requires xterm (with certain config options which are apparently set correctly by default for this to work); requires X11 extension; if you reach the end of the file list it's random if the last file becomes highlighted or not (based on parity stuff), and is not extendible for Shift+End highlighting all the way to the end.

In gnome-terminal, pressing Shift+Pgdn or Shift+End sends a nice escape sequence (if on the alternate screen; as opposed to the standard behavior of scrolling back in the terminal's history buffer) which could be handled by mc. Drawbacks: specific to vte-based terminals (although other terminals could easily adopt this feature), and Shift+End is already taken for highlighting the command line.

Ctrl+Pgdn, Ctrl+End etc. are currently unused, and could be handled. Disadvantage: it's misleading in combination with Shift+Down which highlights and Ctrl+Down which invokes the command line history; these should probably remain this way: it's standard practice to use Shift for highlighting rather than Ctrl.

Approach 2: Tag files up to a certain point

A completely different and perhaps better approach could be to go in the direction of kinda mimicking the standard graphical (Gtk, Qt, Html...) multiple select UI elements, where Shift+click selects everything from the last tagged entry to the currently highlighted one. There are obvious differences between these two worlds so we can't do exactly the same, but this might be a start. E.g. I could somehow locate the first photo, press Insert, then somehow locate the last photo (it could be by Down, Pgdn, End, or Ctrl+S filename search, doesn't matter), press some other magic keycombo, and everything from the first tagged file up to this point would be highlighted.

Approach 3: Extend the Select or Filter dialog

Either the "Select" dialog (the one that appears when pressing '+') or the F9->Left->Filter dialog could be extended to allow you to specify an interval of filenames. Disadvantages: I'd have to remember two filenames; would probably only allow to specify an interval by filenames and not by any other sorting criteria, or the UI would get way too complicated and the feature would be probably harder/slower to use than tapping on Insert for some ten-twenty seconds.

What do you guys think? Any ideas, preferences?

Change History

comment:1 follow-up: ↓ 2 Changed 4 years ago by ossi

  1. would be the modern approach, but as you note, the key combos are too overloaded for that
  2. is actually pretty much the traditional approach to selection - think wordstar's ctrl-k-b - move - ctrl-k-k sequence. maybe ctrl-t - move - shift-ctrl-t would work?
  3. is way too complicated and limiting, as you note yourself

comment:2 in reply to: ↑ 1 Changed 4 years ago by egmont

  1. is actually pretty much the traditional approach to selection - think wordstar's ctrl-k-b - move - ctrl-k-k sequence. maybe ctrl-t - move - shift-ctrl-t would work?

shift-ctrl-letter is often handled by the terminal emulator itself (e.g. shift-ctrl-t: open new tab), and even if not, it generates the same escape sequence as without shift (so you'd require the X11 extension to distinguish the two). I guess we'd need to find a single-modifier hotkey (ctrl-something or alt-something). I don't mind it too much if it's multiple letters (e.g. ctrl-x-t), or even if it's only accessible in the F9 menu without a direct hotkey.

Note: See TracTickets for help on using tickets.