summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/defaults/rc.conf3
-rw-r--r--ranger/ext/keybindings.py10
2 files changed, 7 insertions, 6 deletions
diff --git a/ranger/defaults/rc.conf b/ranger/defaults/rc.conf
index 81bd32da..d56c90a9 100644
--- a/ranger/defaults/rc.conf
+++ b/ranger/defaults/rc.conf
@@ -34,6 +34,7 @@ map cd console cd
 # Tagging / Marking
 map t       tag_toggle
 map T       tag_remove
+map "<any>  tag_toggle tag=%any
 map <Space> mark toggle=True
 map v       mark all=True val=True
 map V       mark all=True val=False
@@ -213,8 +214,6 @@ eval import itertools; [cmd("map +%s%s shell -d chmod %s+%s %%s" % (mode+mode))
 # 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 "x tag_toggle tag=x (one mapping for each key)
-eval -q [cmd('map "%s eval fm.tag_toggle(tag=chr(%d))' % (chr(s),s)) for s in range(33, 127)]
 
 
 # ===================================================================
diff --git a/ranger/ext/keybindings.py b/ranger/ext/keybindings.py
index 0c09de11..e53dc890 100644
--- a/ranger/ext/keybindings.py
+++ b/ranger/ext/keybindings.py
@@ -48,9 +48,10 @@ class KeyMaps(dict):
 
 
 class KeyBuffer(object):
-	any_key        = ANYKEY
-	passive_key    = PASSIVE_ACTION
-	quantifier_key = QUANT_KEY
+	any_key             = ANYKEY
+	passive_key         = PASSIVE_ACTION
+	quantifier_key      = QUANT_KEY
+	exclude_from_anykey = [27]
 
 	def __init__(self, keymap=None):
 		self.keymap = keymap
@@ -82,7 +83,8 @@ class KeyBuffer(object):
 			moved = True
 			if key in self.pointer:
 				self.pointer = self.pointer[key]
-			elif self.any_key in self.pointer:
+			elif self.any_key in self.pointer and \
+					key not in self.exclude_from_anykey:
 				self.wildcards.append(key)
 				self.pointer = self.pointer[self.any_key]
 			else: