Create eza_ls_git.md
This commit is contained in:
parent
c154a52545
commit
f251f666fb
1 changed files with 28 additions and 0 deletions
28
content/posts/eza_ls_git.md
Normal file
28
content/posts/eza_ls_git.md
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
title: "Rice"
|
||||||
|
description: "Making Linux Cool - Dynamically"
|
||||||
|
date: "2026-02-24"
|
||||||
|
tags:
|
||||||
|
- rice
|
||||||
|
- bash
|
||||||
|
categories:
|
||||||
|
- linux
|
||||||
|
---
|
||||||
|
I like the fun linux commands that rice out your setup but I don't like having to remember when/how to use them.
|
||||||
|
|
||||||
|
I've got my `.bashrc` that calls everything in `.bashrc.d/*`. In there I've started throwing in files with custom config options.
|
||||||
|
|
||||||
|
Here's a quick ls function that's context aware. I'll be expanding it as I learn better ways to use eza or similar listing tools.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
alias ls='_ls'
|
||||||
|
# ls: use eza with git info inside git repos, plain ls elsewhere
|
||||||
|
_ls() {
|
||||||
|
if git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||||
|
eza -l -h --git --git-repos --total-size --no-user --git-ignore --icons "$@"
|
||||||
|
else
|
||||||
|
command ls "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
Loading…
Reference in a new issue