gokcehan / lf

Terminal file manager
MIT License
7.73k stars 332 forks source link

Mappings can have custom description #536

Open chama-chomo opened 3 years ago

chama-chomo commented 3 years ago

This one is slightly related to #91, which is closed already.

Actually, it would be really convenient if there is support for a custom description of mapping commands:

At the moment a context menu might not look very helpful every time:

keys    command
gb      :{{ git_branch -- []; }}
gg      top -- []
gh      cd -- [~]
gl      :{{ git_log -- []; }}
go      :{{ fasd_dir -- []; }}
gp      :{{ git_pull -- []; }}
gs      :{{ git_status -- []; }}

Desired state:


keys     description                         command
gb       Change git branch             {{ git_branch -- []; }}
gg       Show system resources         top -- []
gh       Change current dir to ~        cd -- [~]
gl       Show git log                  :{{ git_log -- []; }}
go       Quick jump folder (fasd)       :{{ fasd_dir -- []; }}
gp       Get changes from remote       :{{ git_pull -- []; }}
gs       Show git status               :{{ git_status -- []; }}

A possibility to even suppress certain columns as configured by the user would be nice, too.

gokcehan commented 3 years ago

@chama-chomo Is this the same as #363 ? To be honest your explicit command name approach here seems like a good solution for this.

chama-chomo commented 3 years ago

thx @gokcehan, this is only nice to have feature, I can live without it easily. On the other side, when it comes to some design decisions, I'd be happy if developers can take this into account. I think I will not be the only one, who would appreciate this small UI improvement.

gokcehan commented 3 years ago

@chama-chomo I agree I'm a little conservative when it comes to cosmetic features. I think this one requires adding a new syntax to our command definitions and I'm not a fan of changing the syntax. I can label the issue as enhancement and we can keep it open in case someone comes up with a clean solution for this.

ndavd commented 3 years ago

Hoping for this to be added someday :)

user529 commented 2 days ago

I'd also vote for this feature. I have several complex commands, and they are not easy to recognize quickly from the text. And some brief descriptions could be really helpful.

Of course, there can be many approaches to implementing this. But I have never tried programming in GO, so I won't provide things like PR in the near future. But I'm ready to share some ideas. Perhaps at first, it would be easier to introduce a new token for descriptive mappings, something like: DMapExpr = 'dmap' "Brief description" Expr