Commit Graph

10 Commits (df87b41635b5f01eeaa4b51ca6fbc4df5b5164c3)

Author SHA1 Message Date
John D Pell 2ddb40751f plugin/less-pretty-cat: remove `|| cat`
The logic to run `cat` if `pygmentize` fails seems useless, so just remove it.
2021-09-23 15:42:23 -07:00
John D Pell 5857648377 plugins/less-pretty-cat: simplify code flow
Convert from indented if-block to return then unindented code. This should have basically one line change at the top, one line removed at the bottom, and then all whitespace.
2021-09-23 10:17:28 -07:00
John D Pell 55be49e887 plugins/less-pretty-cat: use `_command_exists`
Addresses bash-it/bash-it#1632

Alsö, code style cleanup: quote variables, handle unbound parameters,  &c.
2021-09-23 10:17:28 -07:00
markusdd c9054e25a9
implement feedback 2019-10-07 14:19:38 +02:00
markusdd c0ac3d8393
Update less-pretty-cat plugin to support pygment style selection
Pygments offers great styles and in dark terminals the default is unsatisfactory.

Use two new env variables BASH_IT_CLESS_STYLE and BASH_IT_CCAT_STYLE to select pygment themes.
Availables styles can be listes using pygmentize -L styles
2019-10-05 15:50:59 +02:00
markusdd f14d4fcc3c
turn coloured cat and less into ccat and cless
old approach would override systems cat, which is malicious when used in conjunction with shell piping or redirection
2019-02-22 14:41:01 +01:00
Stéphane Adjemian (Charybdis) 35902d00d9 Fixed pygmentize in less.
Was not working correctly with file extensions unknown to
pygmenties. Added the -g option to pygmentize command.
2015-10-31 00:53:41 +01:00
Nils Winkler d12d78ddaf Fixed error handling in less-pretty-cat plugin
When pygmentize is not installed, the functions less/cat are not
defined, the native commands will be used instead. Also removed the
error message that was shown when the command was not found.

Using `command -v` instead of `which` to check for the existence of the
executable - this works better as it does not print an error message if
the executable is not found.
2015-07-28 15:50:21 +02:00
Miguel Morales e143d4f696 Allow for passing arguments to pygmentize 2015-06-09 07:46:32 -05:00
Miguel Morales 6821b6c0dc Add less and remove hard exit 2015-05-24 18:04:42 -05:00