summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-05 14:02:44 +0200
committerhut <hut@lavabit.com>2011-10-05 14:45:35 +0200
commite21fb9b5b6eac911f9061425826b05de97211549 (patch)
treeb8e00b9358df9d4b50ebc238cab693d309a2736c
parentb3874587964240b0f270378c304d6ec1cda55a91 (diff)
downloadranger-e21fb9b5b6eac911f9061425826b05de97211549.tar.gz
defaults/commands: added cunmap, punmap, tunmap
-rw-r--r--doc/ranger.138
-rw-r--r--doc/ranger.pod38
-rw-r--r--ranger/defaults/commands.py26
3 files changed, 97 insertions, 5 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index fbda8fa1..a0ca93bd 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
+.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -124,7 +124,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.5.0" "10/02/2011" "ranger manual"
+.TH RANGER 1 "ranger-1.5.0" "10/05/2011" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -629,6 +629,26 @@ Binds keys for the console. Works like the \f(CW\*(C`map\*(C'\fR command.
 .IX Item "console [-pN] command"
 Opens the console with the command already typed in.  The cursor is placed at
 \&\fIN\fR.
+.IP "copycmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2
+.IX Item "copycmap key newkey [newkey2 ...]"
+See \f(CW\*(C`copymap\*(C'\fR
+.IP "copymap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2
+.IX Item "copymap key newkey [newkey2 ...]"
+Copies the keybinding \fIkey\fR to \fInewkey\fR in the \*(L"browser\*(R" context.  This is a
+deep copy, so if you change the new binding (or parts of it) later, the old one
+is not modified.
+.Sp
+To copy key bindings of the console, taskview, or pager use \*(L"copycmap\*(R",
+\&\*(L"copytmap\*(R" or \*(L"copypmap\*(R".
+.IP "copypmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2
+.IX Item "copypmap key newkey [newkey2 ...]"
+See \f(CW\*(C`copymap\*(C'\fR
+.IP "copytmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2
+.IX Item "copytmap key newkey [newkey2 ...]"
+See \f(CW\*(C`copymap\*(C'\fR
+.IP "cunmap \fIkey\fR \fIcommand\fR" 2
+.IX Item "cunmap key command"
+Removes key mappings of the console. Works like the \f(CW\*(C`unmap\*(C'\fR command.
 .IP "delete [\fIconfirmation\fR]" 2
 .IX Item "delete [confirmation]"
 Destroy all files in the selection with a roundhouse kick.  Ranger will ask for
@@ -690,6 +710,9 @@ in their own sections.
 .IP "pmap \fIkey\fR \fIcommand\fR" 2
 .IX Item "pmap key command"
 Binds keys for the pager. Works like the \f(CW\*(C`map\*(C'\fR command.
+.IP "punmap \fIkey\fR \fIcommand\fR" 2
+.IX Item "punmap key command"
+Removes key mappings of the pager. Works like the \f(CW\*(C`unmap\*(C'\fR command.
 .IP "quit" 2
 .IX Item "quit"
 Like quit!, but closes only this tab if multiple tabs are open.
@@ -742,6 +765,13 @@ Creates an empty file with the name \fIfilename\fR, unless it already exists.
 .IP "tmap \fIkey\fR \fIcommand\fR" 2
 .IX Item "tmap key command"
 Binds keys for the taskview. Works like the \f(CW\*(C`map\*(C'\fR command.
+.IP "tunmap \fIkey\fR \fIcommand\fR" 2
+.IX Item "tunmap key command"
+Removes key mappings of the taskview. Works like the \f(CW\*(C`unmap\*(C'\fR command.
+.IP "unmap [\fIkeys\fR ...]" 2
+.IX Item "unmap [keys ...]"
+Removes the given key mappings in the \*(L"browser\*(R" context.  To unmap key bindings
+in the console, taskview, or pager use \*(L"cunmap\*(R", \*(L"tunmap\*(R" or \*(L"punmap\*(R".
 .IP "unmark \fIpattern\fR" 2
 .IX Item "unmark pattern"
 Unmark all files matching a regular expression pattern.
@@ -877,8 +907,8 @@ original one.
 \&\s-1GNU\s0 General Public License 3 or (at your option) any later version.
 .SH "LINKS"
 .IX Header "LINKS"
-.IP "Download: <http://ranger.nongnu.org/ranger\-stable.tar.gz>" 4
-.IX Item "Download: <http://ranger.nongnu.org/ranger-stable.tar.gz>"
+.IP "Download: http://ranger.nongnu.org/ranger\-stable.tar.gz <http://ranger.nongnu.org/ranger-stable.tar.gz>" 4
+.IX Item "Download: http://ranger.nongnu.org/ranger-stable.tar.gz <http://ranger.nongnu.org/ranger-stable.tar.gz>"
 .PD 0
 .IP "The project page: <http://ranger.nongnu.org/>" 4
 .IX Item "The project page: <http://ranger.nongnu.org/>"
diff --git a/doc/ranger.pod b/doc/ranger.pod
index b8d779c1..dd9c89bc 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -652,6 +652,31 @@ Binds keys for the console. Works like the C<map> command.
 Opens the console with the command already typed in.  The cursor is placed at
 I<N>.
 
+=item copycmap I<key> I<newkey> [I<newkey2> ...]
+
+See C<copymap>
+
+=item copymap I<key> I<newkey> [I<newkey2> ...]
+
+Copies the keybinding I<key> to I<newkey> in the "browser" context.  This is a
+deep copy, so if you change the new binding (or parts of it) later, the old one
+is not modified.
+
+To copy key bindings of the console, taskview, or pager use "copycmap",
+"copytmap" or "copypmap".
+
+=item copypmap I<key> I<newkey> [I<newkey2> ...]
+
+See C<copymap>
+
+=item copytmap I<key> I<newkey> [I<newkey2> ...]
+
+See C<copymap>
+
+=item cunmap I<key> I<command>
+
+Removes key mappings of the console. Works like the C<unmap> command.
+
 =item delete [I<confirmation>]
 
 Destroy all files in the selection with a roundhouse kick.  Ranger will ask for
@@ -725,6 +750,10 @@ in their own sections.
 
 Binds keys for the pager. Works like the C<map> command.
 
+=item punmap I<key> I<command>
+
+Removes key mappings of the pager. Works like the C<unmap> command.
+
 =item quit
 
 Like quit!, but closes only this tab if multiple tabs are open.
@@ -786,6 +815,15 @@ Creates an empty file with the name I<filename>, unless it already exists.
 
 Binds keys for the taskview. Works like the C<map> command.
 
+=item tunmap I<key> I<command>
+
+Removes key mappings of the taskview. Works like the C<unmap> command.
+
+=item unmap [I<keys> ...]
+
+Removes the given key mappings in the "browser" context.  To unmap key bindings
+in the console, taskview, or pager use "cunmap", "tunmap" or "punmap".
+
 =item unmark I<pattern>
 
 Unmark all files matching a regular expression pattern.
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index 61f6f0cd..d046d5a6 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -859,7 +859,7 @@ class copytmap(copymap):
 class unmap(Command):
 	"""
 	:unmap <keys> [<keys2>, ...]
-	Remove the given mappings
+	Remove the given "browser" mappings
 	"""
 	context = 'browser'
 
@@ -868,6 +868,30 @@ class unmap(Command):
 			self.fm.env.keymaps.unbind(self.context, arg)
 
 
+class cunmap(unmap):
+	"""
+	:cunmap <keys> [<keys2>, ...]
+	Remove the given "console" mappings
+	"""
+	context = 'browser'
+
+
+class punmap(unmap):
+	"""
+	:punmap <keys> [<keys2>, ...]
+	Remove the given "pager" mappings
+	"""
+	context = 'pager'
+
+
+class tunmap(unmap):
+	"""
+	:tunmap <keys> [<keys2>, ...]
+	Remove the given "taskview" mappings
+	"""
+	context = 'taskview'
+
+
 class map_(Command):
 	"""
 	:map <keysequence> <command>