vimiv-qt icon indicating copy to clipboard operation
vimiv-qt copied to clipboard

Visual Mode

Open jcjgraf opened this issue 5 years ago • 5 comments

I could imagine that something like a visual mode would be very useful. After activating the mode one could select a bunch of subsequent images in library or thumbnail mode. The selection could then be batch-processed (e.g. marked, or fed to an external command).

I do often have the situation that I have many different shootings on a SD card and often I only need to select one specific event and e.g. move it to a certain location. This feature would allow for a huge efficiency boost in my workflow.

What do you @karlch thing about such a feature?

jcjgraf avatar Nov 04 '20 16:11 jcjgraf

I am not sure what benefit a new "mode" would bring compared to the regular marking system, at least not for the usecase you mention. In this case you could mark the images in library / thumbnail mode using m and then e.g. move them using :!mv %m /new/location. Marking even offers the option to use simple unix patterns, e.g. :mark MyEvent*.jpg. What additional benefits do you see from this visual mode?

karlch avatar Nov 04 '20 20:11 karlch

I agree that one the desired images are marked, there are no limits in what one can to with the selection (thanks to the external commands, %m alias etc.). But for me, the marking process is troublesome and quite inconvenient. Assume you need to mark n subsequent images, currently this required 2n keystrokes (n times x for the marking and n times n to go to the next image). While the unix pattern match may reduce the number of keystrokes (at least for larger selections), given the pretty much random naming of the images by my camera, I am bound to make an error sooner or latter...

Now my idea was that once this mode is activated, you can navigate to the last image of the desired range, and all images in-between are automatically selected (/marked ?). This reduces the number of keystrokes by at least the factor 2, for the thumbnail view even more, since you can jump down whole rows. This could be even more improved the we would add typical vim movement shortcuts, like $ (move to end of line in thumbnail mode), 0 (move to beginning of line in thumbnail mode), CTRL + [d, f, u, u] to move up/down by whole/halve pages. But that does probably deserve its own feature request :smile:

As I think about it, it does probably not make much sense to reinvent the wheel, but instead extend the functionality of the marker. I guess that should actually even be doable with a plugin.

jcjgraf avatar Nov 05 '20 19:11 jcjgraf

I have a simple keybinding in my vimiv config to at least achieve the factor of 2 you describe:

<alt>m: mark %% && next

Of course this doesn't help for more complex movements as currently there is no concept of "in-between". I have to think about this some more. I would probably accept a PR for this if the code is not too complicated, but may not work on it myself.

I opened #295 for the additional movement shortcuts.

karlch avatar Nov 05 '20 21:11 karlch

I have created the little plugin BatchMark, which does exactly what I was missing from vimiv

To start the selection, one runs :batchmarkstart. With the last image in the desired range selected, running :batchmarkend will mark all images in the range. If all images are already marked, they are unmarked.

All logic to determine the images in the range was already present in vimiv, it just had to be found :laughing: The logic for marking the images is a little hacked, though it works.

P.S. In case you @karlch change you mind and agree that having this functionality directly in vimiv would be useful, I am willing to open a PR and reimplement it in vimiv. If not, then this issue can be closed :smirk:

jcjgraf avatar Dec 31 '20 20:12 jcjgraf

This is really cool, I have to admit I like it a lot! Instead of writing a longer message here I will add some thoughts directly in the plugin as issues. If we can solve them all, I would almost certainly be happy to add this into vimiv directly.

karlch avatar Jan 03 '21 11:01 karlch