LoginSignup
5
1

More than 3 years have passed since last update.

[Linux便利コマンド] batを入れてみる

Posted at

環境

概要

を見て便利なものをどんどん入れてみようということで、前回に続いてbat。

batインストール

githubのページを見る限りyum(centos)でのインストール方法が無いみたい。

なのでreleasesにあるこちらのリンクを使って入れることにします。

# インストール
$ wget https://github.com/sharkdp/bat/releases/download/v0.15.4/bat-v0.15.4-x86_64-unknown-linux-gnu.tar.gz
$ tar -zxvf bat-v0.15.4-x86_64-unknown-linux-gnu.tar.gz
$ cd bat-v0.15.4-x86_64-unknown-linux-gnu
$ sudo mv ./bat /usr/local/bin/

batの確認

image.png

        --style <components>
            Configure which elements (line numbers, file headers, grid borders, Git modifications,
            ..) to display in addition to the file contents. The argument is a comma-separated list
            of components to display (e.g. 'numbers,changes,grid') or a pre-defined style ('full').
            To set a default style, add the '--style=".."' option to the configuration file or
            export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
            values: *auto*, full, plain, changes, header, grid, numbers, snip.

見た目をいろいろ変えれるみたい。
デフォルトではfullなのかな・・?たぶん。

叩くときにファイル名は分かっているので、個人的には無くて良いかなと。
あとgitの差分はgitコマンドで見るしbatにはなくてよいので(無駄に遅くなってもですし)

image.png

これで縦幅もすこし縮めることができた。

エイリアス

alias bat='bat --style="numbers,grid"'

image.png

これでスタイルは指定なしでよくなった!めでたしめでたし。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1