From 49bbdf603c67da67b53992b68a1491600466351d Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Tue, 23 Jul 2019 16:05:23 +0200 Subject: doc: Mention necessary macro escaping for chain --- doc/ranger.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index 5a29f6e1..847ba310 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -432,6 +432,10 @@ the end of a command when needed, while preventing editors to strip spaces off the end of the line automatically. .PP To write a literal %, you need to escape it by writing %%. +.PP +If you want to add spaces to a command that is chained with a chain command, you have +to escape %space, so you would use %%space. This is to prevent the chain command +from expanding the macros in its argument. .SS "\s-1BOOKMARKS\s0" .IX Subsection "BOOKMARKS" Type \fBm\fR to bookmark the current directory. You can re-enter this -- cgit 1.4.1-2-gfad0 From 8de0bea04ad91e127ca333c78b2eaff340783578 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Wed, 24 Jul 2019 10:27:24 +0200 Subject: Rephrase --- doc/ranger.1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 847ba310..7d90fff4 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -433,9 +433,12 @@ the end of the line automatically. .PP To write a literal %, you need to escape it by writing %%. .PP -If you want to add spaces to a command that is chained with a chain command, you have -to escape %space, so you would use %%space. This is to prevent the chain command -from expanding the macros in its argument. +For adding a space character after a chained command, you also need to escape % by +writing %% instead: + chain command1 %%space; command2 +This is because the chain command is a macro-expanding command itself. In the +previous example, chain expands %%space to %space, which is then expanded to the +space character by command1. .SS "\s-1BOOKMARKS\s0" .IX Subsection "BOOKMARKS" Type \fBm\fR to bookmark the current directory. You can re-enter this -- cgit 1.4.1-2-gfad0 From 634256d7a975e133a9775672b37dbaf3b2895b53 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Thu, 25 Jul 2019 21:56:18 +0200 Subject: Make doc --- doc/ranger.1 | 13 +++++++------ doc/ranger.pod | 8 ++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 7d90fff4..10a5e765 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-06-18" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "25/07/19" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -433,12 +433,13 @@ the end of the line automatically. .PP To write a literal %, you need to escape it by writing %%. .PP -For adding a space character after a chained command, you also need to escape % by -writing %% instead: +For adding a space character after a chained command, you also need to escape +% by writing %% instead: chain command1 %%space; command2 +.PP This is because the chain command is a macro-expanding command itself. In the -previous example, chain expands %%space to %space, which is then expanded to the -space character by command1. +previous example, chain expands %%space to \f(CW%space\fR, which is then expanded to +the space character by command1. .SS "\s-1BOOKMARKS\s0" .IX Subsection "BOOKMARKS" Type \fBm\fR to bookmark the current directory. You can re-enter this diff --git a/doc/ranger.pod b/doc/ranger.pod index fadd4cba..fc385334 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -328,6 +328,14 @@ the end of the line automatically. To write a literal %, you need to escape it by writing %%. +For adding a space character after a chained command, you also need to escape +% by writing %% instead: + chain command1 %%space; command2 + +This is because the chain command is a macro-expanding command itself. In the +previous example, chain expands %%space to %space, which is then expanded to +the space character by command1. + =head2 BOOKMARKS Type B> to bookmark the current directory. You can re-enter this -- cgit 1.4.1-2-gfad0 From e733caa892b4ac28f33ca67997e2686d08108367 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Thu, 25 Jul 2019 22:16:41 +0200 Subject: Rephrase & Make --- doc/ranger.1 | 11 ++++------- doc/ranger.pod | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 10a5e765..c5bef68f 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -433,13 +433,10 @@ the end of the line automatically. .PP To write a literal %, you need to escape it by writing %%. .PP -For adding a space character after a chained command, you also need to escape -% by writing %% instead: - chain command1 %%space; command2 -.PP -This is because the chain command is a macro-expanding command itself. In the -previous example, chain expands %%space to \f(CW%space\fR, which is then expanded to -the space character by command1. +Note that macros are expanded twice when using chain. For example, to insert +a space character in a chained command, you would write %%space. This is +because the chain command is a macro-expanding command itself. + chain command1; command2%%space .SS "\s-1BOOKMARKS\s0" .IX Subsection "BOOKMARKS" Type \fBm\fR to bookmark the current directory. You can re-enter this diff --git a/doc/ranger.pod b/doc/ranger.pod index fc385334..e178bf04 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -328,13 +328,10 @@ the end of the line automatically. To write a literal %, you need to escape it by writing %%. -For adding a space character after a chained command, you also need to escape -% by writing %% instead: - chain command1 %%space; command2 - -This is because the chain command is a macro-expanding command itself. In the -previous example, chain expands %%space to %space, which is then expanded to -the space character by command1. +Note that macros are expanded twice when using chain. For example, to insert +a space character in a chained command, you would write %%space. This is +because the chain command is a macro-expanding command itself. + chain command1; command2%%space =head2 BOOKMARKS -- cgit 1.4.1-2-gfad0 From 6fee63a8d7f91a91ffa2b785e67f4d418055bd98 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Thu, 25 Jul 2019 22:21:51 +0200 Subject: Rephrase & Make --- doc/ranger.1 | 5 ++--- doc/ranger.pod | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index c5bef68f..bccbfa98 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -433,9 +433,8 @@ the end of the line automatically. .PP To write a literal %, you need to escape it by writing %%. .PP -Note that macros are expanded twice when using chain. For example, to insert -a space character in a chained command, you would write %%space. This is -because the chain command is a macro-expanding command itself. +Note that macros are expanded twice when using chain. For example, to insert +a space character in a chained command, you would write %%space: chain command1; command2%%space .SS "\s-1BOOKMARKS\s0" .IX Subsection "BOOKMARKS" diff --git a/doc/ranger.pod b/doc/ranger.pod index e178bf04..0fd5cc47 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -328,9 +328,8 @@ the end of the line automatically. To write a literal %, you need to escape it by writing %%. -Note that macros are expanded twice when using chain. For example, to insert -a space character in a chained command, you would write %%space. This is -because the chain command is a macro-expanding command itself. +Note that macros are expanded twice when using chain. For example, to insert +a space character in a chained command, you would write %%space: chain command1; command2%%space =head2 BOOKMARKS -- cgit 1.4.1-2-gfad0 From 498ac4ffa7b90d385de6078a9162606a6bc524c3 Mon Sep 17 00:00:00 2001 From: toonn Date: Sat, 3 Aug 2019 00:29:10 +0200 Subject: Warn when nesting ranger Users frequently request that launching ranger in a subshell started from ranger (using `S`) instead exits the subshell so they end up in their original ranger instance without nesting, which is rarely useful. This isn't possible because a process can't easily kill its parent shell. To at least avoid such confusion we warn about nesting by default. A new setting `nested_ranger_warning` is added to `rc.conf`. The warning can be either disabled or the severity increased so the message is more visible. Fixes #1645 --- examples/rc_emacs.conf | 5 +++++ ranger/config/rc.conf | 5 +++++ ranger/container/settings.py | 3 +++ ranger/core/main.py | 10 ++++++++++ 4 files changed, 23 insertions(+) diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf index 0462282e..a2e81892 100644 --- a/examples/rc_emacs.conf +++ b/examples/rc_emacs.conf @@ -206,6 +206,11 @@ set idle_delay 2000 # check all directories above the current one as well? set metadata_deep_search false +# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words +# give a warning when you nest ranger in a subshell started by ranger. +# Special value "bad" makes the warning more visible. +set nested_ranger_warning true + # =================================================================== # == Local Options # =================================================================== diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index f559290d..70701edf 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -301,6 +301,11 @@ set freeze_files false # Print file sizes in bytes instead of the default human-readable format. set size_in_bytes false +# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words +# give a warning when you nest ranger in a subshell started by ranger. +# Special value "bad" makes the warning more visible. +set nested_ranger_warning true + # =================================================================== # == Local Options # =================================================================== diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 478f6124..58e9df2e 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -58,6 +58,7 @@ ALLOWED_SETTINGS = { 'max_history_size': (int, type(None)), 'metadata_deep_search': bool, 'mouse_enabled': bool, + 'nested_ranger_warning': str, 'one_indexed': bool, 'open_all_images': bool, 'padding_right': bool, @@ -105,6 +106,8 @@ ALLOWED_VALUES = { 'confirm_on_delete': ['multiple', 'always', 'never'], 'draw_borders': ['none', 'both', 'outline', 'separators'], 'line_numbers': ['false', 'absolute', 'relative'], + 'nested_ranger_warning': ['true', 'false', 'yes', 'no', 'enabled', + 'disabled', 'bad'], 'one_indexed': [False, True], 'preview_images_method': ['w3m', 'iterm2', 'terminology', 'urxvt', 'urxvt-full', 'kitty', diff --git a/ranger/core/main.py b/ranger/core/main.py index 23648677..bc0b742a 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -180,6 +180,16 @@ def main( for command in args.cmd: fm.execute_console(command) + if int(os.environ[level]) > 1: + warning = 'Warning:' + nested_warning = "You're in a nested ranger instance!" + nrw = fm.settings.nested_ranger_warning.lower() + if nrw in ['true', 'yes', 'enabled']: + fm.notify(' '.join((warning, nested_warning)), bad=False) + elif nrw == 'bad': + fm.notify(' '.join((warning.upper(), nested_warning + '!!')), + bad=True) + if ranger.args.profile: import cProfile import pstats -- cgit 1.4.1-2-gfad0 From 5b0b73fc182a582361dff754d3ecafa8a16e3292 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 3 Aug 2019 18:28:27 +0100 Subject: fixes setlocal on dirs with regex metachars --- ranger/container/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 478f6124..cd389aef 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -276,7 +276,7 @@ class Settings(SignalDispatcher, FileManagerAware): if path: if path not in self._localsettings: try: - regex = re.compile(path) + regex = re.compile(re.compile(path)) except re.error: # Bad regular expression return self._localregexes[path] = regex -- cgit 1.4.1-2-gfad0 From ffa83808fcec410bedef334a613e28b7f3236b4f Mon Sep 17 00:00:00 2001 From: user062 <48716714+user062@users.noreply.github.com> Date: Sat, 3 Aug 2019 18:27:24 +0000 Subject: Update settings.py --- ranger/container/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/container/settings.py b/ranger/container/settings.py index cd389aef..d15f8b3b 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -276,7 +276,7 @@ class Settings(SignalDispatcher, FileManagerAware): if path: if path not in self._localsettings: try: - regex = re.compile(re.compile(path)) + regex = re.compile(re.escape(path)) except re.error: # Bad regular expression return self._localregexes[path] = regex -- cgit 1.4.1-2-gfad0 From 5759b91fe98962231468e142091adfa81f63a0f7 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 20:37:11 +0200 Subject: Add logo to README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re getting the URL from ranger’s GitHub page, but it might be a better idea to add it to the repo. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index be17f0f9..3ca29ee2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ranger 1.9.2 ============ +![logo](https://ranger.github.io/ranger_logo.png) + [![Build Status](https://travis-ci.org/ranger/ranger.svg?branch=master)](https://travis-ci.org/ranger/ranger) latest packaged version(s) -- cgit 1.4.1-2-gfad0 From 8e40cc938a8f65ce35fb071869a734f8598b322a Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 20:38:37 +0200 Subject: Resize logo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since GitHub’s Markdown doesn’t support resizing, we have to use html to specify the width. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ca29ee2..f791ed2b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ranger 1.9.2 ============ -![logo](https://ranger.github.io/ranger_logo.png) + [![Build Status](https://travis-ci.org/ranger/ranger.svg?branch=master)](https://travis-ci.org/ranger/ranger) -- cgit 1.4.1-2-gfad0 From e34106ccedfe7d329183cff10f3c446afee1ff64 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:50:58 +0200 Subject: Add section for ‘Going further’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index be17f0f9..c7b91d9e 100644 --- a/README.md +++ b/README.md @@ -141,3 +141,10 @@ Ranger can automatically copy default configuration files to `~/.config/ranger` if you run it with the switch `--copy-config=( rc | scope | ... | all )`. See `ranger --help` for a description of that switch. Also check `ranger/config/` for the default configuration. + + +Going further +--------------- +For learning how to efficiently use ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). + +For more information, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From c652d43da439e5e27facb7afac90e23853c90b62 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:51:46 +0200 Subject: Use minimal capitalization in section-titles --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c7b91d9e..68e74df6 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ About * git clone https://github.com/ranger/ranger.git -Design Goals +Design goals ------------ * An easily maintainable file manager in a high level language * A quick way to switch directories and browse the file system @@ -130,7 +130,7 @@ This also saves a list of all installed files to `install_log.txt`, which you ca use to uninstall ranger. -Getting Started +Getting started --------------- After starting ranger, you can use the Arrow Keys or `h` `j` `k` `l` to navigate, `Enter` to open a file or `q` to quit. The third column shows a -- cgit 1.4.1-2-gfad0 From 1316c260255302a598156053e426f440141cab14 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:55:13 +0200 Subject: Rephrase line for official user guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68e74df6..525d26f2 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,6 @@ See `ranger --help` for a description of that switch. Also check Going further --------------- -For learning how to efficiently use ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). +For getting the most out of ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). For more information, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From 23e574352249fc697e3a7d29ec8ae62bf72e1142 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:55:35 +0200 Subject: Rephrase line for wiki --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 525d26f2..6ff158a2 100644 --- a/README.md +++ b/README.md @@ -147,4 +147,4 @@ Going further --------------- For getting the most out of ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). -For more information, see the [wiki](https://github.com/ranger/ranger/wiki). +For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From 55cd933b19a787b9fb8732c4ea85878b8bac5029 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:55:47 +0200 Subject: Add line for FAQ --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6ff158a2..9c3ae859 100644 --- a/README.md +++ b/README.md @@ -147,4 +147,6 @@ Going further --------------- For getting the most out of ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). +For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). + For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From 0dddcb1d8ab3f376bad193edc40335577e232ebe Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:57:15 +0200 Subject: Capitalize links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They don’t stand out enough otherwise. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c3ae859..038211cc 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,8 @@ See `ranger --help` for a description of that switch. Also check Going further --------------- -For getting the most out of ranger, see the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide). +For getting the most out of ranger, see the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). -For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). +For more information on customization, see the [Wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From 931fc503e79982e3a6189c2b74223977a659d7b6 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 16:59:56 +0200 Subject: Itemize --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 038211cc..9629b6d7 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,6 @@ See `ranger --help` for a description of that switch. Also check Going further --------------- -For getting the most out of ranger, see the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). - -For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). - -For more information on customization, see the [Wiki](https://github.com/ranger/ranger/wiki). +* For getting the most out of ranger, see the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). +* For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). +* For more information on customization, see the [Wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From d83f4104cd45ba2a25670910fc7bf17a920807c8 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 17:01:13 +0200 Subject: Do not capitalise wiki MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It looks odd, and since the wiki says ‘Welcome to the ranger wiki’, we might as well be consistent. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9629b6d7..c3819443 100644 --- a/README.md +++ b/README.md @@ -147,4 +147,4 @@ Going further --------------- * For getting the most out of ranger, see the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). * For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). -* For more information on customization, see the [Wiki](https://github.com/ranger/ranger/wiki). +* For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From db9e5bca1b9ffe15cba90317b6268ece5691afa4 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 17:01:50 +0200 Subject: Rephrase line for guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3819443..ddf602a6 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,6 @@ See `ranger --help` for a description of that switch. Also check Going further --------------- -* For getting the most out of ranger, see the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). +* To get the most out of ranger, read the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). * For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). * For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). -- cgit 1.4.1-2-gfad0 From 75b377da6ce9db543f4e06c0efc1e2e6d84f6363 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 20:32:07 +0200 Subject: Add section for community --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ddf602a6..588bda06 100644 --- a/README.md +++ b/README.md @@ -148,3 +148,10 @@ Going further * To get the most out of ranger, read the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). * For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). * For more information on customization, see the [wiki](https://github.com/ranger/ranger/wiki). + + +Community +--------------- +For help, support, or if you just want to hang out with us, you can find us here: +* **IRC channel**: channel **#ranger** on [freenode](https://freenode.net/kb/answer/chat) +* **Subreddit**: [r/ranger](https://www.reddit.com/r/ranger/) -- cgit 1.4.1-2-gfad0 From 924c42c03565f5fbbd8bd100d49b179c1bb07d65 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 20:33:36 +0200 Subject: Remove redundant ‘channel’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 588bda06..cd848917 100644 --- a/README.md +++ b/README.md @@ -153,5 +153,5 @@ Going further Community --------------- For help, support, or if you just want to hang out with us, you can find us here: -* **IRC channel**: channel **#ranger** on [freenode](https://freenode.net/kb/answer/chat) +* **IRC**: channel **#ranger** on [freenode](https://freenode.net/kb/answer/chat) * **Subreddit**: [r/ranger](https://www.reddit.com/r/ranger/) -- cgit 1.4.1-2-gfad0 From 21d306928d5d974fd068e57253235c1706bf1600 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Sat, 3 Aug 2019 20:34:28 +0200 Subject: Use ‘Reddit’ instead of ‘Subreddit’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd848917..315144bf 100644 --- a/README.md +++ b/README.md @@ -154,4 +154,4 @@ Community --------------- For help, support, or if you just want to hang out with us, you can find us here: * **IRC**: channel **#ranger** on [freenode](https://freenode.net/kb/answer/chat) -* **Subreddit**: [r/ranger](https://www.reddit.com/r/ranger/) +* **Reddit**: [r/ranger](https://www.reddit.com/r/ranger/) -- cgit 1.4.1-2-gfad0 From 4ba064ff6aabfc1468429e684ed492eee2e36292 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Mon, 5 Aug 2019 18:52:16 +0200 Subject: Maximally capitalize the headings --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 315144bf..f7e40192 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ About * git clone https://github.com/ranger/ranger.git -Design goals +Design Goals ------------ * An easily maintainable file manager in a high level language * A quick way to switch directories and browse the file system @@ -113,7 +113,7 @@ You can also install ranger through PyPI: ```pip install ranger-fm```. -### Installing from a clone +### Installing from a Clone Note that you don't *have* to install ranger; you can simply run `ranger.py`. To install ranger manually: @@ -130,7 +130,7 @@ This also saves a list of all installed files to `install_log.txt`, which you ca use to uninstall ranger. -Getting started +Getting Started --------------- After starting ranger, you can use the Arrow Keys or `h` `j` `k` `l` to navigate, `Enter` to open a file or `q` to quit. The third column shows a @@ -143,7 +143,7 @@ See `ranger --help` for a description of that switch. Also check `ranger/config/` for the default configuration. -Going further +Going Further --------------- * To get the most out of ranger, read the [Official User Guide](https://github.com/ranger/ranger/wiki/Official-user-guide). * For frequently asked questions, see the [FAQ](https://github.com/ranger/ranger/wiki/FAQ%3A-Frequently-Asked-Questions). -- cgit 1.4.1-2-gfad0 From 0bdc78f03ad9393c71c5215071e4c89db207944e Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Mon, 5 Aug 2019 18:55:05 +0200 Subject: Do not maximally capitalize sub-sub-headings --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7e40192..09130ad3 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ You can also install ranger through PyPI: ```pip install ranger-fm```. -### Installing from a Clone +### Installing from a clone Note that you don't *have* to install ranger; you can simply run `ranger.py`. To install ranger manually: -- cgit 1.4.1-2-gfad0 From 1577431725b13892f34bc4c4e4bab69439ac386a Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 5 Aug 2019 21:31:21 +0200 Subject: Improve the Dependencies section of the README This section was incomplete because `scope.sh` has grown a lot. Fixes #1611 --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 09130ad3..9789902c 100644 --- a/README.md +++ b/README.md @@ -76,23 +76,31 @@ Dependencies Optional: * The `file` program for determining file types -* The Python module `chardet`, in case of encoding detection problems +* `chardet` (Python package) for improved encoding detection of text files * `sudo` to use the "run as root" feature -* `w3m` for the `w3mimgdisplay` program to preview images * `python-bidi` for correct display of RTL file names (Hebrew, Arabic) Optional, for enhanced file previews (with `scope.sh`): * `img2txt` (from `caca-utils`) for ASCII-art image previews +* `w3mimgdisplay`, `ueberzug`, `kitty`, `terminology` or `urxvt` for image + previews +* `convert` (from `imagemagick`) to auto-rotate images and for SVG previews +* `ffmpegthumbnailer` for video thumbnails * `highlight` or `pygmentize` for syntax highlighting of code -* `atool`, `bsdtar` and/or `unrar` for previews of archives +* `atool`, `bsdtar`, `unrar` and/or `7z` for previews of archives +* `bsdtar`, `tar`, `unrar` and/or `unzip` to preview archives as their first + image * `lynx`, `w3m` or `elinks` for previews of html pages -* `pdftotext` or `mutool` for `pdf` previews +* `pdftotext` or `mutool` for textual `pdf` previews, `pdftoppm` to preview as + image +* `djvutxt` for textual DjVu previews, `ddjvu` to preview as image +* `calibre` or `epub-thumbnailer` for image previews of ebooks * `transmission-show` for viewing BitTorrent information * `mediainfo` or `exiftool` for viewing information about media files * `odt2txt` for OpenDocument text files (`odt`, `ods`, `odp` and `sxw`) -* `chardet` (Python package) for improved encoding detection of text files - +* `python` or `jq` for JSON files +* `fontimage` for font previews Installing ---------- -- cgit 1.4.1-2-gfad0 From 0e0f3467a31de27fe570d9f3a40a7294df6222f5 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Mon, 5 Aug 2019 21:53:01 +0200 Subject: Further README improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not use article for ‘file’. Rephrase description for ‘python-bidi’. Create sub-heading for optional dependencies. Mention ‘depencies’ in the sub-heading, looks a tad barren otherwise. Change ‘General’ to ‘For general usage’. Change ‘for + noun’ to ‘to + verb’. --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9789902c..f12f9957 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,16 @@ Dependencies and (optionally) wide-unicode support * A pager (`less` by default) -Optional: +### Optional dependencies -* The `file` program for determining file types +For general usage: + +* `file` for determining file types * `chardet` (Python package) for improved encoding detection of text files * `sudo` to use the "run as root" feature -* `python-bidi` for correct display of RTL file names (Hebrew, Arabic) +* `python-bidi` to display right-to-left file names correctly (Hebrew, Arabic) -Optional, for enhanced file previews (with `scope.sh`): +More options for enhanced file previews (with `scope.sh`): * `img2txt` (from `caca-utils`) for ASCII-art image previews * `w3mimgdisplay`, `ueberzug`, `kitty`, `terminology` or `urxvt` for image @@ -88,10 +90,10 @@ Optional, for enhanced file previews (with `scope.sh`): * `convert` (from `imagemagick`) to auto-rotate images and for SVG previews * `ffmpegthumbnailer` for video thumbnails * `highlight` or `pygmentize` for syntax highlighting of code -* `atool`, `bsdtar`, `unrar` and/or `7z` for previews of archives +* `atool`, `bsdtar`, `unrar` and/or `7z` to preview archives * `bsdtar`, `tar`, `unrar` and/or `unzip` to preview archives as their first image -* `lynx`, `w3m` or `elinks` for previews of html pages +* `lynx`, `w3m` or `elinks` to preview html pages * `pdftotext` or `mutool` for textual `pdf` previews, `pdftoppm` to preview as image * `djvutxt` for textual DjVu previews, `ddjvu` to preview as image -- cgit 1.4.1-2-gfad0 From 977254aafa784bc855510dca81f80f5d148da666 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 5 Aug 2019 23:09:42 +0200 Subject: Change phrasing to avoid confusion Don't want people to think "More options" means settings. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f12f9957..d1e75117 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ For general usage: * `sudo` to use the "run as root" feature * `python-bidi` to display right-to-left file names correctly (Hebrew, Arabic) -More options for enhanced file previews (with `scope.sh`): +For enhanced file previews (with `scope.sh`): * `img2txt` (from `caca-utils`) for ASCII-art image previews * `w3mimgdisplay`, `ueberzug`, `kitty`, `terminology` or `urxvt` for image -- cgit 1.4.1-2-gfad0 From 9511bd6e6b0d8a3e8ce04b723cf4903b81db1b61 Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Sun, 18 Aug 2019 15:05:08 +0200 Subject: Drop truth values; rename warning setting --- doc/ranger.1 | 29 ++++++++++++++++++----------- doc/ranger.pod | 8 ++++++++ examples/rc_emacs.conf | 2 +- ranger/config/rc.conf | 2 +- ranger/container/settings.py | 3 +-- ranger/core/main.py | 6 +++--- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index bccbfa98..af13e690 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -46,7 +46,7 @@ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is >0, we'll generate index entries on stderr for +.\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. @@ -56,12 +56,12 @@ .. .nr rF 0 .if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{\ -. if \nF \{\ +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ +. if !\nF==2 \{ . nr % 0 . nr F 2 . \} @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "25/07/19" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "18-08-2019" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -173,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to \&\fI/usr/share/doc/ranger/examples\fR. .PP -The man page of \fBrifle\fR\|(1) describes the functions of the file opener +The man page of \fIrifle\fR\|(1) describes the functions of the file opener .PP The section \fI\s-1LINKS\s0\fR of this man page contains further resources. .SH "POSITIONAL ARGUMENTS" @@ -342,7 +342,7 @@ To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR t \fIkitty\fR .IX Subsection "kitty" .PP -This only works on Kitty. It requires \s-1PIL\s0 (or pillow) to work. +This only works on Kitty. It requires \s-1PIL \s0(or pillow) to work. Allows remote image previews, for example in an ssh session. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. @@ -666,7 +666,7 @@ Toggle the mark-status of all files .IP "V" 14 .IX Item "V" Starts the visual mode, which selects all files between the starting point and -the cursor until you press \s-1ESC.\s0 To unselect files in the same way, use \*(L"uV\*(R". +the cursor until you press \s-1ESC. \s0 To unselect files in the same way, use \*(L"uV\*(R". .IP "/" 14 Search for files in the current directory. .IP ":" 14 @@ -971,6 +971,13 @@ all directories above the current one as well? .IP "mouse_enabled [bool] " 4 .IX Item "mouse_enabled [bool] " Enable mouse input? +.IP "nested_ranger_warning [string]" 4 +.IX Item "nested_ranger_warning [string]" +Warn at startup if \f(CW\*(C`RANGER_LEVEL\*(C'\fR is greater than 0, in other words give a +warning when you nest ranger in a subshell started by ranger. Allowed values +are \f(CW\*(C`true\*(C'\fR, \f(CW\*(C`false\*(C'\fR and \f(CW\*(C`error\*(C'\fR. The special value \f(CW\*(C`error\*(C'\fR promotes the +warning to an error, this is usually shown as red text but will crash ranger +when run with the \f(CW\*(C`\-\-debug\*(C'\fR flag. .IP "one_indexed [bool]" 4 .IX Item "one_indexed [bool]" Start line numbers from 1. Possible values are: @@ -1684,7 +1691,7 @@ Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is installed, unless \fIhighlight\fR is also installed. Find out possible values by running: python \-c 'import pygments.styles; [print(stl) for stl in - pygments.styles.\fBget_all_styles()\fR]' + pygments.styles.\fIget_all_styles()\fR]' .IP "\s-1HIGHLIGHT_STYLE\s0" 8 .IX Item "HIGHLIGHT_STYLE" Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is @@ -1743,7 +1750,7 @@ copy, run: .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fBrifle\fR\|(1) +\&\fIrifle\fR\|(1) .SH "BUGS" .IX Header "BUGS" Report bugs here: diff --git a/doc/ranger.pod b/doc/ranger.pod index 0fd5cc47..4b44fc92 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -985,6 +985,14 @@ all directories above the current one as well? Enable mouse input? +=item nested_ranger_warning [string] + +Warn at startup if C is greater than 0, in other words give a +warning when you nest ranger in a subshell started by ranger. Allowed values +are C, C and C. The special value C promotes the +warning to an error, this is usually shown as red text but will crash ranger +when run with the C<--debug> flag. + =item one_indexed [bool] Start line numbers from 1. Possible values are: diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf index a2e81892..e3596ba5 100644 --- a/examples/rc_emacs.conf +++ b/examples/rc_emacs.conf @@ -208,7 +208,7 @@ set metadata_deep_search false # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words # give a warning when you nest ranger in a subshell started by ranger. -# Special value "bad" makes the warning more visible. +# Special value "error" makes the warning more visible. set nested_ranger_warning true # =================================================================== diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 70701edf..00a20def 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -303,7 +303,7 @@ set size_in_bytes false # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words # give a warning when you nest ranger in a subshell started by ranger. -# Special value "bad" makes the warning more visible. +# Special value "error" makes the warning more visible. set nested_ranger_warning true # =================================================================== diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 58e9df2e..0b098659 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -106,8 +106,7 @@ ALLOWED_VALUES = { 'confirm_on_delete': ['multiple', 'always', 'never'], 'draw_borders': ['none', 'both', 'outline', 'separators'], 'line_numbers': ['false', 'absolute', 'relative'], - 'nested_ranger_warning': ['true', 'false', 'yes', 'no', 'enabled', - 'disabled', 'bad'], + 'nested_ranger_warning': ['true', 'false', 'error'], 'one_indexed': [False, True], 'preview_images_method': ['w3m', 'iterm2', 'terminology', 'urxvt', 'urxvt-full', 'kitty', diff --git a/ranger/core/main.py b/ranger/core/main.py index bc0b742a..aefaacbc 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -183,10 +183,10 @@ def main( if int(os.environ[level]) > 1: warning = 'Warning:' nested_warning = "You're in a nested ranger instance!" - nrw = fm.settings.nested_ranger_warning.lower() - if nrw in ['true', 'yes', 'enabled']: + warn_when_nested = fm.settings.nested_ranger_warning.lower() + if warn_when_nested == 'true': fm.notify(' '.join((warning, nested_warning)), bad=False) - elif nrw == 'bad': + elif warn_when_nested == 'error': fm.notify(' '.join((warning.upper(), nested_warning + '!!')), bad=True) -- cgit 1.4.1-2-gfad0 From 3c2f560bfafb41a85955cd2475915f24ed325b49 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 18 Aug 2019 15:22:52 +0200 Subject: Regenerate the manpages --- doc/ranger.1 | 22 +++++++++++----------- doc/rifle.1 | 22 +++++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index af13e690..f209f5fa 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -46,7 +46,7 @@ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is turned on, we'll generate index entries on stderr for +.\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. @@ -56,12 +56,12 @@ .. .nr rF 0 .if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{ -. if \nF \{ +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{ +. if !\nF==2 \{\ . nr % 0 . nr F 2 . \} @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "18-08-2019" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "08/18/2019" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -173,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to \&\fI/usr/share/doc/ranger/examples\fR. .PP -The man page of \fIrifle\fR\|(1) describes the functions of the file opener +The man page of \fBrifle\fR\|(1) describes the functions of the file opener .PP The section \fI\s-1LINKS\s0\fR of this man page contains further resources. .SH "POSITIONAL ARGUMENTS" @@ -342,7 +342,7 @@ To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR t \fIkitty\fR .IX Subsection "kitty" .PP -This only works on Kitty. It requires \s-1PIL \s0(or pillow) to work. +This only works on Kitty. It requires \s-1PIL\s0 (or pillow) to work. Allows remote image previews, for example in an ssh session. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. @@ -666,7 +666,7 @@ Toggle the mark-status of all files .IP "V" 14 .IX Item "V" Starts the visual mode, which selects all files between the starting point and -the cursor until you press \s-1ESC. \s0 To unselect files in the same way, use \*(L"uV\*(R". +the cursor until you press \s-1ESC.\s0 To unselect files in the same way, use \*(L"uV\*(R". .IP "/" 14 Search for files in the current directory. .IP ":" 14 @@ -1691,7 +1691,7 @@ Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is installed, unless \fIhighlight\fR is also installed. Find out possible values by running: python \-c 'import pygments.styles; [print(stl) for stl in - pygments.styles.\fIget_all_styles()\fR]' + pygments.styles.\fBget_all_styles()\fR]' .IP "\s-1HIGHLIGHT_STYLE\s0" 8 .IX Item "HIGHLIGHT_STYLE" Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is @@ -1750,7 +1750,7 @@ copy, run: .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fIrifle\fR\|(1) +\&\fBrifle\fR\|(1) .SH "BUGS" .IX Header "BUGS" Report bugs here: diff --git a/doc/rifle.1 b/doc/rifle.1 index a42734d2..114cc5d0 100644 --- a/doc/rifle.1 +++ b/doc/rifle.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -54,16 +54,20 @@ .\" Avoid warning from groff about undefined register 'F'. .de IX .. -.if !\nF .nr F 0 -.if \nF>0 \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ -. nr % 0 -. nr F 2 +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} . \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -129,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RIFLE 1" -.TH RIFLE 1 "rifle-1.9.2" "2019-04-03" "rifle manual" +.TH RIFLE 1 "rifle-1.9.2" "08/18/2019" "rifle manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l -- cgit 1.4.1-2-gfad0 From c2d7e36e819b1b11aa9af28b9e9a6fbb26eca7c4 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 1 Sep 2019 17:21:37 +0200 Subject: Switch manpage date from locale dependent to ISO UTC Having the date in the manpage depend on a user's locale and their timezone makes the format change depending on which user generates it. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 87c5ff1b..7e2c62da 100644 --- a/Makefile +++ b/Makefile @@ -127,9 +127,9 @@ test: test_py test_shellcheck man: pod2man --stderr --center='ranger manual' --date='$(NAME)-$(VERSION)' \ - --release=$(shell date +%x) doc/ranger.pod doc/ranger.1 + --release=$(shell date -u '+%Y-%m-%d') doc/ranger.pod doc/ranger.1 pod2man --stderr --center='rifle manual' --date='$(NAME_RIFLE)-$(VERSION_RIFLE)' \ - --release=$(shell date +%x) doc/rifle.pod doc/rifle.1 + --release=$(shell date -u '+%Y-%m-%d') doc/rifle.pod doc/rifle.1 manhtml: pod2html doc/ranger.pod --outfile=doc/ranger.1.html -- cgit 1.4.1-2-gfad0 From 94a621ae4e218c49a0446a700774d79519d71941 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 3 Sep 2019 19:42:10 +0200 Subject: Add GitHub Actions ci Run our python tests and shellcheck in seperate workflows only when relevant files are changed, respectively python files or `scope.sh`. This tests with one extra version of python, 3.7. GitHub's version of shellcheck seems to be missing a few flags. So we download the latest stable version, 0.7.0 currently. --- .github/workflows/python.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/shellcheck.yml | 22 ++++++++++++++++++++++ ranger/data/scope.sh | 1 - 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/python.yml create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000..6e872db5 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,30 @@ +name: Python lints and tests + +on: + push: + paths: + - '.github/workflows/python.yml' + - '*.py' + +jobs: + test_py: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7] + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint and test with pylint, flake8, doctest, pytest + run: | + make test_py diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000..0d10cf61 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,22 @@ +name: Shellcheck scope.sh + +on: + push: + paths: + - '.github/workflows/shellcheck.yml' + - 'ranger/data/scope.sh' + +jobs: + test_shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install newer shellcheck (0.7.0 rather than 0.4.6) + run: | + curl -LO "https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz" + tar xf shellcheck-stable.linux.x86_64.tar.xz + - name: Shellcheck scope.sh + run: | + env PATH=shellcheck-stable:$PATH make test_shellcheck diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 306eeed0..eb09b2bf 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -45,7 +45,6 @@ HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo} HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}" PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn} - handle_extension() { case "${FILE_EXTENSION_LOWER}" in ## Archive -- cgit 1.4.1-2-gfad0 From 02198a6d5e0ecefa30ca4f6c5734276528b36dd7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 9 Sep 2019 17:43:51 +0200 Subject: Correct the description of 'quit' Quit closes a tab only when there is more than one tab; otherwise, it quits the program. Also fix a typo. --- doc/ranger.1 | 2 +- ranger/config/commands.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index f209f5fa..ae9543ad 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1428,7 +1428,7 @@ a row. Removes key mappings of the pager. Works like the \f(CW\*(C`unmap\*(C'\fR command. .IP "quit" 2 .IX Item "quit" -Closes the current tab, if there's only one tab. Otherwise quits if there are no tasks in progress. +Closes the current tab, if there's more than one tab. Otherwise quits if there are no tasks in progress. The current directory will be bookmarked as ' so you can re-enter it by typing `` or '' the next time you start ranger. .IP "quit!" 2 diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 2b1f4940..55dd9cd1 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -572,7 +572,7 @@ class default_linemode(Command): class quit(Command): # pylint: disable=redefined-builtin """:quit - Closes the current tab, if there's only one tab. + Closes the current tab, if there's more than one tab. Otherwise quits if there are no tasks in progress. """ def _exit_no_work(self): @@ -591,7 +591,7 @@ class quit(Command): # pylint: disable=redefined-builtin class quit_bang(Command): """:quit! - Closes the current tab, if there's only one tab. + Closes the current tab, if there's more than one tab. Otherwise force quits immediately. """ name = 'quit!' @@ -1244,7 +1244,7 @@ class copycmap(copymap): class copytmap(copymap): - """:copycmap [...] + """:copytmap [...] Copies a "taskview" keybinding from to """ -- cgit 1.4.1-2-gfad0 From 617c36064a083f15b477f95efa009c84836f975e Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 10 Sep 2019 19:47:25 +0200 Subject: core.actions: Log which files were deleted --- ranger/core/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 435fcf13..25b01e2c 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1607,10 +1607,10 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m def delete(self, files=None): # XXX: warn when deleting mount points/unseen marked files? - self.notify("Deleting!") # COMPAT: old command.py use fm.delete() without arguments if files is None: files = (fobj.path for fobj in self.thistab.get_selection()) + self.notify("Deleting {}!".format(", ".join(files))) files = [os.path.abspath(path) for path in files] for path in files: # Untag the deleted files. -- cgit 1.4.1-2-gfad0 From d108cc669f4538e34a31e9e0ce03fb906f651e7b Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 17 Sep 2019 20:50:23 +0200 Subject: Manpage typo for kitty preview method --- doc/ranger.1 | 24 ++++++++++++------------ doc/ranger.pod | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index ae9543ad..c4a63496 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -46,7 +46,7 @@ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is >0, we'll generate index entries on stderr for +.\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. @@ -56,12 +56,12 @@ .. .nr rF 0 .if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{\ -. if \nF \{\ +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{\ +. if !\nF==2 \{ . nr % 0 . nr F 2 . \} @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "08/18/2019" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-09-17" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -173,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to \&\fI/usr/share/doc/ranger/examples\fR. .PP -The man page of \fBrifle\fR\|(1) describes the functions of the file opener +The man page of \fIrifle\fR\|(1) describes the functions of the file opener .PP The section \fI\s-1LINKS\s0\fR of this man page contains further resources. .SH "POSITIONAL ARGUMENTS" @@ -342,7 +342,7 @@ To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR t \fIkitty\fR .IX Subsection "kitty" .PP -This only works on Kitty. It requires \s-1PIL\s0 (or pillow) to work. +This only works in Kitty. It requires \s-1PIL \s0(or pillow) to work. Allows remote image previews, for example in an ssh session. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. @@ -666,7 +666,7 @@ Toggle the mark-status of all files .IP "V" 14 .IX Item "V" Starts the visual mode, which selects all files between the starting point and -the cursor until you press \s-1ESC.\s0 To unselect files in the same way, use \*(L"uV\*(R". +the cursor until you press \s-1ESC. \s0 To unselect files in the same way, use \*(L"uV\*(R". .IP "/" 14 Search for files in the current directory. .IP ":" 14 @@ -1428,7 +1428,7 @@ a row. Removes key mappings of the pager. Works like the \f(CW\*(C`unmap\*(C'\fR command. .IP "quit" 2 .IX Item "quit" -Closes the current tab, if there's more than one tab. Otherwise quits if there are no tasks in progress. +Closes the current tab, if there's only one tab. Otherwise quits if there are no tasks in progress. The current directory will be bookmarked as ' so you can re-enter it by typing `` or '' the next time you start ranger. .IP "quit!" 2 @@ -1691,7 +1691,7 @@ Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is installed, unless \fIhighlight\fR is also installed. Find out possible values by running: python \-c 'import pygments.styles; [print(stl) for stl in - pygments.styles.\fBget_all_styles()\fR]' + pygments.styles.\fIget_all_styles()\fR]' .IP "\s-1HIGHLIGHT_STYLE\s0" 8 .IX Item "HIGHLIGHT_STYLE" Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is @@ -1750,7 +1750,7 @@ copy, run: .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fBrifle\fR\|(1) +\&\fIrifle\fR\|(1) .SH "BUGS" .IX Header "BUGS" Report bugs here: diff --git a/doc/ranger.pod b/doc/ranger.pod index 4b44fc92..8d53dc70 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -247,7 +247,7 @@ To enable this feature, set the option C to urxvt-full. =head3 kitty -This only works on Kitty. It requires PIL (or pillow) to work. +This only works in Kitty. It requires PIL (or pillow) to work. Allows remote image previews, for example in an ssh session. To enable this feature, set the option C to kitty. -- cgit 1.4.1-2-gfad0 From bbb66cd9d7b27443f2d1a44f02c34f3b1ea851f7 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 17 Sep 2019 20:52:11 +0200 Subject: Reorder preview method sections alphabetically --- doc/ranger.1 | 34 +++++++++++++++++----------------- doc/ranger.pod | 30 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index c4a63496..c7825f15 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -290,18 +290,6 @@ Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option \f(CW\*(C`preview_images\*(C'\fR to true and enable one of the image preview modes: .PP -\fIw3m\fR -.IX Subsection "w3m" -.PP -This does not work over ssh, requires certain terminals (tested on \*(L"xterm\*(R" and -\&\*(L"urxvt\*(R") and is incompatible with tmux, although it works with screen. -.PP -To enable this feature, install the program \*(L"w3m\*(R" and set the option -\&\f(CW\*(C`preview_images_method\*(C'\fR to w3m. -.PP -When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned. -Use the \f(CW\*(C`w3m_offset\*(C'\fR option to manually adjust the image offset. This should be the same value as the terminal's border value. -.PP \fIiTerm2\fR .IX Subsection "iTerm2" .PP @@ -314,6 +302,14 @@ This feature relies on the dimensions of the terminal's font. By default, a width of 8 and height of 11 are used. To use other values, set the options \&\f(CW\*(C`iterm2_font_width\*(C'\fR and \f(CW\*(C`iterm2_font_height\*(C'\fR to the desired values. .PP +\fIkitty\fR +.IX Subsection "kitty" +.PP +This only works in Kitty. It requires \s-1PIL \s0(or pillow) to work. +Allows remote image previews, for example in an ssh session. +.PP +To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. +.PP \fIterminology\fR .IX Subsection "terminology" .PP @@ -339,13 +335,17 @@ window. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to urxvt-full. .PP -\fIkitty\fR -.IX Subsection "kitty" +\fIw3m\fR +.IX Subsection "w3m" .PP -This only works in Kitty. It requires \s-1PIL \s0(or pillow) to work. -Allows remote image previews, for example in an ssh session. +This does not work over ssh, requires certain terminals (tested on \*(L"xterm\*(R" and +\&\*(L"urxvt\*(R") and is incompatible with tmux, although it works with screen. .PP -To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. +To enable this feature, install the program \*(L"w3m\*(R" and set the option +\&\f(CW\*(C`preview_images_method\*(C'\fR to w3m. +.PP +When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned. +Use the \f(CW\*(C`w3m_offset\*(C'\fR option to manually adjust the image offset. This should be the same value as the terminal's border value. .SS "\s-1SELECTION\s0" .IX Subsection "SELECTION" The \fIselection\fR is defined as \*(L"All marked files \s-1IF THERE ARE ANY,\s0 otherwise diff --git a/doc/ranger.pod b/doc/ranger.pod index 8d53dc70..620efdcc 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -201,17 +201,6 @@ Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option C to true and enable one of the image preview modes: -=head3 w3m - -This does not work over ssh, requires certain terminals (tested on "xterm" and -"urxvt") and is incompatible with tmux, although it works with screen. - -To enable this feature, install the program "w3m" and set the option -C to w3m. - -When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned. -Use the C option to manually adjust the image offset. This should be the same value as the terminal's border value. - =head3 iTerm2 This only works in iTerm2 compiled with image preview support, but works over @@ -223,6 +212,13 @@ This feature relies on the dimensions of the terminal's font. By default, a width of 8 and height of 11 are used. To use other values, set the options C and C to the desired values. +=head3 kitty + +This only works in Kitty. It requires PIL (or pillow) to work. +Allows remote image previews, for example in an ssh session. + +To enable this feature, set the option C to kitty. + =head3 terminology This only works in terminology. It can render vector graphics, but works only locally. @@ -245,12 +241,16 @@ window. To enable this feature, set the option C to urxvt-full. -=head3 kitty +=head3 w3m -This only works in Kitty. It requires PIL (or pillow) to work. -Allows remote image previews, for example in an ssh session. +This does not work over ssh, requires certain terminals (tested on "xterm" and +"urxvt") and is incompatible with tmux, although it works with screen. -To enable this feature, set the option C to kitty. +To enable this feature, install the program "w3m" and set the option +C to w3m. + +When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned. +Use the C option to manually adjust the image offset. This should be the same value as the terminal's border value. =head2 SELECTION -- cgit 1.4.1-2-gfad0 From 061aabf404681e477302549ab42f43967dc53a64 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 17 Sep 2019 20:57:57 +0200 Subject: Document überzug preview method in the manpage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1453 --- doc/ranger.1 | 10 ++++++++++ doc/ranger.pod | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index c7825f15..6453cc79 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -317,6 +317,16 @@ This only works in terminology. It can render vector graphics, but works only lo .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to terminology. .PP +\fIueberzug\fR +.IX Subsection "ueberzug" +.PP +U\*:berzug is a command line utility which draws images on terminals using child +windows. It requires \s-1PIL \s0(or pillow) and relies on X11. This makes it +compatible (in a limited way, i.e., tmux splits are not supported) with many +terminals and tmux but not the linux console or Wayland. +.PP +To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to ueberzug. +.PP \fIurxvt\fR .IX Subsection "urxvt" .PP diff --git a/doc/ranger.pod b/doc/ranger.pod index 620efdcc..61268855 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -225,6 +225,15 @@ This only works in terminology. It can render vector graphics, but works only lo To enable this feature, set the option C to terminology. +=head3 ueberzug + +Überzug is a command line utility which draws images on terminals using child +windows. It requires PIL (or pillow) and relies on X11. This makes it +compatible (in a limited way, i.e., tmux splits are not supported) with many +terminals and tmux but not the linux console or Wayland. + +To enable this feature, set the option C to ueberzug. + =head3 urxvt This only works in urxvt compiled with pixbuf support. Does not work over ssh. -- cgit 1.4.1-2-gfad0 From b3d59046ec0fbf6f84529e4d2b8c701db5608643 Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Tue, 17 Sep 2019 21:38:22 +0200 Subject: Capitalize Linux --- doc/ranger.1 | 24 ++++++++++++------------ doc/ranger.pod | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 6453cc79..eba636b3 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -46,7 +46,7 @@ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is turned on, we'll generate index entries on stderr for +.\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. @@ -56,12 +56,12 @@ .. .nr rF 0 .if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{ -. if \nF \{ +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{ +. if !\nF==2 \{\ . nr % 0 . nr F 2 . \} @@ -173,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger with other software. They are usually installed to \&\fI/usr/share/doc/ranger/examples\fR. .PP -The man page of \fIrifle\fR\|(1) describes the functions of the file opener +The man page of \fBrifle\fR\|(1) describes the functions of the file opener .PP The section \fI\s-1LINKS\s0\fR of this man page contains further resources. .SH "POSITIONAL ARGUMENTS" @@ -305,7 +305,7 @@ width of 8 and height of 11 are used. To use other values, set the options \fIkitty\fR .IX Subsection "kitty" .PP -This only works in Kitty. It requires \s-1PIL \s0(or pillow) to work. +This only works in Kitty. It requires \s-1PIL\s0 (or pillow) to work. Allows remote image previews, for example in an ssh session. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty. @@ -321,9 +321,9 @@ To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR t .IX Subsection "ueberzug" .PP U\*:berzug is a command line utility which draws images on terminals using child -windows. It requires \s-1PIL \s0(or pillow) and relies on X11. This makes it +windows. It requires \s-1PIL\s0 (or pillow) and relies on X11. This makes it compatible (in a limited way, i.e., tmux splits are not supported) with many -terminals and tmux but not the linux console or Wayland. +terminals and tmux but not the Linux console or Wayland. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to ueberzug. .PP @@ -676,7 +676,7 @@ Toggle the mark-status of all files .IP "V" 14 .IX Item "V" Starts the visual mode, which selects all files between the starting point and -the cursor until you press \s-1ESC. \s0 To unselect files in the same way, use \*(L"uV\*(R". +the cursor until you press \s-1ESC.\s0 To unselect files in the same way, use \*(L"uV\*(R". .IP "/" 14 Search for files in the current directory. .IP ":" 14 @@ -1701,7 +1701,7 @@ Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is installed, unless \fIhighlight\fR is also installed. Find out possible values by running: python \-c 'import pygments.styles; [print(stl) for stl in - pygments.styles.\fIget_all_styles()\fR]' + pygments.styles.\fBget_all_styles()\fR]' .IP "\s-1HIGHLIGHT_STYLE\s0" 8 .IX Item "HIGHLIGHT_STYLE" Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is @@ -1760,7 +1760,7 @@ copy, run: .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" -\&\fIrifle\fR\|(1) +\&\fBrifle\fR\|(1) .SH "BUGS" .IX Header "BUGS" Report bugs here: diff --git a/doc/ranger.pod b/doc/ranger.pod index 61268855..2702a415 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -230,7 +230,7 @@ To enable this feature, set the option C to terminology. Überzug is a command line utility which draws images on terminals using child windows. It requires PIL (or pillow) and relies on X11. This makes it compatible (in a limited way, i.e., tmux splits are not supported) with many -terminals and tmux but not the linux console or Wayland. +terminals and tmux but not the Linux console or Wayland. To enable this feature, set the option C to ueberzug. -- cgit 1.4.1-2-gfad0 From 9befac323ac6fc0c1d31aa7ce0dbe3bc9907377c Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 1 Sep 2019 17:59:02 +0200 Subject: Add example to copymap manpage entry Fixes #1678 --- doc/ranger.1 | 5 +++-- doc/ranger.pod | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index eba636b3..8944d4b1 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-09-17" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-09-18" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1265,7 +1265,8 @@ See \f(CW\*(C`copymap\*(C'\fR .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. +is not modified. For example, \fIcopymap j down\fR will make the key sequence +\&\*(L"down\*(R" move the cursor down one item. .Sp To copy key bindings of the console, taskview, or pager use \*(L"copycmap\*(R", \&\*(L"copytmap\*(R" or \*(L"copypmap\*(R". diff --git a/doc/ranger.pod b/doc/ranger.pod index 2702a415..34a012ea 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1325,7 +1325,8 @@ See C Copies the keybinding I to I 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. +is not modified. For example, I will make the key sequence +"down" move the cursor down one item. To copy key bindings of the console, taskview, or pager use "copycmap", "copytmap" or "copypmap". -- cgit 1.4.1-2-gfad0 From 4b917d2752f7b8af98765e23101b4caeaaa8b8c9 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 2 Sep 2019 14:18:52 +0200 Subject: Remove redundant copymap sections The extra entries pointing from `copycmap` and co. to `copymap` only contributed noise and confusion making their explanation harder to find. This has summarily been dealt with using my exemplary SEO skills ; ) Fixes #1678 --- doc/ranger.1 | 13 ++----------- doc/ranger.pod | 16 ++-------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 8944d4b1..c9f56403 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1258,9 +1258,6 @@ 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 @@ -1268,14 +1265,8 @@ deep copy, so if you change the new binding (or parts of it) later, the old one is not modified. For example, \fIcopymap j down\fR will make the key sequence \&\*(L"down\*(R" move the cursor down one item. .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 +To copy key bindings of the console, taskview or pager use \*(L"copycmap\*(R", +\&\*(L"copytmap\*(R" or \*(L"copypmap\*(R" respectively. .IP "cunmap [\fIkeys...\fR]" 2 .IX Item "cunmap [keys...]" Removes key mappings of the console. Works like the \f(CW\*(C`unmap\*(C'\fR command. diff --git a/doc/ranger.pod b/doc/ranger.pod index 34a012ea..f6dd6592 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1317,10 +1317,6 @@ Binds keys for the console. Works like the C command. Opens the console with the command already typed in. The cursor is placed at I. -=item copycmap I I [I ...] - -See C - =item copymap I I [I ...] Copies the keybinding I to I in the "browser" context. This is a @@ -1328,16 +1324,8 @@ deep copy, so if you change the new binding (or parts of it) later, the old one is not modified. For example, I will make the key sequence "down" move the cursor down one item. -To copy key bindings of the console, taskview, or pager use "copycmap", -"copytmap" or "copypmap". - -=item copypmap I I [I ...] - -See C - -=item copytmap I I [I ...] - -See C +To copy key bindings of the console, taskview or pager use "copycmap", +"copytmap" or "copypmap" respectively. =item cunmap [I] -- cgit 1.4.1-2-gfad0 From 63906912292494dd27ca3637b992d9970492f4fc Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 18 Sep 2019 20:33:42 +0200 Subject: Drop py3.7 Temporarily drop python 3.7 from the workflow because it's not compatible with `pylint<2`. --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6e872db5..3dd1b765 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,7 +12,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.5, 3.6, 3.7] + python-version: [2.7, 3.5, 3.6] steps: - uses: actions/checkout@v1 with: -- cgit 1.4.1-2-gfad0 From 1246ce5b4d1705b9f3f5db622ccd7d37b06a06a5 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 18 Sep 2019 20:34:32 +0200 Subject: Segregate python 3.7 workflow By seperating the python 3.7 workflow we can keep an eye on changed linting errors for the newer pylint. Without cancelling the actions for our current setup. --- .github/workflows/py37.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/py37.yml diff --git a/.github/workflows/py37.yml b/.github/workflows/py37.yml new file mode 100644 index 00000000..ca8210a2 --- /dev/null +++ b/.github/workflows/py37.yml @@ -0,0 +1,30 @@ +name: Python 3.7 lints and tests + +on: + push: + paths: + - '.github/workflows/py37.yml' + - '*.py' + +jobs: + test_py: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r <(sed 's/<2//' requirements.txt) + - name: Lint and test with pylint, flake8, doctest, pytest + run: | + make test_py -- cgit 1.4.1-2-gfad0 From 4c0614fd6055fbe7e98db1fc61e21b0049140c57 Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Fri, 20 Sep 2019 23:52:11 +0200 Subject: Give cmap and cunmap and friends similar treatment No longer will searching the docs say "Look elsewhere for the information you were hoping to find." All these sections did was clutter search results. I took the liberty to reorder all the "taskview or pager" entries because for some reason they weren't alphabetic. --- doc/ranger.1 | 30 ++++++------------------------ doc/ranger.pod | 34 +++++----------------------------- 2 files changed, 11 insertions(+), 53 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index c9f56403..39cb6fca 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-09-18" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-09-20" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1251,9 +1251,6 @@ example, \fB+ar\fR allows reading for everyone, \-ow forbids others to write and 777= allows everything. .Sp See also: man 1 chmod -.IP "cmap \fIkey\fR \fIcommand\fR" 2 -.IX Item "cmap key command" -Binds keys for the console. Works like the \f(CW\*(C`map\*(C'\fR command. .IP "console [\-p\fIN\fR] \fIcommand\fR" 2 .IX Item "console [-pN] command" Opens the console with the command already typed in. The cursor is placed at @@ -1265,11 +1262,8 @@ deep copy, so if you change the new binding (or parts of it) later, the old one is not modified. For example, \fIcopymap j down\fR will make the key sequence \&\*(L"down\*(R" move the cursor down one item. .Sp -To copy key bindings of the console, taskview or pager use \*(L"copycmap\*(R", -\&\*(L"copytmap\*(R" or \*(L"copypmap\*(R" respectively. -.IP "cunmap [\fIkeys...\fR]" 2 -.IX Item "cunmap [keys...]" -Removes key mappings of the console. Works like the \f(CW\*(C`unmap\*(C'\fR command. +To copy key bindings of the console, pager or taskview use \*(L"copycmap\*(R", +\&\*(L"copypmap\*(R" or \*(L"copytmap\*(R" respectively. .IP "default_linemode [\fIpath=regexp\fR | \fItag=tags\fR] \fIlinemodename\fR" 2 .IX Item "default_linemode [path=regexp | tag=tags] linemodename" Sets the default linemode. See \fIlinemode\fR command. @@ -1383,8 +1377,8 @@ when typing the key, like 5j, it will be passed to the command as the attribute \&\*(L"self.quantifier\*(R". .Sp The keys you bind with this command are accessible in the file browser only, -not in the console, task view or pager. To bind keys there, use the commands -\&\*(L"cmap\*(R", \*(L"tmap\*(R" or \*(L"pmap\*(R". +not in the console, pager or taskview. To bind keys there, use the commands +\&\*(L"cmap\*(R", \*(L"pmap\*(R" or \*(L"tmap\*(R". .IP "mark \fIpattern\fR" 2 .IX Item "mark pattern" Mark all files matching the regular expression pattern. @@ -1418,16 +1412,10 @@ of applications is generated by the external file opener \*(L"rifle\*(R" and can displayed when pressing \*(L"r\*(R" in ranger. .Sp Note that if you specify an application, the mode is ignored. -.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 "prompt_metadata [\fIkeys ...\fR]" 2 .IX Item "prompt_metadata [keys ...]" Prompt the user to input metadata with the \f(CW\*(C`meta\*(C'\fR command for multiple keys in a row. -.IP "punmap [\fIkeys ...\fR]" 2 -.IX Item "punmap [keys ...]" -Removes key mappings of the pager. Works like the \f(CW\*(C`unmap\*(C'\fR command. .IP "quit" 2 .IX Item "quit" Closes the current tab, if there's only one tab. Otherwise quits if there are no tasks in progress. @@ -1554,9 +1542,6 @@ Scroll the file preview by \fIvalue\fR lines. .IP "terminal" 2 .IX Item "terminal" Spawns the \fIx\-terminal-emulator\fR starting in the current directory. -.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 "touch \fIfilename\fR" 2 .IX Item "touch filename" Creates an empty file with the name \fIfilename\fR, unless it already exists. @@ -1569,13 +1554,10 @@ is automatically reopened, allowing for fast travel. To close the console, press \s-1ESC\s0 or execute a file. .Sp This command is based on the \fIscout\fR command and supports all of its options. -.IP "tunmap [\fIkeys ...\fR]" 2 -.IX Item "tunmap [keys ...]" -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". +in the console, pager, or taskview use \*(L"cunmap\*(R", \*(L"punmap\*(R" or \*(L"tunmap\*(R". .IP "unmark \fIpattern\fR" 2 .IX Item "unmark pattern" Unmark all files matching a regular expression pattern. diff --git a/doc/ranger.pod b/doc/ranger.pod index f6dd6592..dfb9386a 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1308,10 +1308,6 @@ example, B<+ar> allows reading for everyone, -ow forbids others to write and See also: man 1 chmod -=item cmap I I - -Binds keys for the console. Works like the C command. - =item console [-pI] I Opens the console with the command already typed in. The cursor is placed at @@ -1324,12 +1320,8 @@ deep copy, so if you change the new binding (or parts of it) later, the old one is not modified. For example, I will make the key sequence "down" move the cursor down one item. -To copy key bindings of the console, taskview or pager use "copycmap", -"copytmap" or "copypmap" respectively. - -=item cunmap [I] - -Removes key mappings of the console. Works like the C command. +To copy key bindings of the console, pager or taskview use "copycmap", +"copypmap" or "copytmap" respectively. =item default_linemode [I | I] I @@ -1456,8 +1448,8 @@ when typing the key, like 5j, it will be passed to the command as the attribute "self.quantifier". The keys you bind with this command are accessible in the file browser only, -not in the console, task view or pager. To bind keys there, use the commands -"cmap", "tmap" or "pmap". +not in the console, pager or taskview. To bind keys there, use the commands +"cmap", "pmap" or "tmap". =item mark I @@ -1495,19 +1487,11 @@ displayed when pressing "r" in ranger. Note that if you specify an application, the mode is ignored. -=item pmap I I - -Binds keys for the pager. Works like the C command. - =item prompt_metadata [I] Prompt the user to input metadata with the C command for multiple keys in a row. -=item punmap [I] - -Removes key mappings of the pager. Works like the C command. - =item quit Closes the current tab, if there's only one tab. Otherwise quits if there are no tasks in progress. @@ -1646,10 +1630,6 @@ Scroll the file preview by I lines. Spawns the I starting in the current directory. -=item tmap I I - -Binds keys for the taskview. Works like the C command. - =item touch I Creates an empty file with the name I, unless it already exists. @@ -1664,14 +1644,10 @@ To close the console, press ESC or execute a file. This command is based on the I command and supports all of its options. -=item tunmap [I] - -Removes key mappings of the taskview. Works like the C command. - =item unmap [I ...] Removes the given key mappings in the "browser" context. To unmap key bindings -in the console, taskview, or pager use "cunmap", "tunmap" or "punmap". +in the console, pager, or taskview use "cunmap", "punmap" or "tunmap". =item unmark I -- cgit 1.4.1-2-gfad0 From 30e04fe6ef9d27e02362821e3a9409cda52e4357 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 23 Sep 2019 23:28:14 +0200 Subject: Add multiple section headings for command variations I also added a utf8 encoding directive because pod2man complains otherwise and I see no reason not to have a utf8 manpage. --- doc/ranger.1 | 33 ++++++++++++++++++++++++++++----- doc/ranger.pod | 25 ++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 39cb6fca..36a0f784 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,12 +133,11 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-09-20" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-09-23" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh -.SH "NAME" ranger \- visual file manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" @@ -1255,8 +1254,16 @@ See also: man 1 chmod .IX Item "console [-pN] command" Opens the console with the command already typed in. The cursor is placed at \&\fIN\fR. -.IP "copymap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2 +.IP "copymap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2 .IX Item "copymap key newkey [newkey2 ...]" +.PD 0 +.IP "copycmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2 +.IX Item "copycmap key newkey [newkey2 ...]" +.IP "copypmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2 +.IX Item "copypmap key newkey [newkey2 ...]" +.IP "copytmap \fIkey\fR \fInewkey\fR [\fInewkey2\fR ...]" 2 +.IX Item "copytmap key newkey [newkey2 ...]" +.PD 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. For example, \fIcopymap j down\fR will make the key sequence @@ -1369,8 +1376,16 @@ See the \fIranger.core.linemode\fR module for some examples. .IX Item "load_copy_buffer" Load the copy buffer from \fI~/.config/ranger/copy_buffer\fR. This can be used to pass the list of copied files to another ranger instance. -.IP "map \fIkey\fR \fIcommand\fR" 2 +.IP "map \fIkey\fR \fIcommand\fR" 2 .IX Item "map key command" +.PD 0 +.IP "cmap \fIkey\fR \fIcommand\fR" 2 +.IX Item "cmap key command" +.IP "pmap \fIkey\fR \fIcommand\fR" 2 +.IX Item "pmap key command" +.IP "tmap \fIkey\fR \fIcommand\fR" 2 +.IX Item "tmap key command" +.PD Assign the key combination to the given command. Whenever you type the key/keys, the command will be executed. Additionally, if you use a quantifier when typing the key, like 5j, it will be passed to the command as the attribute @@ -1554,8 +1569,16 @@ is automatically reopened, allowing for fast travel. To close the console, press \s-1ESC\s0 or execute a file. .Sp This command is based on the \fIscout\fR command and supports all of its options. -.IP "unmap [\fIkeys\fR ...]" 2 +.IP "unmap [\fIkeys\fR ...]" 2 .IX Item "unmap [keys ...]" +.PD 0 +.IP "cunmap [\fIkeys\fR ...]" 2 +.IX Item "cunmap [keys ...]" +.IP "punmap [\fIkeys\fR ...]" 2 +.IX Item "punmap [keys ...]" +.IP "tunmap [\fIkeys\fR ...]" 2 +.IX Item "tunmap [keys ...]" +.PD Removes the given key mappings in the \*(L"browser\*(R" context. To unmap key bindings in the console, pager, or taskview use \*(L"cunmap\*(R", \*(L"punmap\*(R" or \*(L"tunmap\*(R". .IP "unmark \fIpattern\fR" 2 diff --git a/doc/ranger.pod b/doc/ranger.pod index dfb9386a..e84c13a7 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1,3 +1,4 @@ +=encoding utf8 =head1 NAME ranger - visual file manager @@ -1313,7 +1314,13 @@ See also: man 1 chmod Opens the console with the command already typed in. The cursor is placed at I. -=item copymap I I [I ...] +=item copymap I I [I ...] + +=item copycmap I I [I ...] + +=item copypmap I I [I ...] + +=item copytmap I I [I ...] Copies the keybinding I to I in the "browser" context. This is a deep copy, so if you change the new binding (or parts of it) later, the old one @@ -1440,7 +1447,13 @@ See the I module for some examples. Load the copy buffer from F<~/.config/ranger/copy_buffer>. This can be used to pass the list of copied files to another ranger instance. -=item map I I +=item map I I + +=item cmap I I + +=item pmap I I + +=item tmap I I Assign the key combination to the given command. Whenever you type the key/keys, the command will be executed. Additionally, if you use a quantifier @@ -1644,7 +1657,13 @@ To close the console, press ESC or execute a file. This command is based on the I command and supports all of its options. -=item unmap [I ...] +=item unmap [I ...] + +=item cunmap [I ...] + +=item punmap [I ...] + +=item tunmap [I ...] Removes the given key mappings in the "browser" context. To unmap key bindings in the console, pager, or taskview use "cunmap", "punmap" or "tunmap". -- cgit 1.4.1-2-gfad0 From fbc8ae5b3768ebbe7967dd9dd6b3b0fe7856fb5d Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 8 Sep 2019 15:38:58 +0200 Subject: Document tab_shift keybindings Fixes #1592 --- doc/ranger.1 | 5 ++++- doc/ranger.pod | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 36a0f784..ee4c84e7 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-09-23" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-09-24" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -700,6 +700,9 @@ Open the console with the most recent command. .IX Item "Alt-N" Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it will be created. +.IP "Alt-l, Alt-r" 14 +.IX Item "Alt-l, Alt-r" +Shift a tab left, respectively right. .IP "gn, ^N" 14 .IX Item "gn, ^N" Create a new tab. diff --git a/doc/ranger.pod b/doc/ranger.pod index e84c13a7..beb2fdb8 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -649,6 +649,10 @@ Open the console with the most recent command. Open a tab. N has to be a number from 0 to 9. If the tab doesn't exist yet, it will be created. +=item Alt-l, Alt-r + +Shift a tab left, respectively right. + =item gn, ^N Create a new tab. -- cgit 1.4.1-2-gfad0 From 8889cb85f873dd32e94c5b1e03646abb8f27c3a2 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 24 Sep 2019 18:43:54 +0200 Subject: Seperate doctests and pytests Doctests are interfering with CI because curses can't find the terminfo database. This'll require looking into but for now we'll run the doctests seperately and expect failure. Same thing for pytests. --- .github/workflows/doctest.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/python.yml | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/doctest.yml diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml new file mode 100644 index 00000000..f12cb926 --- /dev/null +++ b/.github/workflows/doctest.yml @@ -0,0 +1,30 @@ +name: Python doctest and pytest + +on: + push: + paths: + - '.github/workflows/doctest.yml' + - '*.py' + +jobs: + test_py: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [2.7, 3.5, 3.6] + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: doctest + run: | + make test_doctest test_other diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 3dd1b765..1daba84c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -25,6 +25,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - - name: Lint and test with pylint, flake8, doctest, pytest + - name: Lint and test with pylint, flake8, -d-o-c-t-e-s-t-, -p-y-t-e-s-t- run: | - make test_py + make test_pylint test_flake8 test_pytest -- cgit 1.4.1-2-gfad0 From eeaa300be0fd507ef057082a4018db11ebba3503 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 5 Aug 2019 15:21:42 +0200 Subject: Apply debian patch 0004 desktop entry lacks keywords One of the Debian patches patches our `ranger.desktop` to include `Keywords`. I figure if we apply this, downstream need not bother and many people can benefit. --- doc/ranger.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/ranger.desktop b/doc/ranger.desktop index 9c140185..13a68c84 100644 --- a/doc/ranger.desktop +++ b/doc/ranger.desktop @@ -7,3 +7,4 @@ Terminal=true Exec=ranger Categories=ConsoleOnly;System;FileTools;FileManager MimeType=inode/directory; +Keywords=File;Manager;Browser;Explorer;Vi;Vim;Python -- cgit 1.4.1-2-gfad0 From d2623bb9d879c690be97ee975ad1f6bb7b25ddf2 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 5 Aug 2019 23:29:39 +0200 Subject: Add Launcher to keywords because of rifle --- doc/ranger.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ranger.desktop b/doc/ranger.desktop index 13a68c84..55d68ed8 100644 --- a/doc/ranger.desktop +++ b/doc/ranger.desktop @@ -7,4 +7,4 @@ Terminal=true Exec=ranger Categories=ConsoleOnly;System;FileTools;FileManager MimeType=inode/directory; -Keywords=File;Manager;Browser;Explorer;Vi;Vim;Python +Keywords=File;Manager;Browser;Explorer;Launcher;Vi;Vim;Python -- cgit 1.4.1-2-gfad0 From 83b464312d02beb49743fa45ccd5380ebcdd02f9 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 21:45:11 +0200 Subject: gui.widgets.statusbar: Truncate the VCS commit message Fixes #1704. --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 71064ed4..c735b8f8 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -212,7 +212,7 @@ class StatusBar(Widget): # pylint: disable=too-many-instance-attributes left.add_space() left.add(directory.vcs.rootvcs.head['date'].strftime(self.timeformat), 'vcsdate') left.add_space() - left.add(directory.vcs.rootvcs.head['summary'], 'vcscommit') + left.add(directory.vcs.rootvcs.head['summary'][:70], 'vcscommit') def _get_owner(self, target): uid = target.stat.st_uid -- cgit 1.4.1-2-gfad0 From 24a5736e3928ffe034bd733b97ba0d99990603b7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 21:56:21 +0200 Subject: Change the commit msg truncation point 50 characters seems to be the recommended length of the Git commit messages. --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index c735b8f8..19113012 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -212,7 +212,7 @@ class StatusBar(Widget): # pylint: disable=too-many-instance-attributes left.add_space() left.add(directory.vcs.rootvcs.head['date'].strftime(self.timeformat), 'vcsdate') left.add_space() - left.add(directory.vcs.rootvcs.head['summary'][:70], 'vcscommit') + left.add(directory.vcs.rootvcs.head['summary'][:50], 'vcscommit') def _get_owner(self, target): uid = target.stat.st_uid -- cgit 1.4.1-2-gfad0 From cb1fa307e7ea8c55d210f23097143fa1f9f6160c Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 22:16:48 +0200 Subject: Add a configurable VCS max message length Previously it was hardcoded as 50, let's make it easy to change for the user. Improves upon #1705. Related to #1704. --- doc/ranger.1 | 5 ++++- doc/ranger.pod | 4 ++++ examples/rc_emacs.conf | 3 +++ ranger/config/rc.conf | 3 +++ ranger/container/settings.py | 1 + ranger/gui/widgets/statusbar.py | 6 +++++- 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index ee4c84e7..7bbea1cd 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-09-24" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-10-01" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1124,6 +1124,9 @@ Sets the state for the version control backend. The possible values are: \& local display only local state. \& enabled display both, local and remote state. May be slow for hg and bzr. .Ve +.IP "vcs_msg_length [int]" 4 +.IX Item "vcs_msg_length [int]" +Truncate the long commit messages to this length when shown in the statusbar. .IP "viewmode [string]" 4 .IX Item "viewmode [string]" Sets the view mode, which can be \fBmiller\fR to display the files in the diff --git a/doc/ranger.pod b/doc/ranger.pod index beb2fdb8..c01f611d 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1170,6 +1170,10 @@ Sets the state for the version control backend. The possible values are: local display only local state. enabled display both, local and remote state. May be slow for hg and bzr. +=item vcs_msg_length [int] + +Truncate the long commit messages to this length when shown in the statusbar. + =item viewmode [string] Sets the view mode, which can be B to display the files in the diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf index e3596ba5..a69d68fe 100644 --- a/examples/rc_emacs.conf +++ b/examples/rc_emacs.conf @@ -59,6 +59,9 @@ set vcs_backend_git enabled set vcs_backend_hg disabled set vcs_backend_bzr disabled +# Truncate the long commit messages to this length when shown in the statusbar. +set vcs_msg_length 50 + # Use one of the supported image preview protocols set preview_images false diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 00a20def..b0bddd55 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -67,6 +67,9 @@ set vcs_backend_hg disabled set vcs_backend_bzr disabled set vcs_backend_svn disabled +# Truncate the long commit messages to this length when shown in the statusbar. +set vcs_msg_length 50 + # Use one of the supported image preview protocols set preview_images false diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 82901ac0..6fc2da5e 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -94,6 +94,7 @@ ALLOWED_SETTINGS = { 'vcs_backend_git': str, 'vcs_backend_hg': str, 'vcs_backend_svn': str, + 'vcs_msg_length': int, 'viewmode': str, 'w3m_delay': float, 'w3m_offset': int, diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 19113012..fd44613e 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -212,7 +212,11 @@ class StatusBar(Widget): # pylint: disable=too-many-instance-attributes left.add_space() left.add(directory.vcs.rootvcs.head['date'].strftime(self.timeformat), 'vcsdate') left.add_space() - left.add(directory.vcs.rootvcs.head['summary'][:50], 'vcscommit') + summary_length = self.settings.vcs_msg_length or 50 + left.add( + directory.vcs.rootvcs.head['summary'][:summary_length], + 'vcscommit' + ) def _get_owner(self, target): uid = target.stat.st_uid -- cgit 1.4.1-2-gfad0 From de28ac5d22fc2530363703b93072ca25aa19cc10 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 1 Oct 2019 22:48:50 +0200 Subject: Offer trash-put as an option in rifle Closes #1699. --- ranger/config/rifle.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index a90646e2..ef5ecbf0 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -264,5 +264,9 @@ label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@" label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" -# The very last action, so that it's never triggered accidentally, is to execute a program: +# One of the last actions, so that it's never triggered accidentally, is to execute a program: mime application/x-executable = "$1" + +# Move the file to trash, available for all filetypes provided +# trash-cli is available. +has trash-put = trash-put -- "$@" -- cgit 1.4.1-2-gfad0 From da78747a9ccb7626ff48a3461f2e4a26212f61ee Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 2 Oct 2019 00:32:18 +0200 Subject: Reword the vcs_msg_length docs --- doc/ranger.1 | 3 ++- doc/ranger.pod | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 7bbea1cd..e67354af 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1126,7 +1126,8 @@ Sets the state for the version control backend. The possible values are: .Ve .IP "vcs_msg_length [int]" 4 .IX Item "vcs_msg_length [int]" -Truncate the long commit messages to this length when shown in the statusbar. +Length to truncate first line of the commit messages to when shown in +the statusbar. Defaults to 50. .IP "viewmode [string]" 4 .IX Item "viewmode [string]" Sets the view mode, which can be \fBmiller\fR to display the files in the diff --git a/doc/ranger.pod b/doc/ranger.pod index c01f611d..999a1f57 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1172,7 +1172,8 @@ Sets the state for the version control backend. The possible values are: =item vcs_msg_length [int] -Truncate the long commit messages to this length when shown in the statusbar. +Length to truncate first line of the commit messages to when shown in +the statusbar. Defaults to 50. =item viewmode [string] -- cgit 1.4.1-2-gfad0 From 0364edc90e750a6ad6317bd12276d7d04e3f5b86 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 2 Oct 2019 00:40:17 +0200 Subject: Reword the rifle.conf comments --- ranger/config/rifle.conf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index ef5ecbf0..ed99a387 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -264,9 +264,14 @@ label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@" label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" -# One of the last actions, so that it's never triggered accidentally, is to execute a program: + +###################################################################### +# The actions below are left so low down in this file on purpose, so # +# they are never triggered accidentally. # +###################################################################### + +# Execute a file as program/script. mime application/x-executable = "$1" -# Move the file to trash, available for all filetypes provided -# trash-cli is available. +# Move the file to trash using trash-cli. has trash-put = trash-put -- "$@" -- cgit 1.4.1-2-gfad0 From ff2a00f2abc2c3205d5fc9fd71f3244e084020d5 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 01:28:35 +0200 Subject: Add "trash" label to rifle rules for convenience Also add a generic rule that should serve a similar function to `trash-cli`, i.e., move the files somewhere so they're marked for deletion without actually deleting them. Should be fairly simple to delete the trash by `rm -r`ing the trash directory. --- ranger/config/rifle.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index ed99a387..c26b66b5 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -274,4 +274,5 @@ label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" mime application/x-executable = "$1" # Move the file to trash using trash-cli. -has trash-put = trash-put -- "$@" +label trash, has trash-put = trash-put -- "$@" +label trash = mkdir -p -- ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash}; mv -- "$@" ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash} -- cgit 1.4.1-2-gfad0 From a724877770e5e82401692c5bb1c77a7772fa9353 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 01:32:06 +0200 Subject: Add :trash command relying on rifle's trash label --- ranger/config/commands.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 55dd9cd1..404a1edb 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -699,6 +699,64 @@ class delete(Command): self.fm.delete(files) +class trash(Command): + """:trash + + Tries to move the selection or the files passed in arguments (if any) to + the trash, using rifle rules with label "trash". + The arguments use a shell-like escaping. + + "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) + + When attempting to trash non-empty directories or multiple + marked files, it will require a confirmation. + """ + + allow_abbrev = False + escape_macros_for_shell = True + + def execute(self): + import shlex + from functools import partial + + def is_directory_with_files(path): + return os.path.isdir(path) and not os.path.islink(path) and len(os.listdir(path)) > 0 + + if self.rest(1): + files = shlex.split(self.rest(1)) + many_files = (len(files) > 1 or is_directory_with_files(files[0])) + else: + cwd = self.fm.thisdir + tfile = self.fm.thisfile + if not cwd or not tfile: + self.fm.notify("Error: no file selected for deletion!", bad=True) + return + + # relative_path used for a user-friendly output in the confirmation. + files = [f.relative_path for f in self.fm.thistab.get_selection()] + many_files = (cwd.marked_items or is_directory_with_files(tfile.path)) + + confirm = self.fm.settings.confirm_on_delete + if confirm != 'never' and (confirm != 'multiple' or many_files): + self.fm.ui.console.ask( + "Confirm deletion of: %s (y/N)" % ', '.join(files), + partial(self._question_callback, files), + ('n', 'N', 'y', 'Y'), + ) + else: + # no need for a confirmation, just delete + self.fm.execute_file(files, label='trash') + + def tab(self, tabnum): + return self._tab_directory_content() + + def _question_callback(self, files, answer): + if answer == 'y' or answer == 'Y': + self.fm.execute_file(files, label='trash') + + class jump_non(Command): """:jump_non [-FLAGS...] -- cgit 1.4.1-2-gfad0 From dbf52a12846d18b084b7978d4e0f5cb78cbdc9e3 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 01:34:03 +0200 Subject: Add bindings for :trash command --- ranger/config/rc.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 00a20def..7167b488 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -401,6 +401,7 @@ map copy map cut map console mkdir%space map console delete +map console trash map exit # In case you work on a keyboard with dvorak layout @@ -488,6 +489,7 @@ map p` paste dest=%any_path map p' paste dest=%any_path map dD console delete +map dT console trash map dd cut map ud uncut -- cgit 1.4.1-2-gfad0 From e4aba195da97997cb89c6b2e9acdcf47284304a9 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 17:17:49 +0200 Subject: Remove MC-like F9 binding for :trash Provide a commented out alternative for the `` `:delete` key binding. --- ranger/config/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 7167b488..61ce77aa 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -401,7 +401,7 @@ map copy map cut map console mkdir%space map console delete -map console trash +#map console trash map exit # In case you work on a keyboard with dvorak layout -- cgit 1.4.1-2-gfad0 From 8bea5c562155f5b6a692f0970ca658b4078280ee Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 17:20:49 +0200 Subject: Simplify alternative trash rifle rule --- ranger/config/rifle.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index c26b66b5..f04d1031 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -275,4 +275,4 @@ mime application/x-executable = "$1" # Move the file to trash using trash-cli. label trash, has trash-put = trash-put -- "$@" -label trash = mkdir -p -- ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash}; mv -- "$@" ${"$XDG_DATA_DIR"/ranger-trash:-~/.ranger/trash} +label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash -- cgit 1.4.1-2-gfad0 From 13311da4b1d238ac8e330bcc7a8edc6506ad0244 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 18:25:47 +0200 Subject: Document :trash command --- doc/ranger.1 | 8 +++++++- doc/ranger.pod | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index e67354af..bf390a95 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-10-01" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-10-02" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1212,6 +1212,7 @@ ranger. For your convenience, this is a list of the \*(L"public\*(R" commands i \& terminal \& tmap key command \& touch filename +\& trash \& travel pattern \& tunmap keys... \& unmap keys... @@ -1567,6 +1568,11 @@ Spawns the \fIx\-terminal-emulator\fR starting in the current directory. .IP "touch \fIfilename\fR" 2 .IX Item "touch filename" Creates an empty file with the name \fIfilename\fR, unless it already exists. +.IP "trash" 2 +.IX Item "trash" +Move all files in the selection to the trash using rifle. ranger will ask for +a confirmation if you attempt to trash multiple (marked) files or non-empty +directories. This can be changed by modifying the setting \*(L"confirm_on_delete\*(R". .IP "travel \fIpattern\fR" 2 .IX Item "travel pattern" Filters the current directory for files containing the letters in the diff --git a/doc/ranger.pod b/doc/ranger.pod index 999a1f57..4bd99781 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1266,6 +1266,7 @@ ranger. For your convenience, this is a list of the "public" commands including terminal tmap key command touch filename + trash travel pattern tunmap keys... unmap keys... @@ -1656,6 +1657,12 @@ Spawns the I starting in the current directory. Creates an empty file with the name I, unless it already exists. +=item trash + +Move all files in the selection to the trash using rifle. ranger will ask for +a confirmation if you attempt to trash multiple (marked) files or non-empty +directories. This can be changed by modifying the setting "confirm_on_delete". + =item travel I Filters the current directory for files containing the letters in the -- cgit 1.4.1-2-gfad0 From 1120aa45bfaad7cbfd18669f71446b9d14c448be Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 19:44:10 +0200 Subject: Expand :trash docs --- doc/ranger.1 | 11 ++++++++--- doc/ranger.pod | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index bf390a95..3521d762 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1570,9 +1570,14 @@ Spawns the \fIx\-terminal-emulator\fR starting in the current directory. Creates an empty file with the name \fIfilename\fR, unless it already exists. .IP "trash" 2 .IX Item "trash" -Move all files in the selection to the trash using rifle. ranger will ask for -a confirmation if you attempt to trash multiple (marked) files or non-empty -directories. This can be changed by modifying the setting \*(L"confirm_on_delete\*(R". +Move all files in the selection to the trash using rifle. Rifle tries to use a +trash manager like \fItrash-cli\fR if available but will fall back to moving files +to either \fI\f(CI$XDG_DATA_HOME\fI/ranger\-trash\fR or \fI~/.ranger/ranger\-trash\fR. This is +a less permanent version of \fIdelete\fR, relying on the user to clear out the +trash whenever it's convenient. While having the possibility of restoring +trashed files until this happens. ranger will ask for a confirmation if you +attempt to trash multiple (marked) files or non-empty directories. This can be +changed by modifying the setting \*(L"confirm_on_delete\*(R". .IP "travel \fIpattern\fR" 2 .IX Item "travel pattern" Filters the current directory for files containing the letters in the diff --git a/doc/ranger.pod b/doc/ranger.pod index 4bd99781..be964b37 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1659,9 +1659,14 @@ Creates an empty file with the name I, unless it already exists. =item trash -Move all files in the selection to the trash using rifle. ranger will ask for -a confirmation if you attempt to trash multiple (marked) files or non-empty -directories. This can be changed by modifying the setting "confirm_on_delete". +Move all files in the selection to the trash using rifle. Rifle tries to use a +trash manager like I if available but will fall back to moving files +to either F<$XDG_DATA_HOME/ranger-trash> or F<~/.ranger/ranger-trash>. This is +a less permanent version of I, relying on the user to clear out the +trash whenever it's convenient. While having the possibility of restoring +trashed files until this happens. ranger will ask for a confirmation if you +attempt to trash multiple (marked) files or non-empty directories. This can be +changed by modifying the setting "confirm_on_delete". =item travel I -- cgit 1.4.1-2-gfad0 From d674b457082ac878e525e63549ad0d7500bcb0b3 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 00:10:33 +0200 Subject: Fix cunmap `cunmap` was broken and nobody noticed. It unmapped bindings in the `browser` context, so it was basically an alias for `unmap`. --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 404a1edb..e14f0818 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1326,7 +1326,7 @@ class cunmap(unmap): Remove the given "console" mappings """ - context = 'browser' + context = 'console' class punmap(unmap): -- cgit 1.4.1-2-gfad0 From adacb5d0add8605e045ec8968629648196eeb457 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 00:26:37 +0200 Subject: Deprecate c/p/tunmap in favor of unc/p/tmap `cunmap` definitely won't be missed because it was buggy. I'd expect the other two to be even less missed. I considered writing a decorator for deprecation because the code is repetitive but imo it should be removed in the *next* version after 1.9.3 so it shouldn't matter much. Fixes #1698 --- ranger/config/commands.py | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index e14f0818..c034c457 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1321,29 +1321,63 @@ class unmap(Command): self.fm.ui.keymaps.unbind(self.context, arg) -class cunmap(unmap): - """:cunmap [, ...] +class uncmap(unmap): + """:uncmap [, ...] Remove the given "console" mappings """ context = 'console' +class cunmap(uncmap): + """:cunmap [, ...] -class punmap(unmap): - """:punmap [, ...] + Remove the given "console" mappings + + DEPRECATED in favor of uncmap. + """ + + def execute(self): + self.fm.notify("cunmap is deprecated in favor of uncmap!") + super(cunmap, self).execute() + +class unpmap(unmap): + """:unpmap [, ...] Remove the given "pager" mappings """ context = 'pager' +class punmap(unpmap): + """:punmap [, ...] + + Remove the given "pager" mappings -class tunmap(unmap): - """:tunmap [, ...] + DEPRECATED in favor of unpmap. + """ + + def execute(self): + self.fm.notify("punmap is deprecated in favor of unpmap!") + super(punmap, self).execute() + +class untmap(unmap): + """:untmap [, ...] Remove the given "taskview" mappings """ context = 'taskview' +class tunmap(untmap): + """:tunmap [, ...] + + Remove the given "taskview" mappings + + DEPRECATED in favor of uncmap. + """ + + def execute(self): + self.fm.notify("tunmap is deprecated in favor of untmap!") + super(tunmap, self).execute() + class map_(Command): """:map -- cgit 1.4.1-2-gfad0 From e22bf57e513c3402fbe2832b3ba4aa7d16d312e1 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 20:29:06 +0200 Subject: Fix typo in deprecation warning for tunmap --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index c034c457..45af9d95 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1371,7 +1371,7 @@ class tunmap(untmap): Remove the given "taskview" mappings - DEPRECATED in favor of uncmap. + DEPRECATED in favor of untmap. """ def execute(self): -- cgit 1.4.1-2-gfad0 From 6f184c53c88629d2f9f437ff9f604db58dbed07a Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 21:05:32 +0200 Subject: Remove trailing whitespace in cunmap docstring --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 45af9d95..84951c91 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1332,7 +1332,7 @@ class cunmap(uncmap): """:cunmap [, ...] Remove the given "console" mappings - + DEPRECATED in favor of uncmap. """ -- cgit 1.4.1-2-gfad0 From 807974ce63ba2db7c2e9705c59b54398420130fc Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 2 Oct 2019 21:09:44 +0200 Subject: Fix interclass whitespace --- ranger/config/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 84951c91..b146cec9 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1328,6 +1328,7 @@ class uncmap(unmap): """ context = 'console' + class cunmap(uncmap): """:cunmap [, ...] @@ -1340,6 +1341,7 @@ class cunmap(uncmap): self.fm.notify("cunmap is deprecated in favor of uncmap!") super(cunmap, self).execute() + class unpmap(unmap): """:unpmap [, ...] @@ -1347,6 +1349,7 @@ class unpmap(unmap): """ context = 'pager' + class punmap(unpmap): """:punmap [, ...] @@ -1359,6 +1362,7 @@ class punmap(unpmap): self.fm.notify("punmap is deprecated in favor of unpmap!") super(punmap, self).execute() + class untmap(unmap): """:untmap [, ...] @@ -1366,6 +1370,7 @@ class untmap(unmap): """ context = 'taskview' + class tunmap(untmap): """:tunmap [, ...] -- cgit 1.4.1-2-gfad0