ときさんブログ

ヘルニアン・ラプソディ

ツール系メモ on Arch Linux

Arch Linuxにインストールしているツール系のメモ

bat

cat の代替

install

sudo pacman -S bat

usage

cat みたいに使うだけ

fzf

fuzzy なファイル検索

install

sudo pacman -S fzf

setup(zsh)

source /usr/share/fzf/key-bindings.zsh && source /usr/share/fzf/completion.zsh

usage

shortcut 内容
Ctrl+t カレントディレクトリのファイルとフォルダを一覧する
(例: git commit に続けて Ctrl+t を押し、
Tab でファイルを選択し、最後に Enter で決定)
Ctrl+r シェルコマンドの履歴を検索
Alt+c 曖昧検索で選択したカレントディレクトリを変更

delta

進化した diff / git diff

install

yay -S git-delta

setup

~/.gitconfig

以下、追加

# github.com/dandavison/delta
[core]
    pager = delta

[delta]
    side-by-side = true
    features = unobtrusive-line-numbers decorations
    whitespace-error-style = 22 reverse

[delta "unobtrusive-line-numbers"]
    line-numbers = true
    line-numbers-left-format = "{nm:>4}┊"
    line-numbers-right-format = "{np:>4}│"
    line-numbers-left-style = blue
    line-numbers-right-style = blue

[delta "decorations"]
    commit-decoration-style =  box ul
    file-style = bold yellow ul
    file-decoration-style = none
    hunk-header-decoration-style = cyan box ul

usage

# 通常のdiff
delta file1.txt file2.txt

# side by side
# ~/.gitconfig で side-by-side = true なのでデフォルト
delta --side-by-side file1.txt file2.txt

# git
git diff
git show
git log -p

eza

進化した ls

install

sudo pacman -S eza

setup

~/.zshrc

以下、追加 && source

# eza
alias ll="eza -la"
alias lg="eza -la --git"
alias tree="eza --tree"

usage

# カラフルなファイル一覧表示(詳細情報/隠しファイル)
ll

# Git情報を表示
lg

# ツリー表示
tree

zoxide

よりスマートな cd

install

sudo pacman -S zoxide

setup

echo 'eval "$(zoxide init bash)"' >> ~/.zshrc && source ~/.zshrc

usage

command 内容
z foo cd into highest ranked directory matching foo
z foo bar cd into highest ranked directory matching foo and bar
z foo / cd into a subdirectory starting with foo
z ~/foo z also works like a regular cd command
z foo/ cd into relative path
z .. cd one level up
z - cd into previous directory
zi foo cd with interactive selection (using fzf)
z foo<SPACE><TAB> show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only)

tldr

進化した man

install

sudo pacman -S tldr

usage

tldr {command}

htop

進化した top

install

sudo pacman -S htop

usage

htop
© 2020 時藤屋 all rights reserved.