summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.html
blob: b55b09f6a51e969d21f08e40a13c2f78a966c17e (plain) (blame)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package ranger</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>ranger</strong></big></big> (version 1.0.0)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/ranger/__init__.py">/home/hut/work/ranger/ranger/__init__.py</a></font></td></tr></table>
    <p><tt>Ranger&nbsp;-&nbsp;file&nbsp;browser&nbsp;for&nbsp;the&nbsp;unix&nbsp;terminal</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.__main__.html">__main__</a><br>
<a href="ranger.actions.html">actions</a><br>
<a href="ranger.applications.html">applications</a><br>
<a href="ranger.colorschemes.html"><strong>colorschemes</strong>&nbsp;(package)</a><br>
</td><td width="25%" valign=top><a href="ranger.commands.html">commands</a><br>
<a href="ranger.container.html"><strong>container</strong>&nbsp;(package)</a><br>
<a href="ranger.defaults.html"><strong>defaults</strong>&nbsp;(package)</a><br>
<a href="ranger.ext.html"><strong>ext</strong>&nbsp;(package)</a><br>
</td><td width="25%" valign=top><a href="ranger.fm.html">fm</a><br>
<a href="ranger.fsobject.html"><strong>fsobject</strong>&nbsp;(package)</a><br>
<a href="ranger.gui.html"><strong>gui</strong>&nbsp;(package)</a><br>
<a href="ranger.keyapi.html">keyapi</a><br>
</td><td width="25%" valign=top><a href="ranger.shared.html"><strong>shared</strong>&nbsp;(package)</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>CONFDIR</strong> = '/home/hut/.ranger'<br>
<strong>RANGERDIR</strong> = '/home/hut/work/ranger/ranger'<br>
<strong>USAGE</strong> = '%s [options] [path/filename]'<br>
<strong>__author__</strong> = 'hut'<br>
<strong>__copyright__</strong> = 'none'<br>
<strong>__credits__</strong> = 'hut'<br>
<strong>__email__</strong> = 'hut@lavabit.com'<br>
<strong>__license__</strong> = 'GPL'<br>
<strong>__maintainer__</strong> = 'hut'<br>
<strong>__version__</strong> = '1.0.0'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">hut</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">hut</td></tr></table>
</body></html>
">for key, is_capital in ((key, False), (key.upper(), True)): # reverse if any of the two letters is capital map('o' + key, fm.sort(func=val, reverse=is_capital)) map('O' + key, fm.sort(func=val, reverse=True)) map('or', 'Or', 'oR', 'OR', lambda arg: \ arg.fm.sort(reverse=not arg.fm.settings.reverse)) # ----------------------------------------------- console shortcuts @map("A") def append_to_filename(arg): command = 'rename ' + arg.fm.env.cf.basename arg.fm.open_console(cmode.COMMAND, command) map('cw', fm.open_console(cmode.COMMAND, 'rename ')) map('cd', fm.open_console(cmode.COMMAND, 'cd ')) map('f', fm.open_console(cmode.COMMAND_QUICK, 'find ')) map('tf', fm.open_console(cmode.COMMAND, 'filter ')) map('d', hint='d//u// (disk usage) d//d// (cut)') # --------------------------------------------- jump to directories map('gh', fm.cd('~')) map('ge', fm.cd('/etc')) map('gu', fm.cd('/usr')) map('gd', fm.cd('/dev')) map('gl', fm.cd('/lib')) map('go', fm.cd('/opt')) map('gv', fm.cd('/var')) map('gr', 'g/', fm.cd('/')) map('gm', fm.cd('/media')) map('gn', fm.cd('/mnt')) map('gt', fm.cd('/tmp')) map('gs', fm.cd('/srv')) map('gR', fm.cd(RANGERDIR)) # ------------------------------------------------------- searching map('/', fm.open_console(cmode.SEARCH)) map('n', fm.search()) map('N', fm.search(forward=False)) map(TAB, fm.search(order='tag')) map('cc', fm.search(order='ctime')) map('cm', fm.search(order='mimetype')) map('cs', fm.search(order='size')) map('c', hint='//c//time //m//imetype //s//ize') # ------------------------------------------------------- bookmarks for key in ALLOWED_BOOKMARK_KEYS: map("`" + key, "'" + key, fm.enter_bookmark(key)) map("m" + key, fm.set_bookmark(key)) map("um" + key, fm.unset_bookmark(key)) map("`", "'", "m", draw_bookmarks=True) # ---------------------------------------------------- change views map('i', fm.display_file()) map(ctrl('p'), fm.display_log()) map('?', KEY_F1, fm.display_help()) map('w', lambda arg: arg.fm.ui.open_taskview()) # ------------------------------------------------ system functions _system_functions(map) map('ZZ', fm.exit()) map(ctrl('R'), fm.reset()) map('R', fm.reload_cwd()) map(ctrl('C'), fm.exit()) map(':', ';', fm.open_console(cmode.COMMAND)) map('>', fm.open_console(cmode.COMMAND_QUICK)) map('!', fm.open_console(cmode.OPEN)) map('r', fm.open_console(cmode.OPEN_QUICK)) map.rebuild_paths() def initialize_console_commands(map): """Initialize the commands for the console widget only""" # -------------------------------------------------------- movement map(KEY_UP, wdg.history_move(-1)) map(KEY_DOWN, wdg.history_move(1)) map(ctrl('b'), KEY_LEFT, wdg.move(relative = -1)) map(ctrl('f'), KEY_RIGHT, wdg.move(relative = 1)) map(ctrl('a'), KEY_HOME, wdg.move(absolute = 0)) map(ctrl('e'), KEY_END, wdg.move(absolute = -1)) # ----------------------------------------- deleting / pasting text map(ctrl('d'), KEY_DC, wdg.delete(0)) map(ctrl('h'), KEY_BACKSPACE, DEL, wdg.delete(-1)) map(ctrl('w'), wdg.delete_word()) map(ctrl('k'), wdg.delete_rest(1)) map(ctrl('u'), wdg.delete_rest(-1)) map(ctrl('y'), wdg.paste()) # ----------------------------------------------------- typing keys def type_key(arg): arg.wdg.type_key(arg.keys) for i in range(ord(' '), ord('~')+1): map(i, type_key) # ------------------------------------------------ system functions _system_functions(map) map(KEY_F1, lambda arg: arg.fm.display_command_help(arg.wdg)) map(ctrl('c'), ESC, wdg.close()) map(ctrl('j'), KEY_ENTER, wdg.execute()) map(TAB, wdg.tab()) map(KEY_BTAB, wdg.tab(-1)) map.rebuild_paths() def initialize_taskview_commands(map): """Initialize the commands for the TaskView widget""" _basic_movement(map) _vimlike_aliases(map) _system_functions(map) # -------------------------------------------------- (re)move tasks map('K', wdg.task_move(0)) map('J', wdg.task_move(-1)) map('dd', wdg.task_remove()) # ------------------------------------------------ system functions map('?', fm.display_help()) map('w', 'q', ESC, ctrl('d'), ctrl('c'), lambda arg: arg.fm.ui.close_taskview()) map.rebuild_paths() def initialize_pager_commands(map): _base_pager_commands(map) map('q', 'i', ESC, KEY_F1, lambda arg: arg.fm.ui.close_pager()) map.rebuild_paths() def initialize_embedded_pager_commands(map): _base_pager_commands(map) map('q', 'i', ESC, lambda arg: arg.fm.ui.close_embedded_pager()) map.rebuild_paths() def _base_pager_commands(map): _basic_movement(map) _vimlike_aliases(map) _system_functions(map) # -------------------------------------------------------- movement map(KEY_LEFT, wdg.move_horizontal(relative=-4)) map(KEY_RIGHT, wdg.move_horizontal(relative=4)) map(KEY_NPAGE, wdg.move(relative=1, pages=True)) map(KEY_PPAGE, wdg.move(relative=-1, pages=True)) map(ctrl('d'), wdg.move(relative=0.5, pages=True)) map(ctrl('u'), wdg.move(relative=-0.5, pages=True)) # ---------------------------------------------------------- others map('E', fm.edit_file()) map('?', fm.display_help()) # --------------------------------------------- less-like shortcuts map.alias(KEY_NPAGE, 'd') map.alias(KEY_PPAGE, 'u') def _system_functions(map): # Each commandlist should have this bindings map(KEY_RESIZE, fm.resize()) map(KEY_MOUSE, fm.handle_mouse()) map('Q', fm.exit()) map(ctrl('L'), fm.redraw_window()) def _basic_movement(map): map(KEY_DOWN, wdg.move(relative=1)) map(KEY_UP, wdg.move(relative=-1)) map(KEY_HOME, wdg.move(absolute=0)) map(KEY_END, wdg.move(absolute=-1))