From fba85b7335a0d1dd32bd94c929fb3e7dde949d1c Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 17 May 2019 23:52:20 +0200 Subject: Add missing documentation for syntax highlighting `HIGHLIGHT_STYLE`, `HIGHLIGHT_OPTIONS` and `PYGMENTIZE_STYLE` affect ranger and should therefore be documented in the manual. --- doc/ranger.1 | 54 +++++++++++++++++++++++++++++++++++++++++++----------- doc/ranger.pod | 30 ++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 11 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 43a13659..69109cf2 100644 --- a/doc/ranger.1 +++ b/doc/ranger.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 "RANGER 1" -.TH RANGER 1 "ranger-1.9.2" "2019-04-23" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-05-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 @@ -169,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" @@ -1630,6 +1634,34 @@ the \*(L"S\*(R" key. Defaults to \*(L"/bin/sh\*(R". .IX Item "TERMCMD" Defines the terminal emulator command that ranger is going to use with the :terminal command and the \*(L"t\*(R" run flag. Defaults to \*(L"xterm\*(R". +.IP "\s-1PYGMENTIZE_STYLE\s0" 8 +.IX Item "PYGMENTIZE_STYLE" +Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is +installed unless \fIhighlight\fR is also installed, possible values (find out by +running \f(CW\*(C`pygments.styles.get_all_styles()\*(C'\fR): abap, algol, algol_nu, arduino, +autumn, borland, bw, colorful, emacs, friendly, fruity, igor, lovelace, manni, +monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, +rainbow_dash, rrt, tango, trac, vim, vs and xcode. +.IP "\s-1HIGHLIGHT_STYLE\s0" 8 +.IX Item "HIGHLIGHT_STYLE" +Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is +installed, possible values (find out by running \f(CW\*(C`highlight \-\-list\-themes\*(C'\fR): +acid, aiseered, andes, anotherdark, autumn, baycomb, bclear, biogoo, bipolar, +blacknblue, bluegreen, breeze, bright, camo, candy, clarity, dante, darkblue, +darkbone, darkness, darkslategray, darkspectrum, denim, dusk, earendel, easter, +edit-anjuta, edit-bbedit, edit-eclipse, edit-emacs, edit-fasm, +edit-flashdevelop, edit-gedit, edit-godot, edit-jedit, edit-kwrite, +edit-matlab, edit\-msvs2008, edit-nedit, edit-purebasic, edit-vim, +edit-vim-dark, edit-xcode, ekvoli, fine_blue, freya, fruit, github, golden, +greenlcd, kellys, leo, lucretia, manxome, maroloccio, matrix, moe, molokai, +moria, navajo-night, navy, neon, night, nightshimmer, nuvola, olive, orion, +oxygenated, pablo, peaksea, print, rand01, rdark, relaxedgreen, rootwater, +seashell, solarized-dark, solarized-light, sourceforge, tabula, tcsoft, the, +vampire, whitengrey, xoria256, zellner, zenburn and zmrok. +.IP "\s-1HIGHLIGHT_OPTIONS\s0" 8 +.IX Item "HIGHLIGHT_OPTIONS" +\&\fIhighlight\fR will pick up command line options specified in this variable. A +\&\f(CW\*(C`\-\-style=\*(C'\fR option specified here will override \f(CW\*(C`HIGHLIGHT_STYLE\*(C'\fR. .IP "\s-1XDG_CONFIG_HOME\s0" 8 .IX Item "XDG_CONFIG_HOME" Specifies the directory for configuration files. Defaults to \fI\f(CI$HOME\fI/.config\fR. @@ -1676,7 +1708,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 d182f3af..8cb5da43 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1781,6 +1781,36 @@ the "S" key. Defaults to "/bin/sh". Defines the terminal emulator command that ranger is going to use with the :terminal command and the "t" run flag. Defaults to "xterm". +=item PYGMENTIZE_STYLE + +Specifies the theme to be used for syntax highlighting when I is +installed unless I is also installed, possible values (find out by +running C): abap, algol, algol_nu, arduino, +autumn, borland, bw, colorful, emacs, friendly, fruity, igor, lovelace, manni, +monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, +rainbow_dash, rrt, tango, trac, vim, vs and xcode. + +=item HIGHLIGHT_STYLE + +Specifies the theme to be used for syntax highlighting when I is +installed, possible values (find out by running C): +acid, aiseered, andes, anotherdark, autumn, baycomb, bclear, biogoo, bipolar, +blacknblue, bluegreen, breeze, bright, camo, candy, clarity, dante, darkblue, +darkbone, darkness, darkslategray, darkspectrum, denim, dusk, earendel, easter, +edit-anjuta, edit-bbedit, edit-eclipse, edit-emacs, edit-fasm, +edit-flashdevelop, edit-gedit, edit-godot, edit-jedit, edit-kwrite, +edit-matlab, edit-msvs2008, edit-nedit, edit-purebasic, edit-vim, +edit-vim-dark, edit-xcode, ekvoli, fine_blue, freya, fruit, github, golden, +greenlcd, kellys, leo, lucretia, manxome, maroloccio, matrix, moe, molokai, +moria, navajo-night, navy, neon, night, nightshimmer, nuvola, olive, orion, +oxygenated, pablo, peaksea, print, rand01, rdark, relaxedgreen, rootwater, +seashell, solarized-dark, solarized-light, sourceforge, tabula, tcsoft, the, +vampire, whitengrey, xoria256, zellner, zenburn and zmrok. + +=item HIGHLIGHT_OPTIONS + +I will pick up command line options specified in this variable. A +C<--style=> option specified here will override C. =item XDG_CONFIG_HOME -- cgit 1.4.1-2-gfad0 From f67fd1bba726852b65c0fe422e7ef4cd9552b58f Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 19 May 2019 16:29:58 +0200 Subject: Remove theme lists from syntax highlighting docs We mention commands to retrieve all the theme names so the explicit lists are redundant and will probably get out of date sooner rather than later and considering we all enjoy updating the docs *so much*, I figured we should just drop those : ) --- doc/ranger.1 | 25 ++++++------------------- doc/ranger.pod | 23 +++++------------------ 2 files changed, 11 insertions(+), 37 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 69109cf2..afd8641a 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-05-17" "ranger manual" +.TH RANGER 1 "ranger-1.9.2" "2019-05-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 @@ -1637,27 +1637,14 @@ Defines the terminal emulator command that ranger is going to use with the .IP "\s-1PYGMENTIZE_STYLE\s0" 8 .IX Item "PYGMENTIZE_STYLE" Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is -installed unless \fIhighlight\fR is also installed, possible values (find out by -running \f(CW\*(C`pygments.styles.get_all_styles()\*(C'\fR): abap, algol, algol_nu, arduino, -autumn, borland, bw, colorful, emacs, friendly, fruity, igor, lovelace, manni, -monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, -rainbow_dash, rrt, tango, trac, vim, vs and xcode. +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]' .IP "\s-1HIGHLIGHT_STYLE\s0" 8 .IX Item "HIGHLIGHT_STYLE" Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is -installed, possible values (find out by running \f(CW\*(C`highlight \-\-list\-themes\*(C'\fR): -acid, aiseered, andes, anotherdark, autumn, baycomb, bclear, biogoo, bipolar, -blacknblue, bluegreen, breeze, bright, camo, candy, clarity, dante, darkblue, -darkbone, darkness, darkslategray, darkspectrum, denim, dusk, earendel, easter, -edit-anjuta, edit-bbedit, edit-eclipse, edit-emacs, edit-fasm, -edit-flashdevelop, edit-gedit, edit-godot, edit-jedit, edit-kwrite, -edit-matlab, edit\-msvs2008, edit-nedit, edit-purebasic, edit-vim, -edit-vim-dark, edit-xcode, ekvoli, fine_blue, freya, fruit, github, golden, -greenlcd, kellys, leo, lucretia, manxome, maroloccio, matrix, moe, molokai, -moria, navajo-night, navy, neon, night, nightshimmer, nuvola, olive, orion, -oxygenated, pablo, peaksea, print, rand01, rdark, relaxedgreen, rootwater, -seashell, solarized-dark, solarized-light, sourceforge, tabula, tcsoft, the, -vampire, whitengrey, xoria256, zellner, zenburn and zmrok. +installed. Find out possible values by running \f(CW\*(C`highlight \-\-list\-themes\*(C'\fR. .IP "\s-1HIGHLIGHT_OPTIONS\s0" 8 .IX Item "HIGHLIGHT_OPTIONS" \&\fIhighlight\fR will pick up command line options specified in this variable. A diff --git a/doc/ranger.pod b/doc/ranger.pod index 8cb5da43..f78e9bdd 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1784,28 +1784,15 @@ Defines the terminal emulator command that ranger is going to use with the =item PYGMENTIZE_STYLE Specifies the theme to be used for syntax highlighting when I is -installed unless I is also installed, possible values (find out by -running C): abap, algol, algol_nu, arduino, -autumn, borland, bw, colorful, emacs, friendly, fruity, igor, lovelace, manni, -monokai, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, -rainbow_dash, rrt, tango, trac, vim, vs and xcode. +installed unless I is also installed. Find out possible values by +running + python -c 'import pygments.styles; [print(stl) for stl in + pygments.styles.get_all_styles()]' =item HIGHLIGHT_STYLE Specifies the theme to be used for syntax highlighting when I is -installed, possible values (find out by running C): -acid, aiseered, andes, anotherdark, autumn, baycomb, bclear, biogoo, bipolar, -blacknblue, bluegreen, breeze, bright, camo, candy, clarity, dante, darkblue, -darkbone, darkness, darkslategray, darkspectrum, denim, dusk, earendel, easter, -edit-anjuta, edit-bbedit, edit-eclipse, edit-emacs, edit-fasm, -edit-flashdevelop, edit-gedit, edit-godot, edit-jedit, edit-kwrite, -edit-matlab, edit-msvs2008, edit-nedit, edit-purebasic, edit-vim, -edit-vim-dark, edit-xcode, ekvoli, fine_blue, freya, fruit, github, golden, -greenlcd, kellys, leo, lucretia, manxome, maroloccio, matrix, moe, molokai, -moria, navajo-night, navy, neon, night, nightshimmer, nuvola, olive, orion, -oxygenated, pablo, peaksea, print, rand01, rdark, relaxedgreen, rootwater, -seashell, solarized-dark, solarized-light, sourceforge, tabula, tcsoft, the, -vampire, whitengrey, xoria256, zellner, zenburn and zmrok. +installed. Find out possible values by running C. =item HIGHLIGHT_OPTIONS -- cgit 1.4.1-2-gfad0 From c5da4108e3ead93d0a425d6bcd5f645389229dc7 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 19 May 2019 17:02:28 +0200 Subject: Give HIGHLIGHT_TABWIDTH some love Same treatment as for `HIGHLIGHT_STYLE`. The default value can be overridden by either setting the environment variable or specifying `--replace-tabs=` in `HIGHLIGHT_OPTIONS`. --- doc/ranger.1 | 8 ++++++-- doc/ranger.pod | 9 +++++++-- ranger/data/scope.sh | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index afd8641a..b251edbe 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1638,17 +1638,21 @@ Defines the terminal emulator command that ranger is going to use with the .IX Item "PYGMENTIZE_STYLE" 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 +running: python \-c 'import pygments.styles; [print(stl) for stl in 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 installed. Find out possible values by running \f(CW\*(C`highlight \-\-list\-themes\*(C'\fR. +.IP "\s-1HIGHLIGHT_TABWIDTH\s0" 8 +.IX Item "HIGHLIGHT_TABWIDTH" +Specifies the number of spaces to use to replace tabs in \fIhighlight\fRed files. .IP "\s-1HIGHLIGHT_OPTIONS\s0" 8 .IX Item "HIGHLIGHT_OPTIONS" \&\fIhighlight\fR will pick up command line options specified in this variable. A -\&\f(CW\*(C`\-\-style=\*(C'\fR option specified here will override \f(CW\*(C`HIGHLIGHT_STYLE\*(C'\fR. +\&\f(CW\*(C`\-\-style=\*(C'\fR option specified here will override \f(CW\*(C`HIGHLIGHT_STYLE\*(C'\fR. Similarly, +\&\f(CW\*(C`\-\-replace\-tabs=\*(C'\fR will override \f(CW\*(C`HIGHLIGHT_TABWIDTH\*(C'\fR.. .IP "\s-1XDG_CONFIG_HOME\s0" 8 .IX Item "XDG_CONFIG_HOME" Specifies the directory for configuration files. Defaults to \fI\f(CI$HOME\fI/.config\fR. diff --git a/doc/ranger.pod b/doc/ranger.pod index f78e9bdd..1c87c675 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1785,7 +1785,7 @@ Defines the terminal emulator command that ranger is going to use with the Specifies the theme to be used for syntax highlighting when I is installed unless I is also installed. Find out possible values by -running +running: python -c 'import pygments.styles; [print(stl) for stl in pygments.styles.get_all_styles()]' @@ -1794,10 +1794,15 @@ running Specifies the theme to be used for syntax highlighting when I is installed. Find out possible values by running C. +=item HIGHLIGHT_TABWIDTH + +Specifies the number of spaces to use to replace tabs in Ied files. + =item HIGHLIGHT_OPTIONS I will pick up command line options specified in this variable. A -C<--style=> option specified here will override C. +C<--style=> option specified here will override C. Similarly, +C<--replace-tabs=> will override C. =item XDG_CONFIG_HOME diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index ba9edc50..e9c10916 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -35,9 +35,9 @@ FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lowe # Settings HIGHLIGHT_SIZE_MAX=262143 # 256KiB -HIGHLIGHT_TABWIDTH=8 +HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8} HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo} -HIGHLIGHT_OPTIONS="--style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}" +HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}" PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn} @@ -229,7 +229,7 @@ handle_mime() { local pygmentize_format='terminal' local highlight_format='ansi' fi - env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" \ + env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \ --out-format="${highlight_format}" \ --force -- "${FILE_PATH}" && exit 5 pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\ -- cgit 1.4.1-2-gfad0