From 4833bc2383e30ccd3fb500497e9d1af7d056f066 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 28 Sep 2011 22:46:37 +0200 Subject: shortened README, added early reference to the man page --- README | 105 ++++++++++++----------------------------------------------------- 1 file changed, 19 insertions(+), 86 deletions(-) (limited to 'README') diff --git a/README b/README index 2b46411f..be6ad997 100644 --- a/README +++ b/README @@ -14,6 +14,25 @@ The program is written in Python (2.6 or 3.1) and uses curses for the text-based user interface. +Getting Started +--------------- + +Ranger can be started without installing: Just run ranger.py. If you want to +install it anyway, the INSTALL file contains instructions. + +After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter +to open a file or type Q to quit. The column on the right shows a preview of +the current file. The second from the right is the main column and the others +show parent directories. + +The manual page of ranger contains a documentation of rangers functions, +keybindings, commands and options. You can access it by typing "?" in ranger, +running "man ranger" or view it online. + +An easy way to customize ranger is running "ranger --copy-config=all" +and editing the new files in ~/.config/ranger/. + + About ----- @@ -68,89 +87,3 @@ For scope.sh: (enhanced file previews) * highlight for syntax highlighting of code * atool for previews of archives * lynx or elinks for previews of html pages - - -Getting Started ---------------- - -Ranger can be started without installing. Just run the executable (in -a terminal.) The switch "--clean" will prevent it from creating or -accessing configuration files. - -Follow the instructions in the INSTALL file for installing ranger. - -After starting ranger, you should see 4 columns. The third one is the main -column, the directory where you're currently at. To the left you see the -parent directories and to the right there's a preview of the object you're -pointing at. Now use the Arrow Keys to navigate, Enter to open a file -or type Q to quit. - -To customize ranger, copy the files from ranger/defaults/ to ~/.config/ranger/ -and modify them according to your wishes. - - -Combine Ranger With Other Applications --------------------------------------- - -1. bash: - -Add this to your ~/.bashrc to use ranger as a directory switcher: - -function ranger-cd { - ranger --choosedir=/tmp/chosen - if [ -f /tmp/chosen -a "$(cat /tmp/chosen)" != "$(pwd | tr -d "\n")" ]; then - cd "$(cat /tmp/chosen)" - fi - rm -f /tmp/chosen -} -bind '"\C-o":"ranger-cd\C-m"' - -Now when you run ranger-cd, browse and quit, the directory of the bash process -you started ranger in will change to the last directroy in ranger. -To change back to the previous directory, you can type: cd - -Also, the line with "bind" will map the key to start ranger. - -2. vim: - -Add this function to your ~/.vimrc: - -fun Ranger() - silent !ranger --choosefile=/tmp/chosen - if filereadable('/tmp/chosen') - exec 'edit ' . system('cat /tmp/chosen') - call system('rm /tmp/chosen') - endif - redraw! -endfun -map r :call Ranger() - -This starts ranger when you type r (usually \r) and if you open a file -in ranger it will be opened in the original vim process. - - -Troubleshooting, Getting Help ------------------------------ - -If you encounter an error, try running ranger with --debug. This will -sometimes display more detailed information about the error. Also, try -deactivating optimization: - -PYTHONOPTIMIZE="" ranger --debug - -Report bugs on savannah: (please include as much information as possible) -http://savannah.nongnu.org/bugs/?func=additem&group=ranger - -Ask questions on the mailing list: -http://lists.nongnu.org/mailman/listinfo/ranger-users - - -Further Reading ---------------- - -Check the man page for information on common features and hotkeys. - -The most detailed manual is accessible by pressing "?" from inside ranger. -It is also available at ranger/help/, contained in the *.py files. - -The file ranger/defaults/keys.py contains all key combinations, so that's -another place you may want to check out. -- cgit 1.4.1-2-gfad0 From 4a383291629a6a1e0bbd531a02466d267d553c5e Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 29 Sep 2011 02:52:05 +0200 Subject: A little README update --- README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'README') diff --git a/README b/README index be6ad997..8f87298e 100644 --- a/README +++ b/README @@ -65,6 +65,7 @@ Features * Multi-column display (Miller Columns) * Preview of the selected file/directory * Common file operations (create/chmod/copy/delete/...) +* Renaming multiple files at once * VIM-like console and hotkeys * Automatically determine file types and run them with correct programs * Change the directory of your shell after exiting ranger @@ -74,8 +75,8 @@ Features Dependencies ------------ -* A *nix-like operating system -* Python 2.6 or Python 3.1 with the curses module +* Python 2.6, 2.7 or Python 3.1 with the curses module +(Later versions might work too, but 2.5 definitely won't.) Optional: * The "file" program -- cgit 1.4.1-2-gfad0 From f7894a1583f82e1ba97d0aefcbc19cf1bf1fc936 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 2 Oct 2011 18:45:56 +0200 Subject: Changed version to 1.5.0 --- README | 2 +- doc/ranger.1 | 2 +- ranger/__init__.py | 2 +- ranger/core/helper.py | 11 +---------- 4 files changed, 4 insertions(+), 13 deletions(-) (limited to 'README') diff --git a/README b/README index 94aa19c6..e48edeb8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Ranger v.1.4.4 +Ranger v.1.5.0 ============== Ranger is a free console file manager that gives you greater flexibility diff --git a/doc/ranger.1 b/doc/ranger.1 index 7bf94b41..fbda8fa1 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.4.3" "10/01/2011" "ranger manual" +.TH RANGER 1 "ranger-1.5.0" "10/02/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 diff --git a/ranger/__init__.py b/ranger/__init__.py index 3d2633cd..32a31eae 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -29,7 +29,7 @@ from ranger.core.main import main # Information __license__ = 'GPL3' -__version__ = '1.4.4' +__version__ = '1.5.0' __author__ = __maintainer__ = 'Roman Zimbelmann' __email__ = 'romanz@lavabit.com' diff --git a/ranger/core/helper.py b/ranger/core/helper.py index d8081b01..090a475a 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -35,16 +35,7 @@ def parse_arguments(): default_confdir = '~/.config/ranger' usage = '%prog [options] [path/filename]' - minor_version = __version__[2:] # assumes major version number is <10 - if '.' in minor_version: - minor_version = minor_version[:minor_version.find('.')] - version_tag = ' (stable)' if int(minor_version) % 2 == 0 else ' (testing)' - if __version__.endswith('.0'): - version_string = 'ranger ' + __version__[:-2] + version_tag - else: - version_string = 'ranger ' + __version__ + version_tag - - parser = OptionParser(usage=usage, version=version_string) + parser = OptionParser(usage=usage, version='ranger '+__version__) parser.add_option('-d', '--debug', action='store_true', help="activate debug mode") -- cgit 1.4.1-2-gfad0 From 240394a494b0bbb854687a34941bf90a5ccd5b4d Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 5 Oct 2011 18:15:35 +0200 Subject: README: polished, removed INSTALL --- INSTALL | 23 ---------------- README | 92 ++++++++++++++++++++++++++++++--------------------------------- ranger.py | 7 ++--- 3 files changed, 46 insertions(+), 76 deletions(-) delete mode 100644 INSTALL (limited to 'README') diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 8ba89921..00000000 --- a/INSTALL +++ /dev/null @@ -1,23 +0,0 @@ -Installing -========== - -Use the package manager of your operating system to install ranger. - -To install ranger manually, use either: -sudo ./setup.py install --optimize=1 --record=install_log.txt - -or for short: -sudo make install - - -Uninstalling -============ - -Again, use your package manager to uninstall ranger. No other way for -automatically removing ranger is supported! - -However, if you installed ranger with the command above, all installed files -have been recorded to "install_log.txt". This information can be used to remove -ranger by hand, e.g.: - -cat install_log.txt | sed s/\^/\\// | xargs -d "\n" sudo rm -- diff --git a/README b/README index e48edeb8..57fce508 100644 --- a/README +++ b/README @@ -1,58 +1,27 @@ -Ranger v.1.5.0 +ranger v.1.5.0 ============== +ranger is a file manager with VI key bindings. It provides a minimalistic yet +nice curses interface with a view on the directory hierarchy. The secondary +task of ranger is to psychically guess which program you want to use for +opening particular files. -Ranger is a free console file manager that gives you greater flexibility -and a good overview of your files without having to leave your *nix console. -It visualizes the directory tree in two dimensions: the directory hierarchy -on one, lists of files on the other, with a preview to the right so you know -where you'll be going. - -The default keys are similar to those of Vim, Emacs and Midnight Commander, -though Ranger is easily controllable with just the arrow keys or the mouse. - -The program is written in Python (2.6 or 3.1) and uses curses for the -text-based user interface. - - -Getting Started ---------------- - -Ranger can be started without installing: Just run ranger.py. If you want to -install it anyway, the INSTALL file contains instructions. - -After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter -to open a file or type Q to quit. The column on the right shows a preview of -the current file. The second from the right is the main column and the others -show parent directories. - -The manual page of ranger contains a documentation of rangers functions, -keybindings, commands and options. You can access it by typing "?" in ranger, -running "man ranger" or view it online. - -An easy way to customize ranger is running "ranger --copy-config=all" -and editing the new files in ~/.config/ranger/. +This file describes ranger and how to get it to run. For instructions on the +usage, please read the man page. About ----- +* Authors: Check the copyright notices in each source file +* License: GNU General Public License Version 3 -* Authors: Check the copyright notices in each source file -* Website: http://ranger.nongnu.org/ -* License: GNU General Public License Version 3 - -* Download URL of the newest stable version: -http://ranger.nongnu.org/ranger-stable.tar.gz - -* Git Clone URL: -git clone http://git.sv.gnu.org/r/ranger.git - -* Bug report: -https://savannah.nongnu.org/bugs/?group=ranger&func=additem +* Website: http://ranger.nongnu.org/ +* Download: http://ranger.nongnu.org/ranger-stable.tar.gz +* GIT Clone: http://git.sv.gnu.org/r/ranger.git +* Bug reports: https://savannah.nongnu.org/bugs/?group=ranger&func=additem Design Goals ------------ - * An easily maintainable file manager in a high level language * A quick way to switch directories and browse the file system * Keep it small but useful, do one thing and do it well @@ -61,7 +30,7 @@ Design Goals Features -------- - +* UTF-8 Support (if your python copy supports it) * Multi-column display (Miller Columns) * Preview of the selected file/directory * Common file operations (create/chmod/copy/delete/...) @@ -74,9 +43,7 @@ Features Dependencies ------------ - -* Python 2.6, 2.7 or Python 3.1 with the curses module -(Later versions might work too, but 2.5 definitely won't.) +* Python (tested with version 2.6, 2.7, 3.1, 3.2) with the curses module Optional: * The "file" program @@ -88,3 +55,32 @@ For scope.sh: (enhanced file previews) * highlight for syntax highlighting of code * atool for previews of archives * lynx or elinks for previews of html pages + + +Installing +---------- + +Use the package manager of your operating system to install ranger. + +To install ranger manually: + sudo make install + +This translates roughly to: + sudo ./setup.py install --optimize=1 --record=install_log.txt + +This also saves a list of all installed files to install_log.txt, which you can +use to uninstall ranger. + + +Getting Started +--------------- +ranger can be started without installing: Just run ranger.py. If you want to +install it anyway, the INSTALL file contains instructions. + +After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter +to open a file or type Q to quit. The column on the right shows a preview of +the current file. The second from the right is the main column and the others +show parent directories. + +An easy way to customize ranger is running "ranger --copy-config=all" +and editing the new files in ~/.config/ranger/. diff --git a/ranger.py b/ranger.py index 2a9c68a0..29f0a636 100755 --- a/ranger.py +++ b/ranger.py @@ -1,5 +1,5 @@ #!/usr/bin/python -O -# -*- coding: utf-8 -*- +# ranger - a vim-inspired file manager for the console (coding: utf-8) # Copyright (C) 2009, 2010 Roman Zimbelmann # # This program is free software: you can redistribute it and/or modify @@ -33,7 +33,7 @@ if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then rm -f -- "$tempfile" fi return $returnvalue -""" +""" and None import sys from os.path import exists, abspath @@ -43,9 +43,6 @@ from os.path import exists, abspath argv = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:] sys.dont_write_bytecode = '-c' in argv or '--clean' in argv -# Set the actual docstring -__doc__ = """Ranger - file browser for the unix terminal""" - # Don't import ./ranger when running an installed binary at /usr/.../ranger if __file__[:4] == '/usr' and exists('ranger') and abspath('.') in sys.path: sys.path.remove(abspath('.')) -- cgit 1.4.1-2-gfad0 From 7bf5f9672ee79489553506831b7cab54a8609077 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 7 Oct 2011 02:40:19 +0200 Subject: general updates --- README | 16 +++-- doc/HACKING | 28 ++------- doc/ranger.1 | 15 +++-- doc/ranger.pod | 13 +++-- ranger/__init__.py | 23 +++++--- ranger/core/actions.py | 2 +- ranger/core/fm.py | 4 +- ranger/core/helper.py | 7 +-- ranger/data/config_examples/options.py | 103 ++++++++++++++++++++++++++++----- 9 files changed, 142 insertions(+), 69 deletions(-) (limited to 'README') diff --git a/README b/README index 57fce508..3cf0bfde 100644 --- a/README +++ b/README @@ -1,12 +1,18 @@ ranger v.1.5.0 ============== -ranger is a file manager with VI key bindings. It provides a minimalistic yet -nice curses interface with a view on the directory hierarchy. The secondary -task of ranger is to psychically guess which program you want to use for -opening particular files. +ranger is a console file manager with VI key bindings. It provides a +minimalistic yet nice curses interface with a view on the directory hierarchy. +The secondary task of ranger is to psychically guess which program you want to +use for opening particular files. This file describes ranger and how to get it to run. For instructions on the -usage, please read the man page. +usage, please read the man page. See doc/HACKING for development specific +information. For configuration, check the sample files that ranger creates +in your ~/.config/ranger directory. + +A note to packagers: Versions meant for packaging are listed in the changelog +on the website and are taken from the stable branch. The master branch is a +"work in progress" branch. About diff --git a/doc/HACKING b/doc/HACKING index dd384758..f6d5d064 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -10,7 +10,7 @@ Coding Style http://www.python.org/dev/peps/pep-0008/ * Although this guide suggests otherwise, tabs are used for indentation of code and docstrings. In other documents (readme, etc), use spaces. -* Test the code with unit tests where it makes sense +* Test the code with "doctest" where it makes sense Patches @@ -35,29 +35,25 @@ ranger/fsobject/fsobject.py About the UI: ranger/gui/widgets/browsercolumn.py ranger/gui/widgets/browserview.py -ranger/gui/defaultui.py +ranger/gui/ui.py Common Changes -------------- * Change which files are previewed in the auto preview: -In ranger/gui/widget/browsercolumn.py +In ranger/fsobject/file.py the constant PREVIEW_BLACKLIST * Adding options: In ranger/defaults/options.py add the default value, like: my_option = True -In ranger/shared/settings.py +In ranger/container/settingobject.py add the name of your option to the constant ALLOWED_SETTINGS The setting is now accessible at self.settings.my_option, assuming is a "SettingsAware" object. -* Changing commands, adding aliases: -ranger/defaults/commands.py -or ~/.config/ranger/commands.py - * Adding colorschemes: Copy ranger/colorschemes/default.py to ranger/colorschemes/myscheme.py and modify it according to your needs. Alternatively, mimic the jungle @@ -66,15 +62,6 @@ In ranger/defaults/options.py (or ~/.config/ranger/options.py), change colorscheme = 'default' to: colorscheme = 'myscheme' -* Change which files are considered to be "hidden": -In ranger/defaults/options.py -change the hidden_filter regular expression. - -* Change the key map: -Modify ranger/defaults/keys.py. This should be self-explanatory. -Check out ranger/core/actions.py for the most common actions, of course -you can also use your own functions. - * Change the file type => application associations: In ranger/defaults/apps.py modify the method app_default. @@ -88,8 +75,5 @@ Modify ranger/data/mime.types Version Numbering ----------------- -X.Y.Z, where: - -* X: Major version, milestone -* Y: Minor version, even number => stable version -* Z: Revision, may be omitted if zero +Three numbers; The first changes on a rewrite, the second changes when major +configuration incompatibilities occur and the third changes with each release. diff --git a/doc/ranger.1 b/doc/ranger.1 index de50f621..19a0bb42 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.5.0" "10/05/2011" "ranger manual" +.TH RANGER 1 "ranger-1.5.0" "10/07/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 @@ -139,10 +139,15 @@ ranger \- visual file manager [\fB\-\-flags\fR=\fIflags\fR] [\fIpath/filename\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" -ranger is a file manager with \s-1VI\s0 key bindings. It provides a minimalistic yet -nice curses interface with a view on the directory hierarchy. The secondary -task of ranger is to psychically guess which program you want to use for -opening particular files. +ranger is a console file manager with \s-1VI\s0 key bindings. It provides a +minimalistic yet nice curses interface with a view on the directory hierarchy. +The secondary task of ranger is to psychically guess which program you want to +use for opening particular files. +.PP +This manual mainly contains information on the usage of ranger. Refer to the +\&\fI\s-1README\s0\fR for install instructions and to \fIdoc/HACKING\fR for development +specific information. For configuration, check the sample files that ranger +created in your \fI~/.config/ranger\fR directory. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-d\fR, \fB\-\-debug\fR" 14 diff --git a/doc/ranger.pod b/doc/ranger.pod index eaadcf5b..ab876d7f 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -17,10 +17,15 @@ B [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] =head1 DESCRIPTION -ranger is a file manager with VI key bindings. It provides a minimalistic yet -nice curses interface with a view on the directory hierarchy. The secondary -task of ranger is to psychically guess which program you want to use for -opening particular files. +ranger is a console file manager with VI key bindings. It provides a +minimalistic yet nice curses interface with a view on the directory hierarchy. +The secondary task of ranger is to psychically guess which program you want to +use for opening particular files. + +This manual mainly contains information on the usage of ranger. Refer to the +F for install instructions and to F for development +specific information. For configuration, check the sample files that ranger +created in your F<~/.config/ranger> directory. diff --git a/ranger/__init__.py b/ranger/__init__.py index 32a31eae..f6d6529b 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -14,18 +14,14 @@ # along with this program. If not, see . """ -Console-based visual file manager. +A console file manager with VI key bindings. -Ranger is a file manager with an ncurses frontend written in Python. -It is designed to give you a broader overview of the file system by -displaying previews and backviews, dividing the screen into columns. - -The keybindings are similar to those of other console programs like -vim, mutt or ncmpcpp so the usage will be intuitive and efficient. +It provides a minimalistic yet nice curses interface with a view on the +directory hierarchy. The secondary task of ranger is to psychically guess +which program you want to use for opening particular files. """ import os -from ranger.core.main import main # Information __license__ = 'GPL3' @@ -35,3 +31,14 @@ __email__ = 'romanz@lavabit.com' # Constants RANGERDIR = os.path.dirname(__file__) +TICKS_BEFORE_COLLECTING_GARBAGE = 100 +TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200 +MACRO_DELIMITER = '%' +LOGFILE = '/tmp/errorlog' +USAGE = '%prog [options] [path/filename]' + +# If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored +# and the configuration directory will be $XDG_CONFIG_HOME/ranger instead. +CONFDIR = '~/.config/ranger' + +from ranger.core.main import main diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 58edc56a..9f7321be 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -38,7 +38,7 @@ MACRO_FAIL = "<\x01\x01MACRO_HAS_NO_VALUE\x01\01>" class _MacroTemplate(string.Template): """A template for substituting macros in commands""" - delimiter = '%' + delimiter = ranger.MACRO_DELIMITER class Actions(FileManagerAware, EnvironmentAware, SettingsAware): search_method = 'ctime' diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 9192f15c..6d772054 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -25,6 +25,7 @@ import stat import sys import ranger +from ranger import * from ranger.core.actions import Actions from ranger.container.tags import Tags from ranger.gui.ui import UI @@ -36,9 +37,6 @@ from ranger.ext.signals import SignalDispatcher from ranger import __version__ from ranger.core.loader import Loader -TICKS_BEFORE_COLLECTING_GARBAGE = 100 -TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200 - class FM(Actions, SignalDispatcher): input_blocked = False input_blocked_until = 0 diff --git a/ranger/core/helper.py b/ranger/core/helper.py index 9a403a15..f4035ef8 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -20,8 +20,6 @@ import os.path import sys from ranger import * -LOGFILE = '/tmp/errorlog' - def parse_arguments(): """Parse the program arguments""" from optparse import OptionParser, SUPPRESS_HELP @@ -32,10 +30,9 @@ def parse_arguments(): if 'XDG_CONFIG_HOME' in os.environ and os.environ['XDG_CONFIG_HOME']: default_confdir = os.environ['XDG_CONFIG_HOME'] + '/ranger' else: - default_confdir = '~/.config/ranger' - usage = '%prog [options] [path/filename]' + default_confdir = CONFDIR - parser = OptionParser(usage=usage, version='ranger '+__version__) + parser = OptionParser(usage=USAGE, version='ranger '+__version__) parser.add_option('-d', '--debug', action='store_true', help="activate debug mode") diff --git a/ranger/data/config_examples/options.py b/ranger/data/config_examples/options.py index e37605ce..7006ebd5 100644 --- a/ranger/data/config_examples/options.py +++ b/ranger/data/config_examples/options.py @@ -1,32 +1,103 @@ # =================================================================== -# This is the main configuration file of ranger. It consists of python code, -# but fear not, you don't need any python knowledge for this. +# This is the main configuration file of ranger. It consists of python +# code, but fear not, you don't need any python knowledge for changing +# the settings. # # Lines beginning with # are comments. To enable a line, remove the #. # -# Technical information: This file is imported as a python module. Every -# top-level variable with the name of a ranger setting will be used to change -# the value of that setting. You can use "del " to avoid that. +# Here are the most important settings. Refer to the man page for +# a list and descriptions of all settings. # =================================================================== -# This line imports some basic variables to get some basic variables +# This line imports some basic variables from ranger.api.options import * -# T -#column_ratios = (1, 1, 4, 3) +# Ranger can use a customizable external script for previews. The included +# default script prints previews of archives, html/pdf documents and even +# images. This is, however, disabled by default for performance reasons. Turn +# it on by uncommenting this line: +#use_preview_script = True -# A function that adds an additional macro: +# This changes the location of the preview script +#preview_script = "~/.config/ranger/scope.sh" + +# Use a simple character-wise sort algorithm instead of the default natural +# sorting. This is faster, although the difference is hardly noticeable. +#sort = "basename" + +# Use a unicode "..." symbol when filenames are truncated. This is disabled +# by default since some systems don't support unicode+curses well. +#unicode_ellipsis = True + +# Uncomment these lines to disable previews by default? +#preview_files = False +#preview_directories = False + +# xterm handles the ALT key differently. If you use xterm, uncomment this line +#xterm_alt_key = True + +# Change what files ranger should hide with this setting. Its value is a +# "regular expression". If you don't know about them, there are lots of good +# tutorials on the web! Below is the default value. +#hidden_filter = regexp(r"^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__cache__$") + + +# =================================================================== +# Beware: from here on, you are on your own. This part requires python +# knowledge. +# +# Since python is a dynamic language, it gives you the power to replace any +# part of ranger without touching the code. This is commonly referred to as +# Monkey Patching and can be helpful if you, for some reason, don't want to +# modify rangers code directly. Just remember: the more you mess around, the +# more likely it is to break when you switch to another version. Here are some +# practical examples of monkey patching. # +# Technical information: This file is imported as a python module. If a +# variable has the name of a setting, ranger will attempt to use it to change +# that setting. You can write "del " to avoid that. +# =================================================================== +# Add a new sorting algorithm: Random sort. +# Enable this with :set sort=random + +#from ranger.fsobject.directory import Directory +#from random import random +#Directory.sort_dict['random'] = lambda path: random() + +# =================================================================== +# A function that changes which files are displayed. This is more powerful +# than the hidden_filter setting since this function has more information. + +## Save the original filter function +#import ranger.fsobject.directory +#old_accept_file = ranger.fsobject.directory.accept_file + +## Define a new one +#def accept_file_MOD(fname, mypath, hidden_filter, name_filter): +# if mypath == '/' and fname in ('boot', 'sbin', 'proc', 'sys'): +# return False +# else: +# return old_accept_file(fname, mypath, hidden_filter, name_filter) + +## Overwrite the old function +#import ranger.fsobject.directory +#ranger.fsobject.directory.accept_file = accept_file_MOD + +# =================================================================== +# A function that adds an additional macro. Test this with :shell -p echo %date + ## Save the original macro function -#import ranger.actions -#old_get_macros = ranger.actions.Actions.get_macros +#import ranger.core.actions +#old_get_macros = ranger.core.actions.Actions._get_macros # ## Define a new macro function #import time -#def add_my_macro(self): -# macros = old_get_macros(self) -# macros['date'] = time.strftime('%m/%d/%Y') -# return macros +#def get_macros_MOD(self): +# macros = old_get_macros(self) +# macros['date'] = time.strftime('%m/%d/%Y') +# return macros # ## Overwrite the old one -#ranger.actions.Actions.get_macros = add_my_macro +#ranger.core.actions.Actions._get_macros = get_macros_MOD + +# =================================================================== -- cgit 1.4.1-2-gfad0 From 7dc8fef89688b92ff03ec8005e57286751d0c539 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 8 Oct 2011 19:32:55 +0200 Subject: README: Update --- README | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'README') diff --git a/README b/README index 3cf0bfde..52142aa8 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ ranger v.1.5.0 ============== ranger is a console file manager with VI key bindings. It provides a -minimalistic yet nice curses interface with a view on the directory hierarchy. -The secondary task of ranger is to psychically guess which program you want to -use for opening particular files. +minimalistic and nice curses interface with a view on the directory hierarchy. +The secondary task of ranger is to figure out which program you want to use to +open your files with. This file describes ranger and how to get it to run. For instructions on the usage, please read the man page. See doc/HACKING for development specific @@ -11,8 +11,7 @@ information. For configuration, check the sample files that ranger creates in your ~/.config/ranger directory. A note to packagers: Versions meant for packaging are listed in the changelog -on the website and are taken from the stable branch. The master branch is a -"work in progress" branch. +on the website. About @@ -22,8 +21,8 @@ About * Website: http://ranger.nongnu.org/ * Download: http://ranger.nongnu.org/ranger-stable.tar.gz -* GIT Clone: http://git.sv.gnu.org/r/ranger.git * Bug reports: https://savannah.nongnu.org/bugs/?group=ranger&func=additem +* git clone http://git.sv.gnu.org/r/ranger.git Design Goals @@ -37,7 +36,7 @@ Design Goals Features -------- * UTF-8 Support (if your python copy supports it) -* Multi-column display (Miller Columns) +* Multi-column display * Preview of the selected file/directory * Common file operations (create/chmod/copy/delete/...) * Renaming multiple files at once @@ -50,43 +49,45 @@ Features Dependencies ------------ * Python (tested with version 2.6, 2.7, 3.1, 3.2) with the curses module + and, optionally, support for wide-unicode. Optional: * The "file" program * A pager ("less" by default) * The python module "chardet", in case of encoding detection problems -For scope.sh: (enhanced file previews) +Optional, for enhanced file previews (with "scope.sh"): * img2txt (from caca-utils) for previewing images * highlight for syntax highlighting of code * atool for previews of archives -* lynx or elinks for previews of html pages +* lynx, w3m or elinks for previews of html pages +* pdftotext for pdf previews +* transmission-show for viewing bit-torrent information +* mediainfo for viewing information about media files Installing ---------- - Use the package manager of your operating system to install ranger. +Note that ranger can be started without installing by simply running ranger.py. To install ranger manually: sudo make install This translates roughly to: - sudo ./setup.py install --optimize=1 --record=install_log.txt + sudo python setup.py install --optimize=1 --record=install_log.txt This also saves a list of all installed files to install_log.txt, which you can use to uninstall ranger. - Getting Started --------------- -ranger can be started without installing: Just run ranger.py. If you want to -install it anyway, the INSTALL file contains instructions. - After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter -to open a file or type Q to quit. The column on the right shows a preview of -the current file. The second from the right is the main column and the others -show parent directories. - -An easy way to customize ranger is running "ranger --copy-config=all" -and editing the new files in ~/.config/ranger/. +to open a file or type Q to quit. The third column shows a preview of the +current file. The second is the main column and the first shows the parent +directory. + +Ranger will automatically copy simple configuration files to ~/.config/ranger. +If you mess them up, just delete them and ranger will copy them again. Run +ranger with --dont-copy-config to disable this. Also check ranger/defaults/ +for the default configuration. -- cgit 1.4.1-2-gfad0 From 070698886dbe2abfba7b2d9464dc01bf1555b3da Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 8 Oct 2011 21:13:14 +0200 Subject: README: Updated dependencies --- README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README') diff --git a/README b/README index 52142aa8..7719886b 100644 --- a/README +++ b/README @@ -48,12 +48,12 @@ Features Dependencies ------------ -* Python (tested with version 2.6, 2.7, 3.1, 3.2) with the curses module - and, optionally, support for wide-unicode. +* Python (tested with version 2.6, 2.7, 3.1, 3.2) with support for ncurses + and (optionally) wide-unicode. +* The "file" program for determining file types +* A pager ("less" by default) Optional: -* The "file" program -* A pager ("less" by default) * The python module "chardet", in case of encoding detection problems Optional, for enhanced file previews (with "scope.sh"): -- cgit 1.4.1-2-gfad0 From 1891697f0cb957fe12d4e8b941f2686ee90f4290 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 10 Oct 2011 19:56:38 +0200 Subject: README: "file" really is optional --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index 7719886b..ba60c53e 100644 --- a/README +++ b/README @@ -50,10 +50,10 @@ Dependencies ------------ * Python (tested with version 2.6, 2.7, 3.1, 3.2) with support for ncurses and (optionally) wide-unicode. -* The "file" program for determining file types * A pager ("less" by default) Optional: +* The "file" program for determining file types * The python module "chardet", in case of encoding detection problems Optional, for enhanced file previews (with "scope.sh"): -- cgit 1.4.1-2-gfad0 From 1008f630fbb854849ab8debb128d09b450ba7e16 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 10 Oct 2011 22:45:17 +0200 Subject: fixed some documentation --- README | 5 +++-- doc/ranger.1 | 7 ++++--- doc/ranger.pod | 7 ++++--- ranger/core/helper.py | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) (limited to 'README') diff --git a/README b/README index ba60c53e..7e89be82 100644 --- a/README +++ b/README @@ -7,8 +7,9 @@ open your files with. This file describes ranger and how to get it to run. For instructions on the usage, please read the man page. See doc/HACKING for development specific -information. For configuration, check the sample files that ranger creates -in your ~/.config/ranger directory. +information. For configuration, check the files in ranger/defaults/. They +are usually installed to /usr/lib/python*/site-packages/ranger/defaults/ +and can be obtained with ranger's --copy-config option. A note to packagers: Versions meant for packaging are listed in the changelog on the website. diff --git a/doc/ranger.1 b/doc/ranger.1 index ea816aa3..2177431a 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.5.0" "10/08/2011" "ranger manual" +.TH RANGER 1 "ranger-1.5.0" "10/10/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 @@ -146,8 +146,9 @@ open your files with. .PP This manual mainly contains information on the usage of ranger. Refer to the \&\fI\s-1README\s0\fR for install instructions and to \fIdoc/HACKING\fR for development -specific information. For configuration, check the sample files that ranger -created in your \fI~/.config/ranger\fR directory. +specific information. For configuration, see the files in \fIranger/defaults\fR. +They are usually installed to \fI/usr/lib/python*/site\-packages/ranger/defaults\fR +and can be obtained with ranger's \-\-copy\-config option. .PP Inside ranger, you can press \fI1?\fR for a list of key bindings, \fI2?\fR for a list of commands and \fI3?\fR for a list of settings. diff --git a/doc/ranger.pod b/doc/ranger.pod index a908e1e1..ec272de1 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -24,8 +24,9 @@ open your files with. This manual mainly contains information on the usage of ranger. Refer to the F for install instructions and to F for development -specific information. For configuration, check the sample files that ranger -created in your F<~/.config/ranger> directory. +specific information. For configuration, see the files in F. +They are usually installed to F +and can be obtained with ranger's --copy-config option. Inside ranger, you can press I<1?> for a list of key bindings, I<2?> for a list of commands and I<3?> for a list of settings. @@ -64,7 +65,7 @@ write the last visited directory into I. Create copies of the default configuration files in your local configuration directory. Existing ones will not be overwritten. Possible values: I, -I, I, I, I, I. +I, I, I, I, I. =item B<--list-unused-keys> diff --git a/ranger/core/helper.py b/ranger/core/helper.py index 5c93a734..45db80e9 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -40,7 +40,7 @@ def parse_arguments(): help="don't touch/require any config files. ") parser.add_option('--copy-config', type='string', metavar='which', help="copy the default configs to the local config directory. " - "Possible values: all, apps, commands, keys, options, scope") + "Possible values: all, rc, apps, commands, options, scope") parser.add_option('--fail-unless-cd', action='store_true', help="experimental: return the exit code 1 if ranger is" \ "used to run a file (with `ranger filename`)") -- cgit 1.4.1-2-gfad0 From e5fb3d74a701544a872bb6d7902557c5d8e1f2a0 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 11 Oct 2011 20:17:24 +0200 Subject: README: Added newline --- README | 1 + 1 file changed, 1 insertion(+) (limited to 'README') diff --git a/README b/README index 7e89be82..98efc97d 100644 --- a/README +++ b/README @@ -81,6 +81,7 @@ This translates roughly to: This also saves a list of all installed files to install_log.txt, which you can use to uninstall ranger. + Getting Started --------------- After starting ranger, you can use the Arrow Keys (or hjkl) to navigate, Enter -- cgit 1.4.1-2-gfad0