Des slides dans votre vim - retour accueil
git clone git://bebou.netlib.re/slides.vim
Log | Files | Refs |
commit ccb8c36730940cd23f0fd4bfe98ed1a8f5d1d379 parent fbdf7ff2bd9aadc5f3db5332bcb38d30e57fdec5 Auterice: Marc Chantreux <mc@unistra.fr> Date: Fri, 13 Oct 2023 11:45:40 +0200 fixtitles works properly Diffstat:
A | bin/slides.vim.fixtitles | | | 36 | ++++++++++++++++++++++++++++++++++++ |
1 file changed, 36 insertions(+), 0 deletions(-)
diff --git a/bin/slides.vim.fixtitles b/bin/slides.vim.fixtitles @@ -0,0 +1,36 @@ +#!/bin/sh + +usage() <<% cat -- + +just before running the talk: + +add extra tailing spaces to title lines so they looks like c columns long. +this is something to do + + $0 60 + +when editing it: remove them + + $0 -r +remove + +% + +cmd="${1?at least one parameter, see $0 -h}" +shift; + +expand() awk -F'›' '{ + if (l = length($2)) printf "%-*s\n", l + c, $0 + else print +}' "$@" + +case "$cmd" + in ( [1-9]* ) expand "c=$cmd" "$@" + ;; ( -r | 0 ) sed -r '/›/s/ +$//' "$@" + ;; ( -h | --help ) usage + ;; ( * ) + >&2 echo "unknown command $cmd, see $0 -h" + exit 1 +esac + +