From 7eaef14ed1ec4b5ffde48c11827040f9ad711653 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 29 Sep 2011 01:04:23 +0200 Subject: core.actions: replaced internal help with 'man ranger' I want to remove redundant documentation. The missing information will be added to the man page. --- ranger/core/actions.py | 38 ++------ ranger/gui/context.py | 2 +- ranger/gui/widgets/pager.py | 34 ------- ranger/help/__init__.py | 47 --------- ranger/help/console.py | 162 ------------------------------- ranger/help/fileop.py | 107 -------------------- ranger/help/index.py | 80 --------------- ranger/help/invocation.py | 125 ------------------------ ranger/help/movement.py | 232 -------------------------------------------- ranger/help/starting.py | 121 ----------------------- 10 files changed, 10 insertions(+), 938 deletions(-) delete mode 100644 ranger/help/__init__.py delete mode 100644 ranger/help/console.py delete mode 100644 ranger/help/fileop.py delete mode 100644 ranger/help/index.py delete mode 100644 ranger/help/invocation.py delete mode 100644 ranger/help/movement.py delete mode 100644 ranger/help/starting.py diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 328d4365..59aac65c 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -530,35 +530,15 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): lines = cleandoc(command.__doc__).split('\n') pager.set_source(lines) - def display_help(self, topic='index', narg=None): - if not hasattr(self.ui, 'open_pager'): - return - - from ranger.help import get_help, get_help_by_index - - scroll_to_line = 0 - if narg is not None: - chapter, subchapter = int(str(narg)[0]), str(narg)[1:] - help_text = get_help_by_index(chapter) - lines = help_text.split('\n') - if chapter: - chapternumber = str(chapter) + '.' + subchapter + '. ' - skip_to_content = True - for line_number, line in enumerate(lines): - if skip_to_content: - if line[:10] == '==========': - skip_to_content = False - else: - if line.startswith(chapternumber): - scroll_to_line = line_number - else: - help_text = get_help(topic) - lines = help_text.split('\n') - - pager = self.ui.open_pager() - pager.set_source(lines) - pager.markup = 'help' - pager.move(down=scroll_to_line) + def display_help(self, narg=None): + manualpath = self.relpath('../doc/ranger.1') + if os.path.exists(manualpath): + process = self.run(['man', manualpath]) + if process.poll() != 16: + return + process = self.run(['man', 'ranger']) + if process.poll() == 16: + self.notify("Could not find manpage.", bad=True) def display_log(self): if not hasattr(self.ui, 'open_pager'): diff --git a/ranger/gui/context.py b/ranger/gui/context.py index 20ce2817..78af00ea 100644 --- a/ranger/gui/context.py +++ b/ranger/gui/context.py @@ -24,7 +24,7 @@ CONTEXT_KEYS = ['reset', 'error', 'badinfo', 'space', 'permissions', 'owner', 'group', 'mtime', 'nlink', 'scroll', 'all', 'bot', 'top', 'percentage', 'filter', 'marked', 'tagged', 'tag_marker', 'cut', 'copied', - 'help_markup', + 'help_markup', # COMPAT 'seperator', 'key', 'special', 'border', 'title', 'text', 'highlight', 'bars', 'quotes', 'tab', 'keybuffer'] diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index d1bf5918..cf8f91e4 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -23,11 +23,6 @@ from ranger.gui import ansi from ranger.ext.direction import Direction from ranger.container.keymap import CommandArgs -BAR_REGEXP = re.compile(r'\|\d+\?\|') -QUOTES_REGEXP = re.compile(r'"[^"]+?"') -SPECIAL_CHARS_REGEXP = re.compile(r'<\w+>|\^[A-Z]') -TITLE_REGEXP = re.compile(r'^\d+\.') - class Pager(Widget): source = None source_is_stream = False @@ -81,35 +76,6 @@ class Pager(Widget): def _draw_line(self, i, line): if self.markup is None: self.addstr(i, 0, line) - elif self.markup is 'help': - self.addstr(i, 0, line) - - baseclr = ('in_pager', 'help_markup') - - if line.startswith('===='): - self.color_at(i, 0, len(line), 'seperator', *baseclr) - return - - if line.startswith(' ') and \ - len(line) >= 16 and line[15] == ' ': - self.color_at(i, 0, 16, 'key', *baseclr) - - for m in BAR_REGEXP.finditer(line): - start, length = m.start(), m.end() - m.start() - self.color_at(i, start, length, 'bars', *baseclr) - self.color_at(i, start + 1, length - 2, 'link', *baseclr) - - for m in QUOTES_REGEXP.finditer(line): - start, length = m.start(), m.end() - m.start() - self.color_at(i, start, length, 'quotes', *baseclr) - self.color_at(i, start + 1, length - 2, 'text', *baseclr) - - for m in SPECIAL_CHARS_REGEXP.finditer(line): - start, length = m.start(), m.end() - m.start() - self.color_at(i, start, length, 'special', *baseclr) - - if TITLE_REGEXP.match(line): - self.color_at(i, 0, -1, 'title', *baseclr) elif self.markup == 'ansi': try: self.win.move(i, 0) diff --git a/ranger/help/__init__.py b/ranger/help/__init__.py deleted file mode 100644 index f304c7bc..00000000 --- a/ranger/help/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -"""Help files are located here.""" - -from inspect import cleandoc - -NO_TOPIC = """The help topic was not found.""" - -NO_HELP = """No help was found. - -Possibly the program was invoked with "python -OO" which -discards all documentation.""" - -HELP_TOPICS = ('index', 'movement', 'starting', 'console', 'fileop', - 'invocation') - -def get_docstring_of_module(path, module_name): - imported = __import__(path, fromlist=[module_name]) - return getattr(imported, module_name).__doc__ - -def get_help(topic): - try: - doc = get_docstring_of_module('ranger.help', topic) - except (ImportError, AttributeError): - return NO_TOPIC - if isinstance(doc, str): - return cleandoc(doc) - return NO_HELP - -def get_help_by_index(i): - try: - return get_help(HELP_TOPICS[i]) - except IndexError: - return NO_TOPIC diff --git a/ranger/help/console.py b/ranger/help/console.py deleted file mode 100644 index e25b5b5e..00000000 --- a/ranger/help/console.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" -3. The Console - -3.1. General Information -3.2. List of Commands -3.3. Macros -3.4. The more complicated Commands in Detail - -============================================================================== -3.1. General Information - -The console is opened by pressing ":". Press to cycle through all -available commands and press to view help about the current command. - -All commands are defined in the file ranger/defaults/commands.py, which -also contains a detailed specification. - - -============================================================================== -3.2. List of Commands - -All commands except for ":delete" can be abbreviated with the shortest -unambiguous name, e.g. ":chmod" can be written as ":ch" but not as ":c" since -it conflicts with ":cd". - - -:bulkrename - This command opens a list of selected files in an external editor. - After you edit and save the file, it will generate a shell script which - does bulk renaming according to the changes you did in the file. - -:cd - Changes the directory to - -:chmod - Sets the permissions of the selection to the octal number. - -:delete - Deletes the current selection. - "Selection" is defined as all the "marked files" (by default, you - can mark files with space or v). If there are no marked files, - use the "current file" (where the cursor is) - -:edit - Opens the specified file in the text editor. - -:eval - Evaluates the given code inside ranger. `fm' is a reference to - the filemanager instance, `p' is a function to print text. - -:filter - Displays only files which contain in their basename. - -:find - Quickly find files that match the regexp and execute the first - unambiguous match. - -:grep - Looks for a string in all marked files or directory. - (equivalent to "!grep [some options] -e -r %s | less") - -:mark - Mark all files matching a regular expression. - -:unmark - Unmark all files matching a regular expression. - -:mkdir - Creates a directory with the name - -:open_with [] [] [] - Open the current file with the program, flags and mode. |24?| |25?| - All arguments are optional. If none is given, its equivalent to - pressing - -:quit - Exits ranger - -:rename - Changes the name of the currently highlighted file to - -:search - Search for a regexp in all file names, like the / key in vim. - -:shell [-] - Run the command, optionally with some flags. |25?| - Example: shell -d firefox -safe-mode %s - opens (detached from ranger) the selection in firefox' safe-mode - -:terminal - Spawns "x-terminal-emulator" starting in the current directory. - -:touch - Creates a file with the name - - -============================================================================== -3.3. Macros - -Like in similar filemanagers there are some macros. Use them in -commands and they will be replaced with a list of files. - %f the highlighted file - %d the path of the current directory - %s the selected files in the current directory. If no files are - selected, it defaults to the same as %f - %t all tagged files in the current directory - %c the full paths of the currently copied/cut files - -The macros %f, %d and %s also have upper case variants, %F, %D and %S, -which refer to the next tab. To refer to specific tabs, add a number in -between. Examples: - %D The path of the directory in the next tab - %7s The selection of the seventh tab - -%c is the only macro which ranges out of the current directory. So you may -"abuse" the copying function for other purposes, like diffing two files which -are in different directories: - - Yank the file A (type yy), move to the file B and use: - :shell -p diff %c %f - - -============================================================================== -3.4. The more complicated Commands in Detail - -3.4.1. "find" -The find command is different than others: it doesn't require you to -press . To speed things up, it tries to guess when you're -done typing and executes the command right away. -The key "f" opens the console with ":find " - -3.4.2. "shell" -The shell command accepts flags |25?| as the first argument. This example -will use the "p"-flag, which pipes the output to the pager: - :shell -p cat somefile.txt - -There are some shortcuts which open the console with the shell command: - "!" opens ":shell " - "@" opens ":shell %s" - "#" opens ":shell -p " - -3.4.3. "open_with" -The open_with command is explained in detail in chapter 2.2. |22?| - -============================================================================== -""" -# vim:tw=78:sw=8:sts=8:ts=8:ft=help diff --git a/ranger/help/fileop.py b/ranger/help/fileop.py deleted file mode 100644 index ac23c6d4..00000000 --- a/ranger/help/fileop.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" -4. File Operations - -4.1. Destructive Operations -4.2. The Selection -4.3. Copying and Pasting -4.4. Task View - - -============================================================================== -4.1. Destructive Operations - -These are all the operations which can change, and with misuse, possibly -harm your files: - -:chmod Change the rights of the selection -:delete DELETES ALL FILES IN THE SELECTION -:rename Change the name of the current file -pp, pl, pL, po Pastes the copied files in different ways - -Think twice before using these commands or key combinations. - - -============================================================================== -4.2. The Selection - -Many commands operate on the selection, so it's important to know what -it is: - -If there are marked files: - The selection contains all the marked files. -Otherwise: - The selection contains only the highlighted file. - -"Marked files" are the files which are slightly indented and marked in -yellow (in the default color scheme.) You can mark files by typing "v" or -. - -The "highlighted file", or the "current file", is the one below the cursor. - - -============================================================================== -4.3. Copying and Pasting - - yy copy the selection - dd cut the selection - - ya, da add the selection to the copied/cut files - yr, dr remove the selection from the copied/cut files - - pp paste the copied/cut files. No file will be overwritten. - Instead, a "_" character will be appended to the new filename. - po paste the copied/cut files. Existing files are overwritten. - pl create symbolic links to the copied/cut files. - pL create relative symbolic links to the copied/cut files. - -The difference between copying and cutting should be intuitive: - -When pasting files which are copied, the original file remains unchanged -in any case. - -When pasting files which are cut, the original file will be renamed. -If renaming is not possible because the source and the destination are -on separate devices, it will be copied and eventually the source is deleted. -This implies that a file can only be cut + pasted once. - -The files are either copied or cut, never mixed even if you mix "da" and "ya" -keys (in which case the last command is decisive about whether they are copied -or cut.) - -============================================================================== -4.4. Task View - -The task view lets you manage IO tasks like copying, moving and -loading directories by changing their priority or stop them. - - w open or close the task view - dd stop the task - J decrease the priority of the task - K increase the priority of the task - -The execution of tasks is not parallel but sequential. Only the -topmost task is executed. Ranger constantly switches between -handling GUI and executing tasks. One movement of the throbber at -the top right represents such a switch, so while the throbber is -standing still, ranger is locked by a Input/Output operation and -you will not be able to input any commands. - - -============================================================================== -""" -# vim:tw=78:sw=4:sts=8:ts=8:ft=help diff --git a/ranger/help/index.py b/ranger/help/index.py deleted file mode 100644 index a10a8406..00000000 --- a/ranger/help/index.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" - ranger %s - main help file - k - Move around: Use the cursor keys, or "h" to go left, h l - "j" to go down, "k" to go up, "l" to go right. j - Close Ranger: Type "Q" - Specific help: Type "?", prepended with a number: - - |0?| This index - |1?| Basic movement and browsing - |2?| Running Files - |3?| The console - |4?| File operations - |5?| Ranger invocation - - -============================================================================== -0.1. About ranger - -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. - - -============================================================================== -0.2. About these help pages - -Annotations like |1?| indicate that the topic is explained in more -detail in chapter 1. You can type 1? to view it. -You can type 16? to open chapter 1, paragraph 6. - - -============================================================================== -0.3. Copying - -Copyright (C) 2009, 2010 Roman Zimbelmann - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - - -============================================================================== -""" - -import ranger -__doc__ %= ranger.__version__ -# vim:tw=78:sw=4:sts=8:ts=8:ft=help diff --git a/ranger/help/invocation.py b/ranger/help/invocation.py deleted file mode 100644 index afb1cd27..00000000 --- a/ranger/help/invocation.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" -5. Ranger invocation - -5.1. Command Line Arguments -5.2. Python Options - - -============================================================================== -5.1. Command Line Arguments - -These options can be passed to ranger when starting it from the -command line. - ---version - Print the version and exit. - --h, --help - Print a list of options and exit. - --d, --debug - Activate the debug mode: Whenever an error occurs, ranger - will exit and print a full backtrace. The default behaviour - is to merely print the name of the exception in the statusbar/log - and to try to keep running. - --c, --clean - Activate the clean mode: Ranger will not access or create any - configuration files nor will it leave any traces on your system. - This is useful when your configuration is broken, when you want - to avoid clutter, etc. - ---copy-config - Create copies of the default configuration files in your local - configuration directory. Existing ones will not be overwritten. - Possible values: all, apps, commands, keys, options, scope. - ---fail-unless-cd - Return the exit code 1 if ranger is used to run a file, for example - with `ranger --fail-unless-cd filename`. This can be useful for scripts. - (This option used to be called --fail-if-run) - --r , --confdir= - Define a different configuration directory. The default is - $HOME/.ranger. - --m , --mode= - When a filename is supplied, make it run in mode |2| - --f , --flags= - When a filename is supplied, run it with the flags |2| - ---choosefile= - Makes ranger act like a file chooser. When opneing a file, it will - quit and write the name of the selected file to the filename specified - as . This file can be read in a script and used to open a - certain file which has been chosen with ranger. - ---choosedir= - Makes ranger act like a directory chooser. When ranger quits, it will - write the name of the last visited directory to - -(Optional) Positional Argument - The positional argument should be a path to the directory you - want ranger to start in, or the file which you want to run. - Only one positional argument is accepted as of now. - --- - Stop looking for options. All following arguments are treated as - positional arguments. - -Examples: - ranger episode1.avi - ranger --debug /usr/bin - ranger --confdir=~/.config/ranger --fail-unless-cd - -See the README on how to integrate ranger with various external programs. - - -============================================================================== -5.2. Python Options - -Ranger makes use of python optimize flags. To use them, run ranger like this: - PYTHONOPTIMIZE=1 ranger -An alternative is: - python -O `which ranger` -Or you could change the first line of the ranger script and add -O/-OO. -The first way is the recommended one. Of course you can make an alias or -a shell fuction to save typing. - -Using PYTHONOPTIMIZE=1 (-O) will make python discard assertion statements. -Assertions are little pieces of code which are helpful for finding errors, -but unless you're touching sensitive parts of ranger, you may want to -disable them to save some computing power. - -Using PYTHONOPTIMIZE=2 (-OO) will additionally discard any docstrings. -In ranger, most built-in documentation (F1/? keys) is implemented with -docstrings. Use this option if you don't need the documentation. - -Examples: - PYTHONOPTIMIZE=1 ranger episode1.avi - PYTHONOPTIMIZE=2 ranger --debug /usr/bin - python -OO `which ranger` --confdir=~/.config/ranger --fail-unless-cd - -Note: The author expected "-OO" to reduce the memory usage, but that -doesn't seem to happen. - - -============================================================================== -""" -# vim:tw=78:sw=8:sts=8:ts=8:ft=help diff --git a/ranger/help/movement.py b/ranger/help/movement.py deleted file mode 100644 index e7c3a87c..00000000 --- a/ranger/help/movement.py +++ /dev/null @@ -1,232 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" -1. Basic movement and browsing - -1.1. Move around -1.2. Browser control -1.3. Searching -1.4. Sorting -1.5. Bookmarks -1.6. Tabs -1.7. Mouse usage -1.8. Misc keys -1.9. Previews - - -============================================================================== -1.1. Ranger has similar movement keys as vim: - -Note: A ^ stands for the Ctrl key. - - k move up - j move down - h move left (in browser: move one directory up) - l move right (in browser: enter this directory, or run this file) - - ^U move half the screen up - ^D move half the screen down - H in browser: move back in history - L in browser: move forward in history - - gg move to the top - G move to the bottom - % move to the middle - -By prefixing a number, you can give more precise commands, eg: - - 2^D move 2 pages down - 5gg move to the 5th line - 3h move 3 characters to the left, or move 3 directories up - 30% move to 30% of the screen - -Using arrow keys is equivalent of using h/j/k/l in most cases. -An exception to this is the console, where you can move around with -arrow keys and pressing letters will insert the letter into the console. - -Special keys like Home, Page Up,.. work as expected. - -These keys work like in vim: - - ^U move half the screen up - ^D move half the screen down - ^B move up by one screen - ^F move down by one screen - -This keys can be used to make movements beyond the current directory - - ] move down in the parent directory - [ move up in the parent directory - - } traverse the directory tree, visiting each directory - { traverse in the other direction. (not implemented yet, - currently this only moves back in history) - - gl move to the real path of the current directory (resolving symlinks) - gL move to the real path of the selected file or directory - - -============================================================================== -1.2. Browser control - - ? view the help screen - R reload the current directory - ^R clear the cache and reload the view - ^L redraw the window - : open the console |3?| - z toggle options - u undo certain things (unyank, unmark,...) - - i inspect the content of the file - E edit the file - S open a shell, starting in the current directory - -Marking files allows you to use operations on multiple files at once. -If there are any marked files in this directory, "yy" will copy them instead -of the file you're pointing at. - - mark a file - v toggle all marks - V, uv remove all marks - ^V mark files in a specific direction - e.g. ^Vgg marks all files from the current to the top - u^V unmark files in a specific direction - -By "tagging" files, you can highlight them and mark them to be -special in whatever context you want. Tags are persistent across sessions. - - t tag/untag the selection - T untag the selection - -Midnight Commander lovers will find that the function keys work similarly. -There is no menu or drop down though. - - view the help screen - view the file - edit the file - copy the selection - cut the selection - create a directory - delete the selection - exit ranger - - -============================================================================== -1.3. Searching - -Use "/" to open the search console. |3?| -Enter a string and press to search for it in all currently -visible files. Pressing "n" will move you to the next occurance, -"N" to the previous one. - -You can search for more than just strings: - cc cycle through all files by their ctime (last inode change) - cm cycle by mime type, connecting similar files - cs cycle by size, large items first - ct search tagged files - - -============================================================================== -1.4. Sorting - -To sort files, type "o" suffixed with a key that stands for a certain -sorting mode. By typing any of those keys in upper case, the order will -be reversed. - - os sort by size - ob, on sort by basename - om sort by mtime (last modification) - ot sort by mime type - or reverse order - - -============================================================================== -1.5. Bookmarks - -Type "m" to bookmark the current directory. You can re-enter this -directory by typing "`". can be any letter or digit. Unlike vim, -both lowercase and uppercase bookmarks are persistent. - -Each time you jump to a bookmark, the special bookmark at key ` will be set -to the last directory. So typing "``" gets you back to where you were before. - -Note: The ' key is equivalent to `. - - -============================================================================== -1.6. Tabs - -Tabs are used to work in different directories in the same Ranger instance. -In Ranger, tabs are very simple though and only store the directory path. - - gt Go to the next tab. (also TAB) - gT Go to the previous tab. (also Shift+TAB) - gn, ^N Create a new tab - g Open a tab. N has to be a number from 1 to 9. - If the tab doesn't exist yet, it will be created. - On most terminals, Alt-1, Alt-2, etc., also work. - gc, ^W Close the current tab. The last tab cannot be closed. - - -============================================================================== -1.7. Mouse usage - -The mouse can be used to quickly enter directories which you point at, -or to scroll around with the mouse wheel. The implementation of the mouse -wheel is not stable due to problems with the ncurses library, but "it works -on my machine". - -Clicking into the preview window will usually run the file. |2?| - - -============================================================================== -1.8. Misc keys - - W Display the message log - du Display the disk usage of the current directory - cd Open the console with ":cd " - cw Open the console with ":rename " - A Open the console with ":rename " - I Same as A, put the cursor at the beginning of the filename - yp Copy the path of the file (with xsel) - yn Copy the base name of the file (with xsel) - yd Copy the directory name of the file (with xsel) - - -============================================================================== -1.9. Previews - -By default, only text files are previewed, but you can enable external -preview scripts by creating ~/.config/ranger/scope.sh (see preview_script -option.) This script will then be executed each time you attempt to -preview a file. - -Fetch the default scope.sh (from ranger/data/scope.sh) by running - ranger --copy-config=scope - -This default script contains more documentation and calls to the -programs "lynx" and "elinks" for html, "highlight" for text/code, -"img2txt" for images, "atool" for archives, "pdftotext" for PDFs and -"mediainfo" for video and audio files. - -Install these programs (just the ones you need) and scope.sh will -automatically use them. Make sure to also have the options -"use_preview_script" and "preview_files" turned on. - - -============================================================================== -""" -# vim:tw=78:sw=4:sts=8:ts=8:ft=help diff --git a/ranger/help/starting.py b/ranger/help/starting.py deleted file mode 100644 index dbc6b6b5..00000000 --- a/ranger/help/starting.py +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (C) 2009, 2010 Roman Zimbelmann -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -""" -2. Running Files - -2.1. How to run files -2.2. The "open_with" command -2.2. Programs -2.4. Modes -2.5. Flags - - -============================================================================== -2.1. How to run files - -While highlighting a file, press the "l" key to fire up the automatic -filetype detection mechanism and attempt to start the file. - - l run the selection - r open the console with ":open_with" - -Note: The selection means, if there are marked files in this directory, -use them. Otherwise use the file under the cursor. - - -============================================================================== -2.2. The "open_with" command - -If the automatic filetype detection fails or starts the file in a wrong -way, you can press "r" to manually tell ranger how to run it. - -The programs and modes can be defined in the apps.py, giving you a -high level interface for running files. - -Syntax: :open_with -You can leave out parameters or change the order. - -Examples: -Open this file with vim: - :open_with vim -Run this file like with "./file": - :open_with self -Open this file as usual but pipe the output to "less" - :open_with p -Open this file with mplayer with the "detached" flag: - :open_with mplayer d -Open this file with totem in mode 1, will not detach the process (flag D) -but discard the output (flag s). - :open_with totem 1 Ds - -The parameters , and are explained in the -following paragraphs - - -============================================================================== -2.3. Programs - -Programs have to be defined in ranger/defaults/apps.py. Each function -in the class CustomApplications which starts with "app_" can be used -as a program in the "open_with" command. - -You're encouraged to add your own program definitions to the list. Refer to -the existing examples in the apps.py, it should be easy to adapt it for your -purposes. - - -============================================================================== -2.4. Modes - -Sometimes there are multiple variants to open a file. For example, ranger -gives you 2 ways of opening a video (by default): - - 0 windowed - 1 fullscreen - -By specifying a mode, you can select one of those. The "l" key will -start a file in mode 0. "4l" will start the file in mode 4 etc. -You can specify a mode in the "open_with" command by simply adding -the number. Eg: ":open_with mplayer 1" or ":open_with 1" - -For a list of all programs and modes, see ranger/defaults/apps.py - - -============================================================================== -2.5. Flags - -Flags give you a way to modify the behaviour of the spawned process. - - s Silent mode. Output will be discarded. - d Detach the process. (Run in background) - p Redirect output to the pager - w Wait for an enter-press when the process is done - c Run the current file only, even when more files are marked - -For example, ":open_with p" will pipe the output of that process into -the pager. - -An uppercase flag has the opposite effect. If a program will be detached by -default, use ":open_with D" to not detach it. - -Note: Some combinations don't make sense, eg: "vim d" would open the file in -vim and detach it. Since vim is a console application, you loose grip -of that process when you detach it. It's up to you to do such sanity checks. - - -============================================================================== -""" -# vim:tw=78:sw=4:sts=8:ts=8:ft=help -- cgit 1.4.1-2-gfad0