From bc0693b82940b1c9aa414c481bee7034dd4f6722 Mon Sep 17 00:00:00 2001 From: mg Date: Fri, 17 Feb 2023 10:44:24 +0100 Subject: [PATCH] add mdtoc --- .bash_extra | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bash_extra b/.bash_extra index a6d5348..be91920 100644 --- a/.bash_extra +++ b/.bash_extra @@ -214,6 +214,9 @@ function glogs { fi; git log --pretty=format:'%C(auto) %<|(16,trunc)%h %Cred %G?%Creset %<|(60,trunc)%s %<(20,trunc)%Cgreen%cr%Creset %<(15,trunc)%Cblue%an%Creset %Cred%D' --graph --all -$ncommits } +function mdtoc { + grep --recursive --include="*.md" ^# | sort --version-sort --field-separator=":" | awk 'BEGIN {FS=":"}{print $2 "&&" $1}' | column --table --separator "&&" --table-truncate 1,2 +} ### Aliase # tmux alias tmuxa="tmux a -t "