From 84417076a58ec3be7ad08ca959b5bacab8955e72 Mon Sep 17 00:00:00 2001 From: Delisa Mason Date: Sun, 8 Mar 2015 16:13:43 -0700 Subject: Update documentation --- doc/ranger.1 | 21 +++++++++++++++++---- doc/ranger.pod | 19 +++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/ranger.1 b/doc/ranger.1 index 42b32f70..34b1d0d7 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -263,12 +263,25 @@ Install these programs (just the ones you need) and scope.sh will automatically use them. .PP Independently of the preview script, there is a feature to preview images -by drawing them directly into the terminal. 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. +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\*(C'\fR to true. +\&\f(CW\*(C`use_w3m_image_preview\*(C'\fR to true. +.PP +\fIiTerm2\fR +.IX Subsection "iTerm2" +.PP +This only works in iTerm2 compiled with image preview support, but works over +ssh. +.PP +To enable this feature, set the option \f(CW\*(C`use_iterm2_image_preview\*(C'\fR to true. .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 75da97b9..7575e5b6 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -163,12 +163,23 @@ Install these programs (just the ones you need) and scope.sh will automatically use them. Independently of the preview script, there is a feature to preview images -by drawing them directly into the terminal. This does not work over ssh, -requires certain terminals (tested on "xterm" and "urxvt") and is incompatible -with tmux, although it works with screen. +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 true. +C to true. + +=head3 iTerm2 + +This only works in iTerm2 compiled with image preview support, but works over +ssh. + +To enable this feature, set the option C to true. =head2 SELECTION -- cgit 1.4.1-2-gfad0 From 7e85001052e4398f71e50e731899800106d2eefd Mon Sep 17 00:00:00 2001 From: Delisa Mason Date: Mon, 9 Mar 2015 14:41:58 -0700 Subject: Consolidate image preview method preferences * Remove use_w3m_image_preview and use_iterm2_image_preview in favor of preview_images_method, easing the development of other image preview methods as needed --- doc/ranger.1 | 4 ++-- doc/ranger.pod | 4 ++-- ranger/config/rc.conf | 21 ++++++++++++--------- ranger/container/settings.py | 3 +-- ranger/core/fm.py | 4 ++-- 5 files changed, 19 insertions(+), 17 deletions(-) (limited to 'doc') diff --git a/doc/ranger.1 b/doc/ranger.1 index 34b1d0d7..3ba4fe4e 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -273,7 +273,7 @@ This does not work over ssh, requires certain terminals (tested on \*(L"xterm\*( \&\*(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`use_w3m_image_preview\*(C'\fR to true. +\&\f(CW\*(C`preview_images_method\*(C'\fR to w3m. .PP \fIiTerm2\fR .IX Subsection "iTerm2" @@ -281,7 +281,7 @@ To enable this feature, install the program \*(L"w3m\*(R" and set the option This only works in iTerm2 compiled with image preview support, but works over ssh. .PP -To enable this feature, set the option \f(CW\*(C`use_iterm2_image_preview\*(C'\fR to true. +To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to iterm2. .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 7575e5b6..97a324a8 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -172,14 +172,14 @@ 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 true. +C to w3m. =head3 iTerm2 This only works in iTerm2 compiled with image preview support, but works over ssh. -To enable this feature, set the option C to true. +To enable this feature, set the option C to iterm2. =head2 SELECTION diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index e569d602..e55ab2be 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -61,15 +61,18 @@ set vcs_backend_bzr disabled # Use one of the supported image preview protocols set preview_images false -# Preview images in full color with the external command "w3mimgpreview"? -# This requires the console web browser "w3m" and a supported terminal. -# It has been successfully tested with "xterm" and "urxvt" without tmux. -set use_w3m_image_preview false - -# Preview images in full color using iTerm2 image previews -# (http://iterm2.com/images.html). This requires using iTerm2 compiled -# with image preview support. -set use_iterm2_image_preview false +# Set the preview image method. Supported methods: +# +# * w3m (default): +# Preview images in full color with the external command "w3mimgpreview"? +# This requires the console web browser "w3m" and a supported terminal. +# It has been successfully tested with "xterm" and "urxvt" without tmux. +# +# * iterm2: +# Preview images in full color using iTerm2 image previews +# (http://iterm2.com/images.html). This requires using iTerm2 compiled +# with image preview support. +set preview_images_method w3m # Use a unicode "..." character to mark cut-off filenames? set unicode_ellipsis false diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 6adc62ea..27737eb1 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -35,6 +35,7 @@ ALLOWED_SETTINGS = { 'preview_directories': bool, 'preview_files': bool, 'preview_images': bool, + 'preview_images_method': str, 'preview_max_size': int, 'preview_script': (str, type(None)), 'save_console_history': bool, @@ -55,8 +56,6 @@ ALLOWED_SETTINGS = { 'update_title': bool, 'update_tmux_title': bool, 'use_preview_script': bool, - 'use_iterm2_image_preview': bool, - 'use_w3m_image_preview' : bool, 'vcs_aware': bool, 'vcs_backend_bzr': str, 'vcs_backend_git': str, diff --git a/ranger/core/fm.py b/ranger/core/fm.py index 2d5d3c1e..b32a2c33 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -185,9 +185,9 @@ class FM(Actions, SignalDispatcher): raise def _get_image_displayer(self): - if self.settings.use_w3m_image_preview: + if self.settings.preview_images_method == "w3m": return W3MImageDisplayer() - elif self.settings.use_iterm2_image_preview: + elif self.settings.preview_images_method == "iterm2": return ITerm2ImageDisplayer() else: return ImageDisplayer() -- cgit 1.4.1-2-gfad0