31-08-2021

This commit is contained in:
2021-08-31 09:29:05 +02:00
parent 7d89fb0224
commit bb890cba15
28 changed files with 1888 additions and 47 deletions

View File

@@ -6,32 +6,32 @@ https://github.com/sharkdp/bat
Installation:
##### Installation:
```bash
$ brew install bat
$ brew install fzf
```
Créer le fichier de configuration:
##### Créer le fichier de configuration:
```bash
$ bat --generate-config-file
```
Editer la configuration:
##### Editer la configuration:
```bash
$ nano /Users/bruno/.config/bat/config
```
Prévisualiser les thèmes:
##### Prévisualiser les thèmes:
```bash
$ bat --list-themes | fzf --preview="bat --theme={} --color=always /Users/bruno/Documents/Scripts/bash/zsh_tools.sh"
```
Tail et bat:
##### Tail et bat:
```bash
$ tail -f /usr/local/var/log/httpd/error_log | bat --paging=never -l log
@@ -43,7 +43,7 @@ $ tail -f /usr/local/var/log/httpd/error_log | bat --paging=never -l log
4 [Fri Nov 27 16:22:54.278819 2020] [core:notice] [pid 10014] AH00094: Command line: '/usr/local/opt/httpd/bin/httpd -D FOREGROUND'
```
Find et bat:
##### Find et bat:
```bash
$ find /usr -name error_log -exec bat {} +
@@ -56,13 +56,64 @@ $ find /usr -name error_log -exec bat {} +
```
Man pages:
##### Man pages:
```bash
$ export MANPAGER="sh -c 'col -bx | bat -l man -p'"
man 2 select
```
##### Afficher les caractères non-imprimables:
```bash
bat -A /etc/hosts
File: /etc/hosts
1 ##␊
2 #·Host·Database␊
3 #␊
4 #·localhost·is·used·to·configure·the·loopback·interface␊
5 #·when·the·system·is·booting.··Do·not·change·this·entry.␊
6 ##␊
7 127.0.0.1├──┤localhost␊
8 255.255.255.255├──┤broadcasthost␊
9 ::1·············localhost␊
10 #·Added·by·Docker·Desktop␊
11 #·To·allow·the·same·kube·context·to·work·on·the·host·and·the·container:␊
12 127.0.0.1·kubernetes.docker.internal␊
13 #·End·of·section␊
```
##### Voir plusieurs fichiers en même temps:
```bash
$ bat plugins.d/*.sh
File: plugins.d/00-kymsu.sh
1 #!/usr/bin/env bash
2 echo "🦄 KYMSU self update"
3 pushd "$(cat ~/.kymsu/path)" > /dev/null
4 git pull
5 popd > /dev/null
6 echo ""
File: plugins.d/antibody.sh
1 #!/usr/bin/env bash
2
3 # Antibody plugin for KYMSU
4 # https://github.com/welcoMattic/kymsu
5 # https://github.com/getantibody/antibody
6
File: plugins.d/conda.sh
1 #!/usr/bin/env bash
2
3 # conda plugin for KYMSU
4 # https://github.com/welcoMattic/kymsu
5
```
## bat-extras