mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 86b25cd76ad9a2b4346f1fa045c3474dbbdbdd87
parent e7da40b12a50b337489b334b9a8c7a7a2fe3ecc7
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun, 24 Dec 2023 19:09:54 +0100

wikiok

Diffstat:
vimw | 11+++++++++++
wikiok | 21---------------------
2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/vimw b/vimw @@ -0,0 +1,11 @@ +#!/bin/bash + +WIDTH="$1" +shift + +# vim with at most $WIDTH characters +# https://vi.stackexchange.com/q/43726 + +stty columns $WIDTH +vim "$@" + diff --git a/wikiok b/wikiok @@ -1,21 +0,0 @@ -#!/bin/bash - -FILE="$1" -cd "$HOME/todo/wiki" - -if grep '^OK: ' $FILE > /dev/null -then - if grep '^OK: yes$' $FILE > /dev/null - then - sed -i 's/^OK: yes$/OK: no/' $FILE - else - sed -i 's/^OK: .*/OK: yes/' $FILE - fi -else - # Remove blank lines from the end of a file: - # https://unix.stackexchange.com/a/552195 - sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}' $FILE - echo >> $FILE - echo "OK: yes" >> $FILE -fi -