Git Product home page Git Product logo

colored_man_pages.fish's Introduction

colored_man_pages.fish

A plugin for the fish-shell.

MIT License Fish Shell Version Oh My Fish Framework


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 for an explanation.

colored man page for less

Credits: This idea was first inspired by Arch Linux wiki.

Note: 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

$ fisher install patrickf1/colored_man_pages.fish

Usage

Just invoke man as usual, but without changing the pager, to get colored output. For example

$ man less

To execute vanilla man without colored output, we can bypass the wrapper using command. For example

$ 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

$ cless git help merge
$ cless git help log

License

MIT © Patrick

colored_man_pages.fish's People

Contributors

patrickf1 avatar kidonng avatar bronzehedwick avatar ilancosman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.