From ed7a62bca33d60470b79d511baf63244b772e94d Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Fri, 19 Jun 2020 15:45:56 -0500 Subject: [PATCH] textview config docs (#2011) * documentation for bat config changes * renamed to textview, added fetch example Co-authored-by: Darren Schroeder --- docs/commands/textview_config.md | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/commands/textview_config.md diff --git a/docs/commands/textview_config.md b/docs/commands/textview_config.md new file mode 100644 index 000000000..9dc4ce142 --- /dev/null +++ b/docs/commands/textview_config.md @@ -0,0 +1,55 @@ +# textview config +The configuration for textview, which is used to autoview text files, uses [bat](https://docs.rs/bat/0.15.4/bat/struct.PrettyPrinter.html). The textview configurtion will **not** use any existing `bat` configuration you may have. + +### Configuration Points and Defaults +| config point | definition | implemented | +| - | - | - | +| term_width | The character width of the terminal (default: autodetect) | yes | +| tab_width | The width of tab characters (default: None - do not turn tabs to spaces) | yes | +| colored_output | Whether or not the output should be colorized (default: true) | yes | +| true_color | Whether or not to output 24bit colors (default: true) | yes | +| header | Whether to show a header with the file name | yes | +| line_numbers | Whether to show line numbers | yes | +| grid | Whether to paint a grid, separating line numbers, git changes and the code | yes | +| vcs_modification_markers | Whether to show modification markers for VCS changes. This has no effect if the git feature is not activated. | yes | +| snip | Whether to show "snip" markers between visible line ranges (default: no) | yes | +| wrapping_mode | Text wrapping mode (default: do not wrap), options (Character, NoWrapping) | yes | +| use_italics | Whether or not to use ANSI italics (default: off) | yes | +| paging_mode | If and how to use a pager (default: no paging), options (Always, QuitIfOneScreen, Never) | yes | +| pager | Specify the command to start the pager (default: use "less") | yes | +| line_ranges | Specify the lines that should be printed (default: all) | no | +| highlight | Specify a line that should be highlighted (default: none). This can be called multiple times to highlight more than one line. See also: highlight_range. | no | +| highlight_range | Specify a range of lines that should be highlighted (default: none). This can be called multiple times to highlight more than one range of lines. | no | +| theme | Specify the highlighting theme (default: OneHalfDark) | yes | + +### Example textview confguration for `config.toml` +```toml +[textview] +term_width = "default" +tab_width = 4 +colored_output = true +true_color = true +header = true +line_numbers = false +grid = false +vcs_modification_markers = true +snip = true +wrapping_mode = "NoWrapping" +use_italics = true +paging_mode = "QuitIfOneScreen" +pager = "less" +theme = "TwoDark" +``` +### Example Usage +``` +> open src/main.rs +``` +``` +> cat some_file.txt | textview +``` +``` +> fetch https://www.jonathanturner.org/feed.xml --raw +``` + +### Help +A more detailed description of the configuration points that textview uses, please visit the `bat` repo at https://github.com/sharkdp/bat \ No newline at end of file