• Stars
    star
    1,190
  • Rank 39,309 (Top 0.8 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bash scripts that integrate bat with various command line tools.

bat-extras

Bash scripts that integrate bat with various command line tools.

 

Scripts

batgrep

Quickly search through and highlight files using ripgrep. Requirements: ripgrep

batman

Read system manual pages (man) using bat as the manual page formatter.

batpipe

A less (and soon bat) preprocessor for viewing more types of files in the terminal.

batwatch

Watch for changes in one or more files, and print them with bat. Requirements: entr (optional)

batdiff

Diff a file against the current git index, or display the diff between two files. Requirements: bat, delta (optional)

prettybat

Pretty-print source code and highlight it with bat. Requirements: (see doc/prettybat.md)

 

Installation via Package Manager

Homebrew

All of the bat-extras scripts can be installed with brew install bat-extras.

If you would prefer to only install the specific scripts you need, you can use the eth-p/software tap to install individual scripts: brew install eth-p/software/bat-extras-[SCRIPT]

Pacman

bat-extras is officially available on the Arch community repository!

If you have the community repository enabled, you can install bat-extras by running:

pacman -S bat-extras

Gentoo

bat-extras is available on Gentoo's Guru Overlay as sys-apps/bat-extras.

To install, first make sure you've added the Gentoo Guru Overlay to your local repositories, then emerge accordingly...

emerge sys-apps/bat-extras

Fedora (Unofficial)

bat-extras is available in an unofficial Fedora Copr repository. Note: this package does not contain prettybat since prettier is not yet packaged for Fedora.

Install the Copr plugin, enable the repository, and then install the package by running:

dnf install dnf-plugins-core 
dnf copr enable awood/bat-extras
dnf install bat-extras

 

Installation

Test

The scripts in this repository are designed to run as-is, provided that they aren't moved around. This means that you're free to just symlink src/[script].sh to your local bin folder.

If you would rather have faster, self-contained scripts that you can place and run anywhere, you can use the build.sh script to create (and optionally install) them.

 

Building:

./build.sh [OPTIONS...]

This will combine and preprocess each script under the src directory, and create corresponding self-contained scripts in the bin folder. Any library scripts that are sourced using source "${LIB}/[NAME].sh" will be embedded automatically.

 

Minification:

There are three different options for minification:

Option Description
--minify=none Nothing will be minified.
--minify=lib Embedded library scripts will be minified. [default]
--minify=all Everything will be minified.

This uses shfmt to perform minification.

 

Installation:

You can also specify --install and --prefix=PATH to have the build script automatically install the scripts for all users on the system. You may need to run the build script as root.

If you only want to install a single script, you can run the build process and copy the script directly out of the newly-created bin folder.

Manuals:

The build script will automatically generate a man page for each of the markdown documentation files. This is a beta feature that uses a non-compliant Markdown "parser" written in Bash, and there is no guarantee towards the quality of the generated manual pages. If you do not want to generate manual files, you can provide the --no-manuals option to disable manual file generation.

Alternate Executable:

Depending on the distribution, bat may have been renamed to avoid package conflicts. If you wish to use these scripts on a distribution where this is the case, there is an --alternate-executable=NAME option which will build the scripts to use an alternate executable name.

You may also specify alternate executables for ripgrep, delta, fzf, or git with --alternate-executable:PROGRAM NAME where PROGRAM is one the aforementioned programs. Note that doing so may cause verification to fail.

Verification:

The build script will attempt to verify the correctness of the "bin" scripts by comparing their output with their source counterparts. It is recommended to let it do this, but you can disable verification with the --no-verify option.

 

Contributing

If you would like to contribute to bat-extras, please feel free to open an issue on GitHub, or make a pull request. If you do the latter, please keep our contributing guidelines in mind.

More Repositories

1

obsidian-callout-manager

An Obsidian.md plugin that makes creating and configuring callouts easy.
TypeScript
128
star
2

best

A Bash unit and snapshot testing framework.
Shell
14
star
3

ls-git

A happy union of `ls` and `git status`.
Perl
14
star
4

fish-plugin-sudo

A fish plugin for better sudo integration.
Shell
10
star
5

mac-icons

An assortment of custom MacOS folder icons, editable without Adobe products.
Shell
9
star
6

uni-chip8

Spring 2019, Team 15 (Chipotle) - CHIP-8
TypeScript
8
star
7

folder-icons

[REPLACED BY NEWER REPO] | An assortment of custom folder icons (with templates!) that I'm using.
7
star
8

pinentry-tmux

A pinentry program that uses a tmux popup for pinentry-curses.
Shell
6
star
9

fish-securenv

A fish function for on-demand retrieval of sensitive environment variables.
Shell
5
star
10

obsidian-theme-fluent

An Obsidian theme for a modern Windows 11 system.
SCSS
5
star
11

go-clout

An opinionated package that helps you print user-friendly output messages from your Go command line applications.
Go
4
star
12

esbuild-plugin-dts-bundle-generator

An esbuild plugin that builds d.ts bundles using `dts-bundle-generator`.
TypeScript
4
star
13

obsidian-extra

Utilities for working with Obsidian's undocumented API in a version-agnostic manner.
TypeScript
3
star
14

the-git-adventure

An adventure... made entirely from git checkout.
3
star
15

obsidian-undocumented

Definitions for undocumented/private Obsidian.md APIs.
3
star
16

sh-builtin-rs

A crate and proc macro for compiling dynamically-loadable Bash builtins.
Rust
2
star
17

homebrew-software

A Homebrew tap for software created by eth-p.
Ruby
2
star
18

docker-distro

A guide and environment for creating a working Linux distro inside a Docker container.
Shell
2
star
19

vim-it2-touchbar

A Vim and Neovim plugin that adds Apple Touch Bar support when using iTerm2.
Vim Script
2
star
20

my-dotfiles

A collection of dotfiles that I use to configure my terminal programs.
Shell
2
star
21

fish-promptfessional

Your flexible and highly-customizable Fish shell prompt.
Shell
2
star
22

jest-environment-obsidian

An experimental Jest environment for unit testing Obsidian plugins. (Old repo location)
TypeScript
2
star
23

gradle-bukkit

A simple and easy-to-configure Gradle plugin for building Bukkit plugins.
Java
1
star
24

vim-disable-italics

A small neovim plugin to disable italics in syntax highlighting.
Vim Script
1
star
25

Anki-Cards

A collection of custom-designed Anki note types.
CSS
1
star
26

joinerator

A utility for "stylizing" text with Unicode combining marks.
Rust
1
star
27

SFU-CMPT106

Fall 2017, Group Zeta
C#
1
star
28

obsidian-dev-helper

A Bash-based helper script that makes it easy to test Obsidian plugins while you develop them.
Shell
1
star
29

fish-plugin-better-cd

A better version of cd (and pushd) for your Fish shell.
Shell
1
star
30

openwrt-abpp

OpenWrt A/B Partition Project (for x86_64 Systems)
Shell
1
star
31

instagram-dm-pwa

A UserScript for turning the Instagram PWA into a real chat application.
TypeScript
1
star
32

bukkit-example

A small hello world Bukkit plugin built with Gradle for Bukkit.
Java
1
star
33

esbuild-plugin-obsidian

An esbuild plugin for creating Obsidian plugins.
TypeScript
1
star