moe
moe copied to clipboard
OS independend changing of file permissions
I often create a shell script in an editor, lately it usually is with moe, and then I need to leave moe for the command line, where I usually do this: chmod +x filename
This is really annoying after a while.
It would be nice if moe had an integrated OS independend feature for doing stuff like this.
Of course, coming from unix/linux I'd like to keep using the traditional chmod +x. However, :+x would be even sweeter, because it would be shorter, but less descriptive.
Here're a few ideas on how it could work:
:+x for making user executable :+m for making user modifiable :+r for making user readable :+0777 to set permissions with a mask (but this would be partially OS specific again)
(the only issue here is that it would be slightly cryptic again, at least x, m and r are more or less mnemonic.)
Another idea would be to add a special permission setting mode :perm
That could look like this:
USER GROUP OTHERS
R [ ] [ ] [ ]
W [ ] [ ] [ ]
X [ ] [ ] [ ]
Where when hitting enter/space when the cursor is over X/W/R, the permission is activated for all of USER GROUP and OTHERS or deactivated when doing it again. And when hitting enter/space over one of the checkboxes it only affects that one checkbox.
I would pledge for making those changes apply immediately instead of having the user needing to do another action for saving those changes.
Permissions that aren't relevant for the current system or that can't be set for other reasons should be striked through like this: X [ ] --- ----
If the user wants to revert the settings to the original settings, it should work by using the undo key u. Hitting x, r, w in that mode should trigger the same action as going there with the cursor and hitting enter.
Moreover we could support advanced access features like access control lists from this mode, with this feature I think moe would get a whole lot more interesting for system administrators on all systems, even on Windows.
This feature should also be accessible from filer mode, so that you can change the permissions on multiple files quickly.
@tobimensch
Thank you. It's an interesting idea.