summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-08 06:08:35 +0200
committerhut <hut@lavabit.com>2011-10-08 06:09:03 +0200
commit320daab95cf28ca813f27e0a01657f64f2a1f727 (patch)
tree0d3ad9555597a139b374411416dc4b81b4d6ccc2 /ranger
parent1d27a413986bfdcecb3c7ea67f327d20dc9a029f (diff)
downloadranger-320daab95cf28ca813f27e0a01657f64f2a1f727.tar.gz
data/config_examples/rc.conf: written
Diffstat (limited to 'ranger')
-rw-r--r--ranger/data/config_examples/rc.conf39
1 files changed, 39 insertions, 0 deletions
diff --git a/ranger/data/config_examples/rc.conf b/ranger/data/config_examples/rc.conf
index e69de29b..47ffe5a8 100644
--- a/ranger/data/config_examples/rc.conf
+++ b/ranger/data/config_examples/rc.conf
@@ -0,0 +1,39 @@
+# ===================================================================
+# This file contains startup commands for ranger.
+#
+# The purpose of this file is mainly to define keybindings.  For
+# changing settings or running more complex python code, use the
+# configuration file "options.py" or define commands in "commands.py".
+#
+# Each line is a command that will be run before the user interface
+# is initialized.  As a result, you can not use commands which rely on
+# the UI such as :delete or :mark.  Lines starting with # are comments.
+# ===================================================================
+
+# common directories (this overrides some default keybindings)
+#map gt cd /tmp
+#map gc cd ~/.config
+#map gp cd /usr/portage
+
+# Unbind "q" so you don't accidentally close ranger
+#unmap q
+
+# Edit files with the lowercase "e".  By default, uppercase "E" is used.
+#copymap E e
+
+# Add a key for searching files with a given string in their name
+#map F console shell -p find . | grep -Iinr --color 
+
+# Find all files in this directory, shuffle them and view in mplayer
+#map M shell find . | shuf | xargs -d \\n mplayer -fs
+
+# Add some keys to edit configuration files
+#map ,r chain shell vim ~/.config/ranger/rc.conf; source_cmdlist ~/.config/ranger/rc.conf
+#map ,a shell vim ~/.config/ranger/apps.py
+#map ,c shell vim ~/.config/ranger/commands.py
+#map ,o shell vim ~/.config/ranger/options.py
+#map ,R shell vim %rangerdir/defaults/rc.conf
+#map ,A shell vim %rangerdir/defaults/apps.py
+#map ,C shell vim %rangerdir/defaults/commands.py
+#map ,O shell vim %rangerdir/defaults/options.py
+#map ,n shell vim %rangerdir/core/actions.py
History Object + Test Case' href='/akspecs/ranger/commit/test/tc_history.py?h=v1.5.2&id=22bb7e358ccd6efc58c38b8703b6818131905a75'>22bb7e35 ^
3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
22bb7e35 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
                                                            
 
                                    



                                   
                               






                                                     
                                                   

                                                   

                                               
                           
                                                   

                                                 


                                                               
                           
                                                      
 
                                               


                              
                                                   








                                                     
if __name__ == '__main__': from __init__ import init; init()

from ranger.container import History
from unittest import TestCase, main
import unittest

class Test(TestCase):
	def test_history(self):
		hist = History(3)
		for i in range(6):
			hist.add(i)
		self.assertEqual([3,4,5], list(hist))

		hist.back()

		self.assertEqual(4, hist.current())
		self.assertEqual([3,4], list(hist))

		self.assertEqual(5, hist.top())

		hist.back()
		self.assertEqual(3, hist.current())
		self.assertEqual([3], list(hist))

		# no change if current == bottom
		self.assertEqual(hist.current(), hist.bottom())
		last = hist.current()
		hist.back()
		self.assertEqual(hist.current(), last)

		self.assertEqual(5, hist.top())

		hist.forward()
		hist.forward()
		self.assertEqual(5, hist.current())
		self.assertEqual([3,4,5], list(hist))


		self.assertEqual(3, hist.bottom())
		hist.add(6)
		self.assertEqual(4, hist.bottom())
		self.assertEqual([4,5,6], list(hist))

if __name__ == '__main__': main()