aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-06-02 22:09:38 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-06-02 22:09:38 +1200
commite1e02dae1d6cfe6c34d1f0641349fab6eadca19c (patch)
treef11de1d64997ef90579fef04018e66350e3dfb73
parentMerge branch 'master' into port/bsd/freebsd (diff)
parentRemove lies from mi5 (diff)
downloaddotfiles-e1e02dae1d6cfe6c34d1f0641349fab6eadca19c.tar.gz
dotfiles-e1e02dae1d6cfe6c34d1f0641349fab6eadca19c.zip
Merge branch 'master' into port/bsd/freebsd
-rw-r--r--.gitignore25
-rw-r--r--IDEAS.markdown9
-rw-r--r--ISSUES.markdown1
-rw-r--r--Makefile102
-rw-r--r--README.markdown24
-rw-r--r--bash/bash_completion.d/ad.bash2
-rw-r--r--bash/bash_completion.d/sd.bash2
-rw-r--r--bash/bash_completion.d/td.bash15
-rw-r--r--bin/chn.mi5 (renamed from bin/chn.sh)18
-rw-r--r--bin/clog.sh2
-rw-r--r--bin/dam.sed8
-rw-r--r--bin/edda.mi521
-rw-r--r--bin/gwp.awk2
-rw-r--r--bin/mi5.awk47
-rw-r--r--bin/mw.awk10
-rw-r--r--bin/osc.sh2
-rw-r--r--bin/p.sh1
-rw-r--r--bin/pph.sh5
-rw-r--r--bin/pst.mi519
-rw-r--r--bin/pst.sh32
-rw-r--r--bin/rfct.awk11
-rw-r--r--bin/rndl.mi5 (renamed from bin/rndl.sh)18
-rw-r--r--bin/swr.mi5 (renamed from bin/swr.sh)20
-rw-r--r--bin/tlcs.mi5 (renamed from bin/tlcs.sh)18
-rw-r--r--bin/trs.awk36
-rw-r--r--bin/try.mi5 (renamed from bin/try.sh)18
-rw-r--r--bin/urlc.mi5 (renamed from bin/urlc.sh)18
-rw-r--r--check/login-shell.sh2
-rw-r--r--check/yash.sh5
-rw-r--r--git/gitconfig.mi5 (renamed from git/gitconfig.m4)8
-rw-r--r--gnupg/gpg.conf.mi5 (renamed from gnupg/gpg.conf.m4)2
-rw-r--r--include/mktd.mi5 (renamed from bin/edda.sh)18
-rw-r--r--install/install-login-shell.sh2
-rw-r--r--ksh/shrc.d/ksh.sh2
-rw-r--r--lint/yash.sh1
-rw-r--r--man/man1/bcq.1df2
-rw-r--r--man/man1/clog.1df2
-rw-r--r--man/man1/dam.1df16
-rw-r--r--man/man1/edda.1df18
-rw-r--r--man/man1/fgscr.1df3
-rw-r--r--man/man1/fnl.1df2
-rw-r--r--man/man1/mi5.1df57
-rw-r--r--man/man1/mw.1df25
-rw-r--r--man/man1/p.1df44
-rw-r--r--man/man1/pp.1df2
-rw-r--r--man/man1/pph.1df8
-rw-r--r--man/man1/pvi.1df2
-rw-r--r--man/man1/swr.1df5
-rw-r--r--man/man1/trs.1df23
-rw-r--r--mysql/my.cnf1
-rw-r--r--sh/profile.d/downloads.sh28
-rw-r--r--sh/shrc.d/ad.sh80
-rw-r--r--sh/shrc.d/bd.sh99
-rw-r--r--sh/shrc.d/gd.sh2
-rw-r--r--sh/shrc.d/gt.sh28
-rw-r--r--sh/shrc.d/hgrep.sh6
-rw-r--r--sh/shrc.d/mysql.sh25
-rw-r--r--sh/shrc.d/pd.sh49
-rw-r--r--sh/shrc.d/pmd.sh2
-rw-r--r--sh/shrc.d/rd.sh47
-rw-r--r--sh/shrc.d/sd.sh110
-rw-r--r--sh/shrc.d/ud.sh61
-rw-r--r--tmux/tmux.conf.mi5 (renamed from tmux/tmux.conf.m4)8
m---------vim/bundle/pathogen0
m---------vim/bundle/unimpaired0
-rw-r--r--yash/yash_profile2
-rw-r--r--yash/yashrc14
-rw-r--r--yash/yashrc.d/ver.yash4
68 files changed, 702 insertions, 599 deletions
diff --git a/.gitignore b/.gitignore
index bafd0f1e..153d2227 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,15 +12,20 @@ bin/cf
bin/cfr
bin/chc
bin/chn
+bin/chn.sh
+bin/chn.m4
bin/clog
bin/clrd
bin/clwr
bin/csmw
bin/d2u
+bin/dam
bin/ddup
bin/dmp
bin/dub
bin/edda
+bin/edda.sh
+bin/edda.m4
bin/eds
bin/exm
bin/fgscr
@@ -51,6 +56,7 @@ bin/mean
bin/med
bin/mex
bin/mftl
+bin/mi5
bin/min
bin/mkcp
bin/mkmv
@@ -58,9 +64,11 @@ bin/mktd
bin/mode
bin/motd
bin/murl
+bin/mw
bin/nlbr
bin/onl
bin/osc
+bin/p
bin/pa
bin/paz
bin/ped
@@ -69,6 +77,8 @@ bin/plmu
bin/pp
bin/pph
bin/pst
+bin/pst.sh
+bin/pst.m4
bin/pvi
bin/pwg
bin/quo
@@ -80,6 +90,8 @@ bin/rnda
bin/rndf
bin/rndi
bin/rndl
+bin/rndl.sh
+bin/rndl.m4
bin/rnds
bin/sd2u
bin/sec
@@ -98,16 +110,25 @@ bin/su2d
bin/sue
bin/supp
bin/swr
+bin/swr.sh
+bin/swr.m4
bin/td
bin/tl
bin/tlcs
+bin/tlcs.sh
+bin/tlcs.m4
bin/tm
bin/tot
+bin/trs
bin/try
+bin/try.sh
+bin/try.m4
bin/u2d
bin/umake
bin/unf
bin/urlc
+bin/urlc.sh
+bin/urlc.m4
bin/urlh
bin/urlmt
bin/uts
@@ -132,7 +153,11 @@ games/strik
games/xyzzy
games/zs
git/gitconfig
+git/gitconfig.m4
gnupg/gpg.conf
+gnupg/gpg.conf.m4
+include/mktd.m4
man/man7/dotfiles.7df
tmux/tmux.conf
+tmux/tmux.conf.m4
urxvt/ext/select
diff --git a/IDEAS.markdown b/IDEAS.markdown
index 67283ce2..61f1049d 100644
--- a/IDEAS.markdown
+++ b/IDEAS.markdown
@@ -7,11 +7,10 @@ Ideas
manageable
* Have eds(1df) accept stdin with the "starting content" for the script
* Convert all the manual pages to mandoc maybe? <https://en.wikipedia.org/wiki/Mandoc>
-* edio(1df), like vipe(1)
-* Detect appropriate shell family to install in Makefile
* qmp(1df)--quick man page
-* ad() could be more intelligent; if there's only one directory that matches
- the *whole pattern*, we can assume it's safe to use that one, rather than
- stopping each time any node has more than one match
* The solution to chn(1df) not running in parallel is probably backgrounded
processes and mkfifo(1).
+* Write something like hcat(1df) or tcat(1df) that includes filename headings
+ for each concatenated file.
+* mi5(1df) could be made to handle comment delimiters and $1 $2 expansions
+ without too much pain (substr/index counting)
diff --git a/ISSUES.markdown b/ISSUES.markdown
index 4116adda..a69e07df 100644
--- a/ISSUES.markdown
+++ b/ISSUES.markdown
@@ -23,4 +23,3 @@ Known issues
my own stuff in there
* Completion for custom functions e.g. `sd` should ideally respect
`completion-ignore-case` setting
-* Copy-mode configuration for tmux needs to be reinstated.
diff --git a/Makefile b/Makefile
index 999b90ac..8f278325 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,6 @@
install-vim-pathogen \
install-vim-plugins \
install-x \
- install-yash \
install-zsh \
check \
check-bash \
@@ -54,7 +53,6 @@
check-sh \
check-urxvt \
check-xinit \
- check-yash \
check-zsh \
lint \
lint-bash \
@@ -63,11 +61,10 @@
lint-ksh \
lint-sh \
lint-urxvt \
- lint-xinit \
- lint-yash
+ lint-xinit
.SUFFIXES:
-.SUFFIXES: .awk .bash .pl .sed .sh
+.SUFFIXES: .awk .bash .m4 .mi5 .pl .sed .sh
NAME = 'Tom Ryder'
EMAIL = tom@sanctum.geek.nz
@@ -92,6 +89,7 @@ BINS = bin/ap \
bin/clrd \
bin/clwr \
bin/csmw \
+ bin/dam \
bin/d2u \
bin/ddup \
bin/dmp \
@@ -121,6 +119,7 @@ BINS = bin/ap \
bin/jfcd \
bin/jfp \
bin/loc \
+ bin/mi5 \
bin/max \
bin/maybe \
bin/mean \
@@ -134,6 +133,7 @@ BINS = bin/ap \
bin/mode \
bin/motd \
bin/murl \
+ bin/mw \
bin/nlbr \
bin/onl \
bin/osc \
@@ -142,6 +142,7 @@ BINS = bin/ap \
bin/ped \
bin/pit \
bin/plmu \
+ bin/p \
bin/pp \
bin/pph \
bin/pst \
@@ -179,6 +180,7 @@ BINS = bin/ap \
bin/tlcs \
bin/tm \
bin/tot \
+ bin/trs \
bin/try \
bin/u2d \
bin/umake \
@@ -215,12 +217,67 @@ clean distclean:
rm -f -- \
$(BINS) \
$(GAMES) \
+ bin/chn.sh \
+ bin/chn.m4 \
+ bin/edda.sh \
+ bin/edda.m4 \
+ bin/pst.sh \
+ bin/pst.m4 \
+ bin/rndl.sh \
+ bin/rndl.m4 \
+ bin/swr.sh \
+ bin/swr.m4 \
+ bin/tlcs.sh \
+ bin/tlcs.m4 \
+ bin/try.sh \
+ bin/try.m4 \
+ bin/urlc.sh \
+ bin/urlc.m4 \
git/gitconfig \
+ git/gitconfig.m4 \
gnupg/gpg.conf \
+ gnupg/gpg.conf.m4 \
+ include/mktd.m4 \
man/man8/dotfiles.7df \
tmux/tmux.conf \
+ tmux/tmux.conf.m4 \
urxvt/ext/select
+.awk:
+ sh bin/shb.sh awk -f < $< > $@
+ chmod +x ./$@
+
+.bash:
+ sh bin/shb.sh bash < $< > $@
+ chmod +x ./$@
+
+.pl:
+ sh bin/shb.sh perl < $< > $@
+ chmod +x ./$@
+
+.sed:
+ sh bin/shb.sh sed -f < $< > $@
+ chmod +x ./$@
+
+.sh:
+ sh bin/shb.sh sh < $< > $@
+ chmod +x ./$@
+
+.mi5.m4:
+ awk -f bin/mi5.awk < $< > $@
+
+.m4.sh:
+ m4 < $< > $@
+
+bin/chn.sh: include/mktd.m4
+bin/edda.sh: include/mktd.m4
+bin/pst.sh: include/mktd.m4
+bin/rndl.sh: include/mktd.m4
+bin/swr.sh: include/mktd.m4
+bin/tlcs.sh: include/mktd.m4
+bin/try.sh: include/mktd.m4
+bin/urlc.sh: include/mktd.m4
+
git/gitconfig: git/gitconfig.m4
m4 \
-D DF_NAME=$(NAME) \
@@ -248,26 +305,6 @@ tmux/tmux.conf: tmux/tmux.conf.m4
m4 -D DF_TMUX_BG=$(TMUX_BG) -D DF_TMUX_FG=$(TMUX_FG) \
tmux/tmux.conf.m4 > $@
-.awk:
- sh bin/shb.sh awk -f < $< > $@
- chmod +x ./$@
-
-.bash:
- sh bin/shb.sh bash < $< > $@
- chmod +x ./$@
-
-.pl:
- sh bin/shb.sh perl < $< > $@
- chmod +x ./$@
-
-.sed:
- sh bin/shb.sh sed -f < $< > $@
- chmod +x ./$@
-
-.sh:
- sh bin/shb.sh sh < $< > $@
- chmod +x ./$@
-
install: install-bin \
install-curl \
install-ex \
@@ -446,12 +483,6 @@ install-x: check-xinit
cp -p -- X/Xresources $(HOME)/.Xresources
cp -p -- X/Xresources.d/* $(HOME)/.Xresources.d
-install-yash: install-yash install-sh
- mkdir -p -- $(HOME)/.yashrc.d
- cp -p -- yash/yash_profile $(HOME)/.yash_profile
- cp -p -- yash/yashrc $(HOME)/.yashrc
- cp -p -- yash/yashrc.d/* $(HOME)/.yashrc.d
-
install-zsh: check-zsh install-sh
mkdir -p -- $(HOME)/.profile.d $(HOME)/.zshrc.d
cp -p -- zsh/profile.d/* $(HOME)/.profile.d
@@ -491,9 +522,6 @@ check-urxvt:
check-xinit:
sh check/xinit.sh
-check-yash:
- sh check/yash.sh
-
check-zsh:
sh check/zsh.sh
@@ -503,8 +531,7 @@ lint: lint-bash \
lint-ksh \
lint-sh \
lint-urxvt \
- lint-xinit \
- lint-yash
+ lint-xinit
lint-bash: check-bash
sh lint/bash.sh
@@ -526,6 +553,3 @@ lint-urxvt: check-urxvt
lint-xinit: check-xinit
sh lint/xinit.sh
-
-lint-yash: check-yash
- sh lint/yash.sh
diff --git a/README.markdown b/README.markdown
index 3afc6900..bd0b6682 100644
--- a/README.markdown
+++ b/README.markdown
@@ -54,7 +54,7 @@ to figure out which shell’s configuration files to install, falling back on
`install-sh`.
The remaining dotfiles can be installed with the other `install-*` targets. Try
-`sh bin/mftl.sh Makefile` in the project's root directory to see a list.
+`awk -f bin/mftl.awk Makefile` in the project's root directory to see a list.
Tools
-----
@@ -64,8 +64,7 @@ Configuration is included for:
* Bourne-style POSIX shells, sharing a `.profile`, an `ENV` file, and
some helper functions:
* [GNU Bash](https://www.gnu.org/software/bash/) (2.05a or higher)
- * [Korn shell](http://www.kornshell.com/) (including `pdksh`, `mksh`)
- * [Yash](https://yash.osdn.jp/index.html.en)
+ * [Korn shell](http://www.kornshell.com/) (`ksh93`, `pdksh`, `mksh`)
* [Z shell](https://www.zsh.org/)
* [Abook](http://abook.sourceforge.net/) -- curses address book program
* [cURL](https://curl.haxx.se/) -- Command-line tool for transferring data
@@ -190,8 +189,6 @@ in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include:
* `pmd()` prints the marked directory.
* `xd()` swaps the current and marked directories.
* Ten other directory management and navigation functions:
- * `ad()` is a `cd` shortcut accepting targets like `/u/l/b` for
- `/usr/local/bin`, as long as they are unique.
* `bd()` changes into a named ancestor of the current directory.
* `gt()` changes into a directory or into a file's directory.
* `lgt()` runs `gt()` on the first result from a `loc(1df)` search.
@@ -220,8 +217,6 @@ in `sh/shrc.d` to be loaded by any POSIX interactive shell. Those include:
available.
* `la()` runs `ls -A` if it can, or `ls -a` otherwise.
* `ll()` runs `ls -Al` if it can, or `ls -al` otherwise.
-* `mysql()` allows shortcuts to MySQL configuration files stored in
- `~/.mysql`.
* `path()` manages the contents of `PATH` conveniently.
* `scp()` tries to detect forgotten hostnames in `scp(1)` command calls.
* `sudo()` forces `-H` for `sudo(8)` calls so that `$HOME` is never
@@ -241,7 +236,7 @@ non-POSIX features, as compatibility allows:
* `vared()` allows interactively editing a variable with Readline, emulating
a Zsh function I like by the same name (Bash).
* `ver()` prints the current shell's version information (Bash, Korn Shell,
- Yash, Z shell).
+ Z shell).
#### Completion
@@ -260,7 +255,6 @@ files, for things I really do get tired of typing repeatedly:
* `gpg(1)` long options
* `make(1)` targets read from a `Makefile`
* `man(1)` page titles
-* `mysql(1)` databases from `~/.mysql/*.cnf`
* `pass(1)` entries
* `ssh(1)` hostnames from `~/.ssh/config`
@@ -279,10 +273,6 @@ These are experimental; they are mostly used to tinker with MirBSD `mksh`, AT&T
`ksh93`, and OpenBSD `pdksh`. All shells in this family default to a yellow
prompt if detected.
-#### Yash
-
-Just enough configuration to coax it into reading `~/.profile` and `~/.shrc`.
-
#### Zsh
These are experimental; I do not like Zsh much at the moment. The files started
@@ -477,6 +467,7 @@ Installed by the `install-bin` target:
line.
* `csmw(1df)` prints an English list of monospace-quoted words read from the
input.
+* `dam(1df)` buffers all its input before emitting it as output.
* `ddup(1df)` removes duplicate lines from unsorted input.
* `dmp(1df)` copies a pass(1) entry selected by `dmenu(1)` to the X
CLIPBOARD.
@@ -507,13 +498,19 @@ Installed by the `install-bin` target:
success,
it exits with success or failure. Good for quick tests.
* `mex(1df)` makes given filenames in `$PATH` executable.
+* `mi5(1df)` pre-processes a crude but less painful macro expansion file
+ format into m4.
* `mftl(1df)` finds usable-looking targets in Makefiles.
* `mkcp(1df)` creates a directory and copies preceding arguments into it.
* `mkmv(1df)` creates a directory and moves preceding arguments into it.
* `motd(1df)` shows the system MOTD.
+* `mw(1df)` prints alphabetic space-delimited words from the input one per
+ line.
* `onl(1df)` crunches input down to one printable line.
* `osc(1df)` implements a `netcat(1)`-like wrapper for `openssl(1)`'s
`s_client` subcommand.
+* `p(1df)` prints concatenated standard input; `cat(1)` as it should always
+ have been
* `pa(1df)` prints its arguments, one per line.
* `pp(1df)` prints the full path of each argument using `$PWD`.
* `pph(1df)` runs `pp(1df)` and includes a leading `$HOSTNAME:`.
@@ -539,6 +536,7 @@ Installed by the `install-bin` target:
to use Taskwarrior, but found it too complex and buggy.
* `tm(1df)` runs `tmux(1)` with `attach-session -d` if a session exists, and
`new-session` if it doesn't.
+* `trs(1df)` replaces strings (not regular expression) in its input.
* `try(1df)` repeats a command up to a given number of times until it
succeeds, only printing error output if all three attempts failed. Good for
tolerating blips or temporary failures in `cron(8)` scripts.
diff --git a/bash/bash_completion.d/ad.bash b/bash/bash_completion.d/ad.bash
deleted file mode 100644
index 390fcb00..00000000
--- a/bash/bash_completion.d/ad.bash
+++ /dev/null
@@ -1,2 +0,0 @@
-# Completion function for ad(); just directories
-complete -A directory ad
diff --git a/bash/bash_completion.d/sd.bash b/bash/bash_completion.d/sd.bash
index aeee1615..aeb76fa0 100644
--- a/bash/bash_completion.d/sd.bash
+++ b/bash/bash_completion.d/sd.bash
@@ -7,7 +7,7 @@ _sd() {
# Current directory can't be root directory
[[ $PWD != / ]] || return 1
- # Build list of matching sibiling directories
+ # Build list of matching sibling directories
local dirname
while IFS= read -rd '' dirname ; do
[[ -n $dirname ]] || continue
diff --git a/bash/bash_completion.d/td.bash b/bash/bash_completion.d/td.bash
index eb29992b..db232dd6 100644
--- a/bash/bash_completion.d/td.bash
+++ b/bash/bash_completion.d/td.bash
@@ -4,16 +4,23 @@ _td() {
dir=${TODO_DIR:-"$HOME"/Todo}
local fn
while IFS= read -rd '' fn ; do
+ [[ -n $fn ]] || continue
COMPREPLY[${#COMPREPLY[@]}]=$fn
done < <(
shopt -s extglob nullglob
shopt -u dotglob
- local -a fns
+ declare -a fns
fns=("$dir"/"${COMP_WORDS[COMP_CWORD]}"*)
fns=("${fns[@]#"$dir"/}")
- ((${#fns[@]})) || exit 1
- printf '%s\0' "${fns[@]##"$dir"/}"
+
+ # Print quoted entries, null-delimited, if there was at least one;
+ # otherwise, just print a null character to stop this hanging in Bash
+ # 4.4
+ if ((${#fns[@]})) ; then
+ printf '%q\0' "${fns[@]}"
+ else
+ printf '\0'
+ fi
)
- return
}
complete -F _td td
diff --git a/bin/chn.sh b/bin/chn.mi5
index 9103dd07..dfc1000c 100644
--- a/bin/chn.sh
+++ b/bin/chn.mi5
@@ -23,21 +23,9 @@ if [ "$c" -eq 0 ] ; then
exit
fi
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# Define and create input and output files
if=$td/if of=$td/of
diff --git a/bin/clog.sh b/bin/clog.sh
index b17ff1c5..b62d4f94 100644
--- a/bin/clog.sh
+++ b/bin/clog.sh
@@ -7,7 +7,7 @@ set --
# If we have rlwrap, quietly use it
command -v rlwrap >/dev/null 2>&1 &&
- set -- rlwrap -C "$self" "$@"
+ set -- rlwrap --history-filename=/dev/null -C "$self" "$@"
# Write the date, the standard input (rlwrapped if applicable), and two dashes
# to $CLOG, defaulting to ~/.clog.
diff --git a/bin/dam.sed b/bin/dam.sed
new file mode 100644
index 00000000..86fb03f9
--- /dev/null
+++ b/bin/dam.sed
@@ -0,0 +1,8 @@
+# Store up all input before emitting it unchanged as output
+1h
+1!H
+$ {
+ g
+ p
+}
+d
diff --git a/bin/edda.mi5 b/bin/edda.mi5
new file mode 100644
index 00000000..aaf974cf
--- /dev/null
+++ b/bin/edda.mi5
@@ -0,0 +1,21 @@
+# Run ed(1) over multiple files, duplicating stdin.
+self=edda
+
+# Need at least one file
+if [ "$#" -eq 0 ] ; then
+ printf >&2 'edda: Need at least one file\n'
+ exit 2
+fi
+
+<%
+include(`include/mktd.m4')
+%>
+
+# Duplicate stdin into a file
+script=$td/script
+cat >"$script" || exit
+
+# Run ed(1) over each file with the stdin given
+for file ; do
+ ed -- "$file" <"$script"
+done
diff --git a/bin/gwp.awk b/bin/gwp.awk
index 976b5b84..f1e3b3bd 100644
--- a/bin/gwp.awk
+++ b/bin/gwp.awk
@@ -24,7 +24,7 @@ BEGIN {
# Bailout function
function fail(str) {
printf "%s: %s\n", self, str | "cat >&2"
- exit(1)
+ exit(2)
}
# If there's more than one filename, precede the print of the current line with
diff --git a/bin/mi5.awk b/bin/mi5.awk
new file mode 100644
index 00000000..32bac6e9
--- /dev/null
+++ b/bin/mi5.awk
@@ -0,0 +1,47 @@
+# Crude m4 preprocessor
+BEGIN { mac = 0 }
+
+# Print an m4 opener as the first byte
+NR == 1 { printf "`" }
+
+# Blocks
+NF == 1 && $1 == "<%" && !mac {
+ mac = 1
+ printf "'"
+ next
+}
+NF == 1 && $1 == "%>" && mac {
+ mac = 0
+ printf "`"
+ next
+}
+
+# If processing macros, strip leading and trailing whitespace and skip blank
+# lines
+mac {
+ sub(/^ */, "")
+ sub(/ *$/, "")
+}
+mac && !NF { next }
+
+# Inlines
+mac {
+ print $0 "dnl"
+}
+!mac {
+
+ # Don't let apostrophes close the comment
+ gsub(/'/, "''`")
+
+ # Replace m5 opener with m4 closer
+ gsub(/<% */, "'")
+
+ # Replace m5 closer with m4 opener
+ gsub(/ *%>/, "`")
+ print
+}
+
+# Print an m4 closer and newline deleter as the last bytes
+END {
+ print "'dnl"
+}
diff --git a/bin/mw.awk b/bin/mw.awk
new file mode 100644
index 00000000..84332fac
--- /dev/null
+++ b/bin/mw.awk
@@ -0,0 +1,10 @@
+# Crude approach to get alphabetic words one per line from input, not sorted or
+# deduplicated
+BEGIN {
+ RS = "(--|['_-]*[^[:alnum:]'_-]+['_-]*)"
+}
+{
+ for (i = 1; i <= NF; i++)
+ if ($i ~ /[[:alpha:]]/)
+ print $i
+}
diff --git a/bin/osc.sh b/bin/osc.sh
index ba35d9b7..b145b5cd 100644
--- a/bin/osc.sh
+++ b/bin/osc.sh
@@ -17,7 +17,7 @@ serv=${2:-https}
set --
## If we have rlwrap, use it, but don't complain if we don't
if command -v rlwrap >/dev/null 2>&1 ; then
- set -- "$@" rlwrap
+ set -- "$@" rlwrap --history-filename=/dev/null
fi
## The actual openssl(1ssl) and subcommand call
set -- "$@" openssl s_client
diff --git a/bin/p.sh b/bin/p.sh
new file mode 100644
index 00000000..5b59986e
--- /dev/null
+++ b/bin/p.sh
@@ -0,0 +1 @@
+exec cat -- "${@:--}"
diff --git a/bin/pph.sh b/bin/pph.sh
index 268b6ad7..ce516c16 100644
--- a/bin/pph.sh
+++ b/bin/pph.sh
@@ -1,4 +1,5 @@
# Run pp(1df) on args, prefix with machine hostname
hn=$(hostname -s) || exit
-pp "$@" |
-awk -v hn="$hn" '{ print hn ":" $0 }'
+pp "$@" | while IFS= read -r path ; do
+ printf '%s:%s\n' "$hn" "$path"
+done
diff --git a/bin/pst.mi5 b/bin/pst.mi5
new file mode 100644
index 00000000..34ffbd8c
--- /dev/null
+++ b/bin/pst.mi5
@@ -0,0 +1,19 @@
+# Interrupt a pipe with manual /dev/tty input to a program
+self=pst
+
+# Don't accept terminal as stdin
+if [ -t 0 ] ; then
+ printf >&2 '%s: stdin is a term\n' "$self"
+ exit 2
+fi
+
+<%
+include(`include/mktd.m4')
+%>
+
+# Run the interactive command on the temporary file forcing /dev/tty as
+# input/output
+tf=$td/data
+cat - > "$tf" || exit
+"${@:-"${PAGER:-more}"}" "$tf" </dev/tty >/dev/tty
+cat -- "$tf" || exit
diff --git a/bin/pst.sh b/bin/pst.sh
deleted file mode 100644
index fdea9884..00000000
--- a/bin/pst.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# Interrupt a pipe with manual /dev/tty input to a program
-self=pst
-
-# Don't accept terminal as stdin
-if [ -t 0 ] ; then
- printf >&2 '%s: stdin is a term\n' "$self"
- exit 2
-fi
-
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
-
-# Run the interactive command on the temporary file forcing /dev/tty as
-# input/output
-tf=$td/data
-cat - > "$tf" || exit
-"${@:-"${PAGER:-more}"}" "$tf" </dev/tty >/dev/tty
-cat -- "$tf" || exit
diff --git a/bin/rfct.awk b/bin/rfct.awk
index 256841a7..4467f206 100644
--- a/bin/rfct.awk
+++ b/bin/rfct.awk
@@ -6,11 +6,8 @@ BEGIN {
ORS = "\n\n"
}
-{
- # Strip out control characters, except tab and newline
- gsub(/[^[:print:]\n\t]/, "")
+# Strip out control characters, except tab and newline
+{ gsub(/[^[:print:]\n\t]/, "") }
- # If there's anything left, print it
- if (length)
- print
-}
+# If there's anything left, print it
+length($0)
diff --git a/bin/rndl.sh b/bin/rndl.mi5
index 18bcec07..f99ccbea 100644
--- a/bin/rndl.sh
+++ b/bin/rndl.mi5
@@ -7,21 +7,9 @@ self=rndl
# file if we don't want to read all of the input into memory (!)
if [ "$#" -eq 0 ] ; then
- # Create a temporary directory with name in $td, and handle POSIX-ish traps to
- # remove it when the script exits.
- td=
- cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
- }
- for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
- done
- td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# We'll operate on stdin in the temp directory; write the script's stdin to
# it with cat(1)
diff --git a/bin/swr.sh b/bin/swr.mi5
index 47c84b86..9b73b6d6 100644
--- a/bin/swr.sh
+++ b/bin/swr.mi5
@@ -1,21 +1,9 @@
-# Transparently wrap scp(1) targets on the command line
+# Transparently wrap scp(1) targets to read (not write) on the command line
self=swr
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# Set a flag to manage resetting the positional parameters at the start of the
# loop
diff --git a/bin/tlcs.sh b/bin/tlcs.mi5
index f20b160e..a3e17c82 100644
--- a/bin/tlcs.sh
+++ b/bin/tlcs.mi5
@@ -67,21 +67,9 @@ if [ "$((color_count >= 8))" -eq 1 ] ; then
fi
fi
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# Execute the command, passing stdout and stderr to tl(1df) calls as appropriate
# via named pipes
diff --git a/bin/trs.awk b/bin/trs.awk
new file mode 100644
index 00000000..5966c520
--- /dev/null
+++ b/bin/trs.awk
@@ -0,0 +1,36 @@
+# Substitute one string for another in input (no regex)
+BEGIN {
+ # Name self
+ self = "trs"
+
+ # No wordsplitting required
+ FS = ""
+
+ # Two and only two arguments required
+ if (ARGC != 3)
+ fail("Need a string and a replacement")
+
+ # Get arguments and blank them so awk doesn't try to read them as files
+ str = ARGV[1]
+ rep = ARGV[2]
+ ARGV[1] = ARGV[2] = ""
+
+ # String length is relevant here
+ if (!(len = length(str)))
+ fail("String to replace cannot be null")
+}
+
+# Bailout function
+function fail(str) {
+ printf "%s: %s\n", self, str | "cat >&2"
+ exit(2)
+}
+
+# Run on each line
+{
+ lin = ""
+ for (buf = $0; ind = index(buf, str); buf = substr(buf, ind + len))
+ lin = lin substr(buf, 1, ind - 1) rep
+ lin = lin buf
+ print lin
+}
diff --git a/bin/try.sh b/bin/try.mi5
index 20ccbe5f..ea39d717 100644
--- a/bin/try.sh
+++ b/bin/try.mi5
@@ -25,21 +25,9 @@ if [ "$#" -eq 0 ] ; then
exit 2
fi
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# Open a filehandle to the error buffer, just to save on file operations
errbuff=$td/errbuff
diff --git a/bin/urlc.sh b/bin/urlc.mi5
index 0e6530fa..55dac171 100644
--- a/bin/urlc.sh
+++ b/bin/urlc.mi5
@@ -4,21 +4,9 @@ self=urlc
# cURL request timeout
tm=${URLCHECK_TIMEOUT:-8}
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
+<%
+include(`include/mktd.m4')
+%>
# Create buffer files for the headers and body content, to be cleaned up on
# exit
diff --git a/check/login-shell.sh b/check/login-shell.sh
index 20327b94..2972d98d 100644
--- a/check/login-shell.sh
+++ b/check/login-shell.sh
@@ -4,8 +4,6 @@ case ${SHELL##*/} in
target=check-bash ;;
ksh|ksh88|ksh93|mksh|pdksh)
target=check-ksh ;;
- yash)
- target=check-yash ;;
zsh)
target=check-zsh ;;
esac
diff --git a/check/yash.sh b/check/yash.sh
deleted file mode 100644
index c8722f3d..00000000
--- a/check/yash.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-for yash in yash/* ; do
- [ -f "$yash" ] || continue
- yash -n "$yash" || exit
-done
-printf 'All yash scripts parsed successfully.\n'
diff --git a/git/gitconfig.m4 b/git/gitconfig.mi5
index f533f02f..bce64d6c 100644
--- a/git/gitconfig.m4
+++ b/git/gitconfig.mi5
@@ -52,13 +52,13 @@
[sendemail]
confirm = compose
- smtpServer = DF_SENDMAIL
+ smtpServer = <% DF_SENDMAIL %>
[status]
short = true
showUntrackedFiles = all
[user]
- name = DF_NAME
- email = DF_EMAIL
- signingKey = DF_KEY
+ name = <% DF_NAME %>
+ email = <% DF_EMAIL %>
+ signingKey = <% DF_KEY %>
diff --git a/gnupg/gpg.conf.m4 b/gnupg/gpg.conf.mi5
index 29534991..d8f14c09 100644
--- a/gnupg/gpg.conf.m4
+++ b/gnupg/gpg.conf.mi5
@@ -26,7 +26,7 @@ keyserver DF_KEYSERVER
# Retrieve keys automatically; check the keyserver port cert; use whichever
# server is proffered from the pool
-keyserver-options auto-key-retrieve check-cert no-honor-keyserver-url ca-certfile=DF_HOME/.gnupg/sks-keyservers.net/sks-keyservers.netCA.pem
+keyserver-options auto-key-retrieve check-cert no-honor-keyserver-url ca-certfile=<% DF_HOME %>/.gnupg/sks-keyservers.net/sks-keyservers.netCA.pem
# Include trust/validity for UIDs in listings
list-options show-uid-validity
diff --git a/bin/edda.sh b/include/mktd.mi5
index b1d7b27a..388eb9be 100644
--- a/bin/edda.sh
+++ b/include/mktd.mi5
@@ -1,12 +1,3 @@
-# Run ed(1) over multiple files, duplicating stdin.
-self=edda
-
-# Need at least one file
-if [ "$#" -eq 0 ] ; then
- printf >&2 'edda: Need at least one file\n'
- exit 2
-fi
-
# Create a temporary directory with name in $td, and handle POSIX-ish traps to
# remove it when the script exits.
td=
@@ -22,12 +13,3 @@ for sig in EXIT HUP INT TERM ; do
trap "cleanup $sig" "$sig"
done
td=$(mktd "$self") || exit
-
-# Duplicate stdin into a file
-script=$td/script
-cat >"$script" || exit
-
-# Run ed(1) over each file with the stdin given
-for file ; do
- ed -- "$file" <"$script"
-done
diff --git a/install/install-login-shell.sh b/install/install-login-shell.sh
index b7292a77..f38aa0c1 100644
--- a/install/install-login-shell.sh
+++ b/install/install-login-shell.sh
@@ -4,8 +4,6 @@ case ${SHELL##*/} in
target=install-bash ;;
ksh|ksh88|ksh93|mksh|pdksh)
target=install-ksh ;;
- yash)
- target=install-yash ;;
zsh)
target=install-zsh ;;
esac
diff --git a/ksh/shrc.d/ksh.sh b/ksh/shrc.d/ksh.sh
index aa5c4cbc..b591f37c 100644
--- a/ksh/shrc.d/ksh.sh
+++ b/ksh/shrc.d/ksh.sh
@@ -9,7 +9,7 @@
# makes other shells throw tantrums.
# Does the name of our shell have "ksh" in it at all? This is in no way
-# guaranteed. It's just a heuristic that e.g. Bash and Yash shouldn't pass.
+# guaranteed. It's just a heuristic that e.g. Bash shouldn't pass.
case $0 in
*ksh*) ;;
*) return ;;
diff --git a/lint/yash.sh b/lint/yash.sh
deleted file mode 100644
index d783e077..00000000
--- a/lint/yash.sh
+++ /dev/null
@@ -1 +0,0 @@
-find yash -type f -print -exec shellcheck -e SC1090 -s sh -- {} +
diff --git a/man/man1/bcq.1df b/man/man1/bcq.1df
index 55b44a69..64e2048b 100644
--- a/man/man1/bcq.1df
+++ b/man/man1/bcq.1df
@@ -6,7 +6,7 @@
.B bcq
.SH DESCRIPTION
.B bcq
-starts bc(1), checking ~/.cache/bc/quiet to see if a --quiet option is
+starts bc(1), checking ~/.cache/sh/opt/bc/quiet to see if a --quiet option is
available, adding it if so to elide the annoying GNU boilerplate for an
interactive session.
.SH AUTHOR
diff --git a/man/man1/clog.1df b/man/man1/clog.1df
index 0e3e7b87..43193076 100644
--- a/man/man1/clog.1df
+++ b/man/man1/clog.1df
@@ -13,7 +13,7 @@ getting real tired of all this overengineering
receives a message on stdin, timestamps it with a leading date(1), and writes
it to the file with path in environment variable CLOG, defaulting to ~/.clog,
terminating each entry with two hyphens.
-,P
+.P
If rlwrap(1) is found, it will be used for the line editing. If not, just the
terminal's cooked mode will be used.
.SH AUTHOR
diff --git a/man/man1/dam.1df b/man/man1/dam.1df
new file mode 100644
index 00000000..78f5210c
--- /dev/null
+++ b/man/man1/dam.1df
@@ -0,0 +1,16 @@
+.TH DAM 1df "May 2017" "Manual page for dam"
+.SH NAME
+.B dam
+\- read all input before emitting as output
+.SH SYNOPSIS
+prog1 |
+.B
+dam
+| prog2
+.SH DESCRIPTION
+.B dam
+buffers all its input before emitting it as output. Useful if you don't
+actually want a line-by-line flow between programs, such as pasting a complete
+document into a sed(1) pipeline on the terminal.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/edda.1df b/man/man1/edda.1df
index c501e571..8c71f3ec 100644
--- a/man/man1/edda.1df
+++ b/man/man1/edda.1df
@@ -8,20 +8,20 @@
Duplicate any data on stdin into a temporary file, and run ed(1) options over
each of the files given as arguments. Example:
.P
- $ edda /etc/app.d/*.conf <<'EOF'
- ,s/foo/bar/g
- w
- EOF
+ $ edda /etc/app.d/*.conf <<'EOF'
+ ,s/foo/bar/g
+ w
+ EOF
.SH WISDOM
-"Each man who is wise and would wise be called,
+ Each man who is wise and would wise be called,
.br
- Must ask and answer aright.
+ Must ask and answer aright.
.br
- Let one know thy secret, but never a second;
+ Let one know thy secret, but never a second;
.br
- If three, a thousand shall know."
+ If three, a thousand shall know."
.P
- -- Poetic Edda, Hávamál, 63
+ -- Poetic Edda, Hávamál, 63
.br
.SH SEE ALSO
ed(1)
diff --git a/man/man1/fgscr.1df b/man/man1/fgscr.1df
index 80da3798..cc273b89 100644
--- a/man/man1/fgscr.1df
+++ b/man/man1/fgscr.1df
@@ -5,7 +5,8 @@
.SH SYNOPSIS
.B fgscr
.br
-.B fgscr /path1 /path2
+.B fgscr
+/path1 /path2
.SH DESCRIPTION
.B fgscr
searches for Git repositories recursively with the given ancestor directory
diff --git a/man/man1/fnl.1df b/man/man1/fnl.1df
index 6c34f19c..d085df6b 100644
--- a/man/man1/fnl.1df
+++ b/man/man1/fnl.1df
@@ -1,7 +1,7 @@
.TH FNL 1df "August 2016" "Manual page for fnl"
.SH NAME
.B fnl
-\- list the biggest files in the given directory
+\- run a command and put stdout and stderr into temporary files
.SH SYNOPSIS
.B fnl
command arg1 ...
diff --git a/man/man1/mi5.1df b/man/man1/mi5.1df
new file mode 100644
index 00000000..7fb41078
--- /dev/null
+++ b/man/man1/mi5.1df
@@ -0,0 +1,57 @@
+.TH MI5 1df "June 2017" "Manual page for mi5"
+.SH NAME
+.B mi5
+\- m4 inverted preprocessor
+.SH SYNOPSIS
+.B mi5
+FILE > out.m4
+.br
+.B mi5
+FILE1 FILE2 > out.m4
+.br
+prog |
+.B mi5 > out.m4
+.br
+.SH DESCRIPTION
+.B mi5
+is a simple and crude m4 preprocessor to make using m4 slightly more bearable
+and predictable for its author, who wants badly to like m4 but doesn't. It's
+primarily intended for situations where the majority of a file is simple static
+text, and only a few simple macros need to be defined and expanded, which
+covers almost every usage case for the author. It's written to work with any
+POSIX m4.
+.P
+mi5 inverts m4's usual approach by approaching most of the file as if it were
+part of an m4 quote, with <% and %> as the delimiters to specify markers in
+which macro expansion should occur. This makes m4 work in a way reminiscent of
+templating libraries or languages like PHP.
+.P
+Macros can be expanded as blocks:
+.P
+ <%
+ define(`FOO', `bar')
+ define(`BAZ', include(`include/quux.inc')
+ ?>
+.P
+For this format, "dnl" macros to delete newlines for each declaration are
+inserted for you. Blank lines are skipped, and leading and trailing spaces are
+ignored. The above code therefore produces no actual output, as it only has two
+define calls.
+.P
+For inline expansion, the syntax is similar, but the behaviour slightly different:
+.P
+ The value of the FOO macro is <% FOO %>.
+.P
+Spaces immediately after the opening delimiter and before the closing delimiter
+are ignored, but spaces produced within the macro are preserved.
+.P
+Ideally, you do macro definition in an mi5 block at the top of your file, and
+very simple macro expansion in an mi5 inline.
+.SH CAVEATS
+Only very simple macro expansions work in inline calls at the moment. This can
+be fixed by the author tokenizing the line properly, which he'll do Real Soon
+Now (TM). Specifically, quote delimiters do not work.
+.SH SEE ALSO
+bp(1df), xargs(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/mw.1df b/man/man1/mw.1df
new file mode 100644
index 00000000..51623600
--- /dev/null
+++ b/man/man1/mw.1df
@@ -0,0 +1,25 @@
+.TH MW 1df "May 2017" "Manual page for mw"
+.SH NAME
+.B mw
+\- get space-delimited alphabetic words from input, one per line
+.SH SYNOPSIS
+.B mw FILE1
+[FILE2...]
+.br
+prog1 |
+.B mw
+.SH DESCRIPTION
+.B mw
+separates the input into space-delimited words and prints them one per line,
+with no deduplication or sorting. It's a fairly naïve approach to the problem
+but it works fine as a crude initial approach.
+.SH NOTES
+This was written after watching that lovely old AT&T video where members of the
+Unix team (specifically Brian Kernighan and Lorinda Cherry) demonstrate piping
+programs together; Kernighan demonstrates `makewords` during his example.
+.P
+<https://www.youtube.com/watch?v=tc4ROCJYbm0&t=5m30s>
+.SH SEE ALSO
+ddup(1df), sort(1), uniq(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/p.1df b/man/man1/p.1df
new file mode 100644
index 00000000..2f9f3c45
--- /dev/null
+++ b/man/man1/p.1df
@@ -0,0 +1,44 @@
+.TH P 1df "May 2017" "Manual page for p"
+.SH NAME
+.B p
+\- print standard input to standard output
+.SH SYNOPSIS
+.B p
+FILE1 [FILE2...]
+.br
+prog1 |
+.B
+p
+.br
+prog1 |
+.B
+p
+FILE1 - FILE2
+.SH DESCRIPTION
+.B p
+prints concatenated standard input from files to standard output, and nothing
+else; cat(1) as it always should have been--no flags, and hence no need for
+end-of-options for filenames that start with a dash.
+.P
+Quicker to type, too.
+.P
+Still treats an "-" argument as a shorthand for "standard input" though,
+because I like that and it's POSIX.
+.SH POETRY
+ "Prophet!" said I, "thing of evil!--prophet still, if bird or devil!--
+.br
+ Whether Tempter sent, or whether tempest tossed thee here ashore,
+.br
+ Desolate yet all undaunted, on this desert land enchanted--
+.br
+ On this home by Horror haunted--tell me truly, I implore--
+.br
+ Is there--is there balm in Gilead?--tell me--tell me, I implore!"
+.br
+ Quoth the Raven "Nevermore."
+.P
+ -- Poe
+.SH SEE ALSO
+cat(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/pp.1df b/man/man1/pp.1df
index 322e7b48..0bb55cd1 100644
--- a/man/man1/pp.1df
+++ b/man/man1/pp.1df
@@ -15,5 +15,7 @@ The path need not actually exist.
Newlines in filenames will still work, but the results won't really make sense
as they'll be indistinguishable from newlines separating the files. This is for
generating human-readable file lists, not for machines.
+.SH SEE ALSO
+pph(1df)
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/pph.1df b/man/man1/pph.1df
index 0ad98fc5..f68b394d 100644
--- a/man/man1/pph.1df
+++ b/man/man1/pph.1df
@@ -1,9 +1,9 @@
-.TH PPH 1df "January 2017" "Manual page for pp"
+.TH PPH 1df "January 2017" "Manual page for pph"
.SH NAME
-.B pp
+.B pph
\- print the full path to each argument, hostname prepended
.SH SYNOPSIS
-.B pp
+.B pph
/arg arg2 ./arg3
.SH DESCRIPTION
.B pph
@@ -12,5 +12,7 @@ prepends the machine's hostname and a colon to each line.
.SH CAVEATS
Newlines in filenames will mess this up. This is for generating human-readable
file lists, not for machines.
+.SH SEE ALSO
+pp(1df)
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/pvi.1df b/man/man1/pvi.1df
index 990ea589..6a21e6e8 100644
--- a/man/man1/pvi.1df
+++ b/man/man1/pvi.1df
@@ -1,4 +1,4 @@
-.TH PED 1df "May 2017" "Manual page for pvi"
+.TH PVI 1df "May 2017" "Manual page for pvi"
.SH NAME
.B pvi
\- stop a pipe for $EDITOR intervention
diff --git a/man/man1/swr.1df b/man/man1/swr.1df
index 8792b0ed..4c40a6f0 100644
--- a/man/man1/swr.1df
+++ b/man/man1/swr.1df
@@ -1,7 +1,7 @@
.TH SWR 1df "January 2017" "Manual page for swr"
.SH NAME
.B swr
-\- run a command including remote file arguments for scp(1) retrieval
+\- run a command including remote file arguments for scp(1) reading
.SH SYNOPSIS
.B swr
cat remote:.ssh/authorized_keys
@@ -18,6 +18,9 @@ circumstances.
This even works for the first argument (i.e. the command), provided that it
will run on the local system once copied in.
.SH CAVEATS
+You can't write to remote files with it. The arguments only work as input
+streams, so e.g. "cp .vimrc remote:.vimrc" won't do what you expect.
+.P
This only works for simple commands; you can't put shell syntax into any of the
arguments.
.P
diff --git a/man/man1/trs.1df b/man/man1/trs.1df
new file mode 100644
index 00000000..fa5d2d19
--- /dev/null
+++ b/man/man1/trs.1df
@@ -0,0 +1,23 @@
+.TH TRS 1df "May 2017" "Manual page for trs"
+.SH NAME
+.B trs
+\- string version of tr(1)
+.SH SYNOPSIS
+.B trs
+STRING REPLACEMENT
+< file
+.br
+program |
+.B trs
+STRING REPLACEMENT
+.SH DESCRIPTION
+.B trs
+replaces the string given in its first argument with the string given in its
+second, with no regex metacharacters, in a way that should work on all POSIX
+implementations. It is thereby the string complement for tr(1).
+.P
+The first argument cannot be a null string. The second argument can be blank
+(but must still be specified) to implicitly delete all occurrences of the
+string.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/mysql/my.cnf b/mysql/my.cnf
index e0df3c23..900cf1a9 100644
--- a/mysql/my.cnf
+++ b/mysql/my.cnf
@@ -3,3 +3,4 @@ default-character-set=utf8
no-auto-rehash
prompt='(\u@\h:\d) mysql> '
safe-updates
+skip-pager
diff --git a/sh/profile.d/downloads.sh b/sh/profile.d/downloads.sh
new file mode 100644
index 00000000..fb8dd64a
--- /dev/null
+++ b/sh/profile.d/downloads.sh
@@ -0,0 +1,28 @@
+# Only if shell is interactive
+case $- in
+ *i*) ;;
+ *) return ;;
+esac
+
+# Only if not in a tmux window
+[ -z "$TMUX" ] || return
+
+# Not if ~/.hushlogin exists
+[ -e "$HOME"/.hushlogin ] && return
+
+# Not if ~/.downloads doesn't
+[ -f "$HOME"/.downloads ] || return
+
+# Count files in each directory, report if greater than zero
+(
+ while IFS= read -r dir ; do
+ case $dir in
+ '#'*) continue ;;
+ esac
+ [ -d "$dir" ] || continue
+ set -- "$dir"/*
+ [ -e "$1" ] || shift
+ [ "$#" -gt 0 ] || continue
+ printf '\nYou have %u unsorted files in %s.\n\n' "$#" "$dir"
+ done < "$HOME"/.downloads
+)
diff --git a/sh/shrc.d/ad.sh b/sh/shrc.d/ad.sh
deleted file mode 100644
index 55866683..00000000
--- a/sh/shrc.d/ad.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-# Find an abbreviated path
-ad() {
-
- # Check argument count
- if [ "$#" -ne 1 ] ; then
- printf >&2 'ad(): Need just one argument\n'
- return 2
- fi
-
- # Change the positional parameters from the abbreviated request
- # to any matched directory
- set -- "$(
-
- # Clean up and anchor the request
- req=${1%/}/
- case $req in
- (/*) ;;
- (*) req=${PWD%/}/${req#/} ;;
- esac
-
- # Start building the target directory; go through the request piece by
- # piece until it is used up
- dir=
- while [ -n "$req" ] ; do
-
- # Chop the next front bit off the request and add it to the dir
- dir=${dir%/}/${req%%/*}
- req=${req#*/}
-
- # If that exists, all is well and we can keep iterating
- [ -d "$dir" ] && continue
-
- # Set the positional parameters to a glob expansion of the
- # abbreviated directory given
- set -- "$dir"*
-
- # Iterate through the positional parameters filtering out
- # directories; we need to run right through the whole list to check
- # that we have at most one match
- entd=
- for ent ; do
- [ -d "$ent" ] || continue
-
- # If we already found a match and have found another one, bail
- # out
- if [ -n "$entd" ] ; then
- printf >&2 'ad(): More than one matching dir for %s*:\n' \
- "$dir"
- printf >&2 '%s\n' "$@"
- exit 1
- fi
-
- # Otherwise, this can be our first one
- entd=$ent
- done
-
- # If we found no match, bail out
- if [ -z "$entd" ] ; then
- printf >&2 'ad(): No matching dirs: %s*\n' "$dir"
- exit 1
- fi
-
- # All is well, tack on what we have found and keep going
- dir=$entd
-
- done
-
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${dir%/}"
- )"
-
- # Remove trailing slash
- set -- "${1%/}"
-
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
-
- # Try to change into the determined directory
- command cd -- "$@"
-}
diff --git a/sh/shrc.d/bd.sh b/sh/shrc.d/bd.sh
index bf64a9aa..29bde513 100644
--- a/sh/shrc.d/bd.sh
+++ b/sh/shrc.d/bd.sh
@@ -1,70 +1,47 @@
# Move back up the directory tree to the first directory matching the name
bd() {
- # Check argument count
+ # Check arguments; default to ".."
if [ "$#" -gt 1 ] ; then
- printf >&2 'bd(): Too many arguments'
+ printf >&2 'bd(): Too many arguments\n'
return 2
fi
-
- # Set positional parameters to an option terminator and what will hopefully
- # end up being a target directory
- set -- "$(
-
- # The requested pattern is the first argument, defaulting to just the
- # parent directory
- req=${1:-..}
-
- # Strip trailing slashes if a trailing slash is not the whole pattern
- [ "$req" = / ] || req=${req%/}
-
- # What to do now depends on the request
- case $req in
-
- # Just go straight to the root or dot directories if asked
- (/|.|..)
- dirname=$req
- ;;
-
- # Anything with a leading / needs to anchor to the start of the
- # path. A strange request though. Why not just use cd?
- (/*)
- dirname=$req
- case $PWD in
- ("$dirname"/*) ;;
- (*) dirname='' ;;
+ set -- "${1:-..}"
+
+ # Look at argument given; default to going up one level
+ case $1 in
+
+ # If it's slash, dot, or dot-dot, we'll just go there, like `cd` would
+ /|.|..) ;;
+
+ # Anything else with a slash anywhere is an error
+ */*)
+ printf >&2 'bd(): Illegal slash\n'
+ return 2
+ ;;
+
+ # Otherwise, add and keep chopping at the current directory until it's
+ # empty or it matches the request, then shift the request off
+ *)
+ set -- "$1" "$PWD"
+ while : ; do
+ case $2 in
+ */"$1"|'') break ;;
+ */) set -- "$1" "${2%/}" ;;
+ */*) set -- "$1" "${2%/*}" ;;
+ *) set -- "$1" '' ;;
esac
- ;;
-
- # In all other cases, iterate through the PWD to find a match, or
- # whittle the target down to an empty string trying
- (*)
- dirname=$PWD
- while [ -n "$dirname" ] ; do
- dirname=${dirname%/*}
- case $dirname in
- (*/"$req") break ;;
- esac
- done
- ;;
- esac
-
- # Check we have a target after all that
- if [ -z "$dirname" ] ; then
- printf >&2 'bd(): Directory name not in path\n'
- exit 1
- fi
-
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${dirname%/}"
- )"
-
- # Remove trailing slash
- set -- "${1%/}"
-
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
+ done
+ shift
+ ;;
+ esac
+
+ # If we have nothing to change into, there's an error
+ if [ -z "$1" ] ; then
+ printf >&2 'bd(): No match\n'
+ return 1
+ fi
- # Try to change into the determined directory
- command cd -- "$@"
+ # We have a match; try and change into it
+ command cd -- "$1"
}
diff --git a/sh/shrc.d/gd.sh b/sh/shrc.d/gd.sh
index fa5776f2..9f6a43e7 100644
--- a/sh/shrc.d/gd.sh
+++ b/sh/shrc.d/gd.sh
@@ -8,7 +8,7 @@ gd() {
fi
# Complain if mark not actually set yet
- if ! [ -n "$PMD" ] ; then
+ if [ -z "$PMD" ] ; then
printf >&2 'gd(): Mark not set\n'
return 1
fi
diff --git a/sh/shrc.d/gt.sh b/sh/shrc.d/gt.sh
index d18a4ab8..95ab4c2f 100644
--- a/sh/shrc.d/gt.sh
+++ b/sh/shrc.d/gt.sh
@@ -3,26 +3,24 @@
gt() {
# Check argument count
- if [ "$#" -gt 1 ] ; then
- printf >&2 'gd(): Too many arguments\n'
+ if [ "$#" -ne 1 ] ; then
+ printf >&2 'gt(): Need one argument\n'
return 2
fi
- # Strip trailing slash
- set -- "${1%/}"
-
- # If target doesn't have a leading slash, add PWD prefix
- case $1 in
- /*) ;;
- *) set -- "${PWD%/}"/"$1"
- esac
+ # Make certain there are no trailing slashes to foul us up, and anchor path
+ # if relative
+ while : ; do
+ case $1 in
+ */) set -- "${1%/}" ;;
+ /*) break ;;
+ *) set -- "$PWD"/"$1" ;;
+ esac
+ done
# If target isn't a directory, chop to its parent
[ -d "$1" ] || set -- "${1%/*}"
- # If target is now empty, go to the root
- [ -n "$1" ] || set -- /
-
- # Try to change into the determined directory
- command cd -- "$@"
+ # Try to change into the determined directory, or root if empty
+ command cd -- "${1:-/}"
}
diff --git a/sh/shrc.d/hgrep.sh b/sh/shrc.d/hgrep.sh
index 1c4c3ec5..fe297ab3 100644
--- a/sh/shrc.d/hgrep.sh
+++ b/sh/shrc.d/hgrep.sh
@@ -6,11 +6,11 @@
hgrep() {
if [ "$#" -eq 0 ] ; then
printf >&2 'hgrep(): Need a pattern\n'
- exit 2
+ return 2
fi
- if ! [ -n "$HISTFILE" ] ; then
+ if [ -z "$HISTFILE" ] ; then
printf >&2 'hgrep(): No HISTFILE\n'
- exit 2
+ return 2
fi
grep "$@" "$HISTFILE"
}
diff --git a/sh/shrc.d/mysql.sh b/sh/shrc.d/mysql.sh
deleted file mode 100644
index abb496d2..00000000
--- a/sh/shrc.d/mysql.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-# If a file ~/.mysql/$1.cnf exists, call mysql(1) using that file, discarding
-# the rest of the arguments. Otherwise just run MySQL with given args. Use
-# restrictive permissions on these files. Doesn't allow filenames beginning
-# with hyphens.
-#
-# Examples:
-#
-# [client]
-# host=dbhost.example.com
-# user=foo
-# password=SsJ2pICe226jM
-#
-# [mysql]
-# database=bar
-#
-mysql() {
- case $1 in
- -*) ;;
- *)
- [ -f "$HOME/.mysql/$1".cnf ] &&
- set -- --defaults-extra-file="$HOME/.mysql/$1".cnf
- ;;
- esac
- command mysql "$@"
-}
diff --git a/sh/shrc.d/pd.sh b/sh/shrc.d/pd.sh
index ce43837b..e3a6daaa 100644
--- a/sh/shrc.d/pd.sh
+++ b/sh/shrc.d/pd.sh
@@ -2,39 +2,30 @@
# use when you've got a file path in a variable, or in history, or in Alt+.,
# and want to quickly move to its containing directory. In the absence of an
# argument, this just shifts up a directory, i.e. `cd ..`
+#
+# Note this is equivalent to `ud 1`.
pd() {
- # Check argument count
+ # Check arguments; default to $PWD
if [ "$#" -gt 1 ] ; then
printf >&2 'pd(): Too many arguments\n'
return 2
fi
-
- # Change the positional parameters from the target to its containing
- # directory
- set -- "$(
-
- # Figure out target dirname
- dirname=${1:-..}
- dirname=${dirname%/}
- dirname=${dirname%/*}
-
- # Check we have a target after that
- if [ -z "$dirname" ] ; then
- printf >&2 'ud(): Destination construction failed\n'
- exit 1
- fi
-
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${dirname%/}"
- )"
-
- # Remove trailing slash
- set -- "${1%/}"
-
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
-
- # Try to change into the determined directory
- command cd -- "$@"
+ set -- "${1:-"$PWD"}"
+
+ # Make certain there are no trailing slashes to foul us up, and anchor path
+ # if relative
+ while : ; do
+ case $1 in
+ */) set -- "${1%/}" ;;
+ /*) break ;;
+ *) set -- "$PWD"/"$1" ;;
+ esac
+ done
+
+ # Strip a path element
+ set -- "${1%/*}"
+
+ # Try to change into the determined directory, or root if empty
+ command cd -- "${1:-/}"
}
diff --git a/sh/shrc.d/pmd.sh b/sh/shrc.d/pmd.sh
index c96a50bd..4b0cd5bd 100644
--- a/sh/shrc.d/pmd.sh
+++ b/sh/shrc.d/pmd.sh
@@ -1,6 +1,6 @@
# Print the marked directory
pmd() {
- if ! [ -n "$PMD" ] ; then
+ if [ -z "$PMD" ] ; then
printf >&2 'pmd(): Mark not set\n'
return 1
fi
diff --git a/sh/shrc.d/rd.sh b/sh/shrc.d/rd.sh
index 3b699c0d..9633713a 100644
--- a/sh/shrc.d/rd.sh
+++ b/sh/shrc.d/rd.sh
@@ -1,4 +1,3 @@
-#
# Replace the first instance of the first argument string with the second
# argument string in $PWD, and make that the target of the cd builtin. This is
# to emulate a feature of the `cd` builtin in Zsh that I like, but that I think
@@ -12,7 +11,6 @@
# $ rd usr opt
# $ pwd
# /opt/bin
-#
rd() {
# Check argument count
@@ -25,42 +23,17 @@ rd() {
;;
esac
- # Set the positional parameters to an option terminator and what will
- # hopefully end up being the substituted directory name
- set -- "$(
-
- # Current path: e.g. /foo/ayy/bar/ayy
- cur=$PWD
- # Pattern to replace: e.g. ayy
- pat=$1
- # Text with which to replace pattern: e.g. lmao
- # This can be a null string or unset, in order to *remove* the pattern
- rep=$2
-
- # /foo/
- curtc=${cur%%"$pat"*}
- # /bar/ayy
- curlc=${cur#*"$pat"}
- # /foo/lmao/bar/ayy
- new=${curtc}${rep}${curlc}
-
- # Check that a substitution resulted in an actual change and that we
- # ended up with a non-null target, or print an error to stderr
- if [ "$cur" = "$curtc" ] || [ -z "$new" ] ; then
+ # Check there's something to substitute, and do it
+ case $PWD in
+ *"$1"*)
+ set -- "${PWD%%"$1"*}""$2""${PWD#*"$1"}"
+ ;;
+ *)
printf >&2 'rd(): Substitution failed\n'
- exit 1
- fi
-
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${new%/}"
- )"
-
- # Remove trailing slash
- set -- "${1%/}"
-
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
+ return 1
+ ;;
+ esac
# Try to change into the determined directory
- command cd -- "$@"
+ command cd -- "$1"
}
diff --git a/sh/shrc.d/sd.sh b/sh/shrc.d/sd.sh
index 4d63b7d6..8b12c170 100644
--- a/sh/shrc.d/sd.sh
+++ b/sh/shrc.d/sd.sh
@@ -1,4 +1,3 @@
-#
# Shortcut to switch to another directory with the same parent, i.e. a sibling
# of the current directory.
#
@@ -31,7 +30,6 @@
# /tmp/tmp.ZSunna5Eup/a
#
# Seems to work for symbolic links.
-#
sd() {
# Check argument count
@@ -40,48 +38,80 @@ sd() {
return 2
fi
- # Change positional parameters to what will hopefully be a completed
- # substitution
- set -- "$(
+ # Read sole optional argument
+ case $1 in
+
+ # Slashes aren't allowed
+ */*)
+ printf >&2 'bd(): Illegal slash\n'
+ return 2
+ ;;
+
+ # If blank, we try to find if there's just one sibling, and change to
+ # that if so
+ '')
+ # First a special case: root dir
+ case $PWD in
+ *[!/]*) ;;
+ *)
+ printf >&2 'sd(): No siblings\n'
+ return 1
+ ;;
+ esac
+
+ # Get a full list of directories at this level; include dotfiles,
+ # but not the . and .. entries, using glob tricks to avoid Bash
+ # ruining things with `dotglob`
+ set -- ../[!.]*/
+ [ -e "$1" ] || shift
+ set -- ../.[!.]*/ "$@"
+ [ -e "$1" ] || shift
+ set -- ../..?*/ "$@"
+ [ -e "$1" ] || shift
+
+ # Check the number of matches
+ case $# in
+
+ # One match? Must be $PWD, so no siblings--throw in 0 just in
+ # case, but that Shouldn't Happen (TM)
+ 0|1)
+ printf >&2 'sd(): No siblings\n'
+ return 1
+ ;;
- # Set the positional parameters to either the requested directory, or
- # all siblings of the current directory if no request
- spec=$1
- set --
- if [ -n "$spec" ] ; then
- set -- "$@" ../"$spec"
- else
- for sib in ../.* ../* ; do
- case ${sib#../} in
- (.|..|"${PWD##*/}") continue ;;
- esac
- set -- "$@" "$sib"
- done
- fi
+ # Two matches; hopefully just one sibling, but which is it?
+ 2)
- # We should have exactly one sibling
- case $# in
- (1) ;;
- (0)
- printf >&2 'sd(): No siblings\n'
- exit 1
- ;;
- (*)
- printf >&2 'sd(): More than one sibling\n'
- exit 1
- ;;
- esac
+ # Push PWD onto the stack, strip trailing slashes
+ set -- "$1" "$2" "$PWD"
+ while : ; do
+ case $3 in
+ */) set -- "$1" "$2" "${3%/}" ;;
+ *) break ;;
+ esac
+ done
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${1%/}"
- )"
+ # Pick whichever of our two parameters doesn't look like
+ # PWD as our sole parameter
+ case $1 in
+ ../"${3##*/}"/) set -- "$2" ;;
+ *) set -- "$1" ;;
+ esac
+ ;;
- # Remove trailing slash
- set -- "${1%/}"
+ # Anything else? Multiple siblings--user will need to specify
+ *)
+ printf >&2 'sd(): Multiple siblings\n'
+ return 1
+ ;;
+ esac
+ ;;
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
+ # If not, simply set our target to that directory, and let `cd` do the
+ # complaining if it doesn't exist
+ *) set -- ../"$1" ;;
+ esac
- # Try to change into the determined directory
- command cd -- "$@"
+ # Try and change into the first parameter
+ command cd -- "$1"
}
diff --git a/sh/shrc.d/ud.sh b/sh/shrc.d/ud.sh
index 79f4b5e7..06234569 100644
--- a/sh/shrc.d/ud.sh
+++ b/sh/shrc.d/ud.sh
@@ -2,48 +2,45 @@
# like cd .., cd ../.., etc
ud() {
- # Check argument count
- if [ "$#" -gt 1 ] ; then
+ # Check arguments; default to 1 and $PWD
+ if [ "$#" -gt 2 ] ; then
printf >&2 'ud(): Too many arguments\n'
return 2
fi
+ set -- "${1:-1}" "${2:-"$PWD"}"
- # Check first argument, number of steps upward, default to 1.
- # "0" is weird, but valid; "-1" however makes no sense at all
- if [ "${1:-1}" -lt 0 ] ; then
+ # Check first argument, number of steps upward. "0" is weird, but valid;
+ # "-1" however makes no sense at all
+ if [ "$1" -lt 0 ] ; then
printf >&2 'ud(): Invalid step count\n'
return 2
fi
- # Change the positional parameters from the number of steps given to a
- # "../../.." string
- set -- "$(
-
- # Append /.. to the target (default PWD) the specified number of times
- dirname=${2:-"$PWD"}
- i=0
- steps=${1:-1}
- while [ "$i" -lt "$steps" ] ; do
- dirname=${dirname%/}/..
- i=$((i+1))
+ # Check second argument, starting path, for relativity and anchor it if
+ # need be
+ case $2 in
+ /*) ;;
+ *) set -- "$1" "$PWD"/"$2" ;;
+ esac
+
+ # Chop an element off the target the specified number of times
+ while [ "$1" -gt 0 ] ; do
+
+ # Make certain there are no trailing slashes to foul us up
+ while : ; do
+ case $2 in
+ */) set -- "$1" "${2%/}" ;;
+ *) break ;;
+ esac
done
- # Check we have a target after all that
- if [ -z "$dirname" ] ; then
- printf >&2 'ud(): Destination construction failed\n'
- exit 1
- fi
+ # Strip a path element
+ set -- "$(($1-1))" "${2%/*}"
+ done
- # Print the target with trailing slash to work around newline stripping
- printf '%s/' "${dirname%/}"
- )"
+ # Shift off the count, which should now be zero
+ shift
- # Remove trailing slash
- set -- "${1%/}"
-
- # If the subshell printed nothing, return with failure
- [ -n "$1" ] || return
-
- # Try to change into the determined directory
- command cd -- "$@"
+ # Try to change into the determined directory, or the root if blank
+ command cd -- "${1:-/}"
}
diff --git a/tmux/tmux.conf.m4 b/tmux/tmux.conf.mi5
index ffac0243..76d493c1 100644
--- a/tmux/tmux.conf.m4
+++ b/tmux/tmux.conf.mi5
@@ -41,6 +41,8 @@ bind-key Tab last-pane
# Use the vi mode for tmux interaction behaviour in copy and choice modes
set-window-option -g mode-keys vi
+bind-key -T copy-mode-vi v send -X begin-selection
+bind-key -T copy-mode-vi y send -X copy-selection-and-cancel
# Detach with Alt-M, no prefix required
bind-key -n M-m detach
@@ -108,15 +110,15 @@ set-option -g message-style "bg=colour18,fg=colour231"
set-window-option -g mode-style "bg=colour18,fg=colour231"
# Pane borders are always in the background color
-set-option -g pane-border-style "fg=DF_TMUX_BG"
-set-option -g pane-active-border-style "fg=DF_TMUX_BG"
+set-option -g pane-border-style "fg=<% DF_TMUX_BG %>"
+set-option -g pane-active-border-style "fg=<% DF_TMUX_BG %>"
# Inactive windows have slightly washed-out system colours
set-option -g window-style "bg=colour232,fg=colour248"
set-option -g window-active-style "bg=colour0,fg=colour15"
# The status bar has the defined background and foreground colours
-set-option -g status-style "bg=DF_TMUX_BG,fg=DF_TMUX_FG"
+set-option -g status-style "bg=<% DF_TMUX_BG %>,fg=<% DF_TMUX_FG %>"
# Titles of windows default to black text with no embellishment
set-window-option -g window-status-style "fg=colour16"
diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen
-Subproject 0f4710063ecc98d77dc03698c4a917a3215bdf0
+Subproject ddfb1f14d7597e6aedc749be06b559a673c437a
diff --git a/vim/bundle/unimpaired b/vim/bundle/unimpaired
-Subproject 0f72c70b672aeadaaab94e430267b1435c1b244
+Subproject 7bbbca73233b1492a8c3d16f91f34340eccc9b3
diff --git a/yash/yash_profile b/yash/yash_profile
deleted file mode 100644
index d37f35a1..00000000
--- a/yash/yash_profile
+++ /dev/null
@@ -1,2 +0,0 @@
-# Load ~/.profile, because Yash won't by itself, no matter how you invoke it
-[ -e "$HOME"/.profile ] && . "$HOME"/.profile
diff --git a/yash/yashrc b/yash/yashrc
deleted file mode 100644
index c2b2df26..00000000
--- a/yash/yashrc
+++ /dev/null
@@ -1,14 +0,0 @@
-# Clear away all aliases; we do this here rather than in $ENV because the ksh
-# family of shells relies on aliases to implement certain POSIX utilities like
-# fc(1) and type(1)
-unalias -a
-
-# Load POSIX interactive shell startup files, because Yash won't do it if not
-# invoked as sh(1)
-[ -e "$ENV" ] && . "$ENV"
-
-# Load Bash-specific startup files
-for sh in "$HOME"/.yashrc.d/*.yash ; do
- [ -e "$sh" ] && . "$sh"
-done
-unset -v sh
diff --git a/yash/yashrc.d/ver.yash b/yash/yashrc.d/ver.yash
deleted file mode 100644
index 8bd06e4d..00000000
--- a/yash/yashrc.d/ver.yash
+++ /dev/null
@@ -1,4 +0,0 @@
-# Shortcut to show current shell version
-ver() {
- printf '%s\n' "${YASH_VERSION:-unknown}"
-}