https://github.com/patrickf1/colored_man_pages.fish
Fish shell plugin to colorize man pages
https://github.com/patrickf1/colored_man_pages.fish
fish fish-packages fish-plugin fish-shell fisher man-pages oh-my-fish
Last synced: 8 months ago
JSON representation
Fish shell plugin to colorize man pages
- Host: GitHub
- URL: https://github.com/patrickf1/colored_man_pages.fish
- Owner: PatrickF1
- License: mit
- Created: 2018-08-13T01:39:58.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-04-29T23:24:10.000Z (about 3 years ago)
- Last Synced: 2024-08-07T18:44:25.517Z (11 months ago)
- Topics: fish, fish-packages, fish-plugin, fish-shell, fisher, man-pages, oh-my-fish
- Language: Shell
- Homepage:
- Size: 379 KB
- Stars: 92
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#### colored_man_pages.fish
> A plugin for the [fish-shell](https://fishshell.com).
[](/LICENSE)
[](https://fishshell.com)
[](https://www.github.com/oh-my-fish/oh-my-fish)
This plugin installs a fish function wrapper around `man` that colorizes styled text (specifically underlined, bold, and standout) to make browsing man pages easier and more enjoyable.
The colors are added by setting environment variables that control how `less`, `man`'s default pager, processes styled text. Why can't we just set those environment variables in our shell configuration instead of using this plugin? Well, if we simply set environment variables, they contain escape sequences that will "overflow" into the output of other commands reading environment variables. See this [Stackoverflow question](https://unix.stackexchange.com/questions/87261/getting-unexpected-colorized-output-on-several-commands) for an explanation.
Credits: This idea was first inspired by [Arch Linux wiki](https://wiki.archlinux.org/index.php/Color_output_in_console#Using_less).
Note: [decors/fish-colored-man](https://github.com/decors/fish-colored-man) is a very similar plugin. Differences:
- `colored_man_pages.fish` includes a wrapper to also colorize the output of utilities that rely on less, such as `git help`
- `fish-colored-man` allows configuring colors## Install
With [fisher]
```fish
$ fisher install patrickf1/colored_man_pages.fish
```## Usage
Just invoke `man` as usual, but without changing the pager, to get colored output. For example
```fish
$ man less
```To execute vanilla `man` without colored output, we can bypass the wrapper using `command`. For example
```fish
$ command man less
```To colorize the output of utilities that rely on less, use the `cless` (short for colored less) wrapper to configure less before executing the utility.
For example```fish
$ cless git help merge
$ cless git help log
```# License
[MIT][mit] © [Patrick](https://github.com/patrickf1)
[mit]: https://opensource.org/licenses/MIT
[omf-link]: https://www.github.com/oh-my-fish/oh-my-fish
[fisher]: https://github.com/jorgebucaran/fisher
[license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square