yorukot / superfile

Pretty fancy and modern terminal file manager
https://superfile.netlify.app
MIT License
5.98k stars 130 forks source link

Action menu on selected/pointed files/folders #228

Open mcgru opened 5 months ago

mcgru commented 5 months ago

Is your feature request related to a problem? Please describe. I often need to do some repetitive task on a set of selected files/folders

Describe the solution you'd like Please, look how midnight commander did their user (action) menu on pressing F2 in panel mode. I'd like to propose the same functionality - keep list of tasks, run one selected on a group of selected files.

Additional context Please check F2-menu in Midnight Commander

yorukot commented 5 months ago
F2-@                      Run a command on the currently highlighted item, e.g.:
        F2-@ unzip                Unzip selected file
        F2-@ zip -r foo.zip       Zip current directory as foo.zip
        F2-@ 7za x                Extract selected file with 7zip
        F2-@ 7za a foo.7z         7zip current directory as foo.7z

If I understand correctly this is basically a way to put pre-written commands in a menu so that you can do repetitive tasks faster, right?

Or you can provide more information :) (sorry i didn't use middle commander before)

mcgru commented 5 months ago

Sorry, i'm not enough laconic to describe. If you install Midnight Commander and run it, there will be ~/.config/mc/mc.menu that contains menu items. Some of their syntax is difficult to understand, but some ones are quite easy.

For examble, these are menu items that compress/decompress gzip and bzip2 files/archives: `

jonasherr commented 5 months ago

I would also be very much interested in that feature. I am using a plugin with a similar feature in nvim called nerdtree. They call their action menu NERDTreeMenu, maybe this could give you some inspiration for a potential implementation: https://github.com/preservim/nerdtree/blob/master/doc/NERDTree.txt#L641

This is how the menu looks in nerdtree when I am using it. I select a file -> click m -> select the action I want to do or just click the letter that is mapped to this action like clicking r to reveal the selected file in the finder (MacOS file explorer) Here is a screencast of that behaviour: https://github.com/yorukot/superfile/assets/37550860/2765afe6-fc8f-46a9-a501-cf79dc83bf99

I you need any feedback with this potential feature, I am always happy to help 😊 I could also try to implement it with some simple actions if you want, but I am not experienced with go at all, but could give it a try 😅