diff options
author | hut <hut@lavabit.com> | 2012-08-02 03:36:47 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-08-02 03:36:47 +0200 |
commit | d2c8c6cb3f24ac626275af133bb723e549850538 (patch) | |
tree | 569586e90f36008f365839f6ee4c344bf5d023e2 | |
parent | 5ce347118df3ebb96646ba1ffcf69f2e1f5c4da8 (diff) | |
download | ranger-d2c8c6cb3f24ac626275af133bb723e549850538.tar.gz |
defaults/rc.conf: simplify the chmod bindings
-rw-r--r-- | ranger/defaults/rc.conf | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ranger/defaults/rc.conf b/ranger/defaults/rc.conf index 5ac2763a..a347d116 100644 --- a/ranger/defaults/rc.conf +++ b/ranger/defaults/rc.conf @@ -244,13 +244,18 @@ map um<any> unset_bookmark %any map m<bg> draw_bookmarks copymap m<bg> um<bg> `<bg> '<bg> -# Beware. I haven't figured out how to make these keybindings pretty yet: - -# map +ow shell -d chmod o+w (one mapping for each combination) -eval import itertools; [cmd("map +%s%s shell -d chmod %s+%s %%s" % (mode+mode)) for mode in itertools.product("ugoa", "rwxXst")] - -# map -ow shell -d chmod o+w (one mapping for each combination) -eval import itertools; [cmd("map -%s%s shell -d chmod %s-%s %%s" % (mode+mode)) for mode in itertools.product("ugoa", "rwxXst")] +# Generate all the chmod bindings with some python help: +eval for arg in "rwxXst": cmd("map +u{0} shell -d chmod u+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +g{0} shell -d chmod g+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +o{0} shell -d chmod o+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +a{0} shell -d chmod a+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +{0} shell -d chmod u+{0} %s".format(arg)) + +eval for arg in "rwxXst": cmd("map -u{0} shell -d chmod u-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -g{0} shell -d chmod g-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -o{0} shell -d chmod o-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -a{0} shell -d chmod a-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -{0} shell -d chmod u-{0} %s".format(arg)) # =================================================================== # == Define keys for the console |