aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 14:59:19 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 14:59:19 +1300
commit7f503e68db2e1545542ca15429a569584a500fbc (patch)
treef0ef90c4e095cc0693bd2253326d9d3bbe7172e7
parentMerge branch 'master' into port/bsd/openbsd (diff)
parentMerge branch 'port/bsd/freebsd' (diff)
downloaddotfiles-7f503e68db2e1545542ca15429a569584a500fbc.tar.gz
dotfiles-7f503e68db2e1545542ca15429a569584a500fbc.zip
Merge branch 'master' into port/bsd/openbsd
-rw-r--r--IDEAS.md (renamed from IDEAS.markdown)4
-rw-r--r--ISSUES.md (renamed from ISSUES.markdown)0
-rw-r--r--README.md (renamed from README.markdown)2
-rw-r--r--TABS.md26
-rw-r--r--bin/mktd.sh3
-rw-r--r--games/aaf.sh2
-rw-r--r--games/chkl.sed1
-rw-r--r--games/dr.sh4
-rw-r--r--games/philsay.sh1
-rw-r--r--games/rndn.sh1
-rw-r--r--games/xyzzy.sh2
-rw-r--r--man/man1/murl.1df2
-rw-r--r--man/man7/dotfiles.7df2
-rw-r--r--sh/shrc.d/ls.sh10
14 files changed, 47 insertions, 13 deletions
diff --git a/IDEAS.markdown b/IDEAS.md
index 544530e3..bba9e314 100644
--- a/IDEAS.markdown
+++ b/IDEAS.md
@@ -1,8 +1,8 @@
Ideas
=====
-* A wrapper ksw(1df) (kill-switch) that caches SIGINT traps to kill a called
- program or loop immediately rather than aborting a loop (is this possible?)
+* A wrapper ksw(1df) (kill-switch) that traps SIGINT to kill a called program
+ or loop immediately, rather than aborting a loop (is this possible?)
* A wrapper sil(1df) or nec(1df) to turn stty -echo off for the duration of a
paste?
* I can probably share my psql() completions/shortcuts after sanitizing them
diff --git a/ISSUES.markdown b/ISSUES.md
index 48007919..48007919 100644
--- a/ISSUES.markdown
+++ b/ISSUES.md
diff --git a/README.markdown b/README.md
index adc4c73a..f1b254f0 100644
--- a/README.markdown
+++ b/README.md
@@ -143,7 +143,7 @@ A terminal session with my prompt looks something like this:
~$ ssh remote
remote:~$ cd .dotfiles
remote:~/.dotfiles(master+!)$ git status
- M README.markdown
+ M README.md
M bash/bashrc.d/prompt.bash
A init
remote:~/.dotfiles(master+!)$ foobar
diff --git a/TABS.md b/TABS.md
new file mode 100644
index 00000000..feeee631
--- /dev/null
+++ b/TABS.md
@@ -0,0 +1,26 @@
+Spaces to tabs
+==============
+
+If you prefer tabs to spaces, the following recipe seems to convert everything
+pretty nicely:
+
+ $ find . -name .git -prune -o -name vim -prune -o -type f \
+ -exec sh -c \
+ 'for f;do unexpand -t4 "$f">"$f".tmp;mv "$f" "$f".tmp;done' \
+ _ {} +
+
+ $ find vim -name bundle -prune -o -type f \
+ -exec sh -c \
+ 'for f;do unexpand -t2 "$f">"$f".tmp;mv "$f" "$f".tmp;done' \
+ _ {} +
+
+If you have GNU unexpand(1) and can add `--first-only` to each of those calls,
+the results seem perfect.
+
+You can configure Vim to accommodate this by removing the settings for:
+
+* `expandtab`
+* `shiftround`
+* `shiftwidth`
+* `smarttab`
+* `softtabstop`
diff --git a/bin/mktd.sh b/bin/mktd.sh
index 89cdc7c3..72375873 100644
--- a/bin/mktd.sh
+++ b/bin/mktd.sh
@@ -2,7 +2,8 @@
# Build the intended directory name, with the last element a random integer
# from 1..2^31
-dn=${TMPDIR:-/tmp}/${1:-mktd}.$$.$(rndi 1 2147483648)
+lim=$((2 << 31))
+dn=${TMPDIR:-/tmp}/${1:-mktd}.$$.$(rndi 1 "$lim")
# Create the directory and print its name if successful
mkdir -m 700 -- "$dn" && printf '%s\n' "$dn"
diff --git a/games/aaf.sh b/games/aaf.sh
index 4f1825c6..24094a73 100644
--- a/games/aaf.sh
+++ b/games/aaf.sh
@@ -1,3 +1,3 @@
-#!/bin/sh
+# Print a random ASCII Art Fart
curl http://www.asciiartfarts.com/random.cgi |
pup -p 'table[cellpadding]' pre text{}
diff --git a/games/chkl.sed b/games/chkl.sed
index 40c35cee..6e4b1c77 100644
--- a/games/chkl.sed
+++ b/games/chkl.sed
@@ -1,4 +1,3 @@
-#!/bin/sed -f
# Change an ASCII checklist with [/], [x], and [ ] boxes to a Unicode one
/^#/d
s_^\[ \]_☐_
diff --git a/games/dr.sh b/games/dr.sh
index 9f08164d..df21d7a5 100644
--- a/games/dr.sh
+++ b/games/dr.sh
@@ -1,4 +1,3 @@
-#!/bin/sh
# Roll D&D-style dice in a ndn+n formula, e.g. 10d6+2
# Need exactly one argument
@@ -23,8 +22,7 @@ esac
# Roll the dice the appropriate number of times using rndi(1df)
i=0 t=0
while [ "$i" -lt "$n" ] ; do
- seed=$(rnds)
- r=$(rndi 1 "$d" "$seed")
+ r=$(rndi 1 "$d")
t=$((t + r))
i=$((i + 1))
done
diff --git a/games/philsay.sh b/games/philsay.sh
index 9270c52e..1c02bf57 100644
--- a/games/philsay.sh
+++ b/games/philsay.sh
@@ -1,3 +1,4 @@
+# Ha, ha, ha! ASCII!
speech=$(pks "$@") || exit
printf '\n%066s\n' '( '"$speech"' )'
cat <<'EOF'
diff --git a/games/rndn.sh b/games/rndn.sh
index 18c34218..bcde9c3c 100644
--- a/games/rndn.sh
+++ b/games/rndn.sh
@@ -1,4 +1,3 @@
-#!/bin/sh
# Esoteric random number generator
# Single optional argument is a random seed, otherwise use rnds(1df)
diff --git a/games/xyzzy.sh b/games/xyzzy.sh
index d262c0e6..5cc03278 100644
--- a/games/xyzzy.sh
+++ b/games/xyzzy.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+# ADVENTURE
if [ -e "$HOME"/.xyzzy ] ; then
printf >&2 '%s\n' 'Nothing happens.'
exit 1
diff --git a/man/man1/murl.1df b/man/man1/murl.1df
index f022152b..088158b0 100644
--- a/man/man1/murl.1df
+++ b/man/man1/murl.1df
@@ -4,7 +4,7 @@
\- convert Markdown to HTML with pandoc(1) and extract URLs from it with hurl(1df)
.SH SYNOPSIS
.B murl
-README.markdown
+README.md
.br
.B murl
page1.md page2.md
diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df
index 831af06d..5538fdd2 100644
--- a/man/man7/dotfiles.7df
+++ b/man/man7/dotfiles.7df
@@ -209,7 +209,7 @@ A terminal session with my prompt looks something like this:
~$\ ssh\ remote
remote:~$\ cd\ .dotfiles
remote:~/.dotfiles(master+!)$\ git\ status
-\ M\ README.markdown
+\ M\ README.md
M\ \ bash/bashrc.d/prompt.bash
A\ \ init
remote:~/.dotfiles(master+!)$\ foobar
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index d58c64f9..7e843cc7 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -33,6 +33,16 @@ ls() {
[ -e "$HOME"/.cache/sh/opt/ls/time-style ] &&
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
+ # If the operating system is FreeBSD, there are some specific options we
+ # can add that might mean different things to e.g. GNU ls(1)
+ case $OS in
+ FreeBSD)
+ # -D: Timestamp format
+ # -G: Use color
+ set -- -D '%Y-%m-%d %H:%M:%S' -G "$@"
+ ;;
+ esac
+
# Run ls(1) with the concluded arguments
command ls "$@"
}