File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ install_cli_tools() {
140
140
just --completions zsh > " ${ZSH_COMPLETIONS_DIR} /_just"
141
141
142
142
sudo apt install --yes \
143
+ bat \
143
144
direnv \
144
145
dnsutils \
145
146
fd-find \
Original file line number Diff line number Diff line change @@ -27,6 +27,31 @@ plugins=(
27
27
28
28
export ZSH_COLORIZE_STYLE=" dracula"
29
29
30
+ # =====================================================================================
31
+ # Hooks
32
+ # =====================================================================================
33
+
34
+ function print_readme() {
35
+ local line_length=10
36
+
37
+ for readme in README.md README.rst README.txt README; do
38
+ if [[ -f " $readme " ]]; then
39
+ if command -v batcat > /dev/null 2>&1 ; then
40
+ batcat --line-range=:" $line_length " " $readme "
41
+ elif command -v bat > /dev/null 2>&1 ; then
42
+ bat --line-range=:" $line_length " " $readme "
43
+ else
44
+ head -n " $line_length " " $readme "
45
+ fi
46
+ break
47
+ fi
48
+ done
49
+ }
50
+
51
+ autoload -U add-zsh-hook
52
+ # Print README on directory change
53
+ add-zsh-hook chpwd print_readme
54
+
30
55
# =====================================================================================
31
56
# Custom functions
32
57
# =====================================================================================
You can’t perform that action at this time.
0 commit comments