aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--ISSUES.markdown7
-rw-r--r--Makefile3
-rw-r--r--README.markdown9
-rw-r--r--bash/bash_completion.d/awk.bash1
-rw-r--r--bash/bash_completion.d/cat.bash1
-rw-r--r--bash/bash_completion.d/ed.bash1
-rw-r--r--bash/bash_completion.d/ex.bash1
-rw-r--r--bash/bash_completion.d/git.bash238
-rw-r--r--bash/bash_completion.d/grep.bash1
-rw-r--r--bash/bash_completion.d/head.bash1
-rw-r--r--bash/bash_completion.d/m4.bash1
-rw-r--r--bash/bash_completion.d/sed.bash1
-rw-r--r--bash/bash_completion.d/source.bash1
-rw-r--r--bash/bash_completion.d/tail.bash1
-rw-r--r--bash/bash_completion.d/vi.bash1
-rw-r--r--bash/bash_completion.d/view.bash1
-rw-r--r--bash/bash_completion.d/vim.bash1
-rw-r--r--bash/bashrc8
-rwxr-xr-xbin/gms6
-rwxr-xr-xbin/hurl2
-rw-r--r--bin/mean.awk2
-rw-r--r--bin/med.awk2
-rw-r--r--bin/mode.awk2
-rwxr-xr-xbin/slow4
-rwxr-xr-xbin/spr2
-rwxr-xr-xbin/supp4
-rw-r--r--bin/tot.awk2
-rwxr-xr-xbin/urlc1
-rwxr-xr-xbin/xgo2
-rwxr-xr-xgames/rot13.sed3
-rw-r--r--git/gitconfig.m43
-rw-r--r--man/man1/mean.1df4
-rw-r--r--man/man1/med.1df4
-rw-r--r--man/man1/mode.1df4
-rw-r--r--man/man1/sd2u.1df1
-rw-r--r--man/man1/slow.1df20
-rw-r--r--man/man1/supp.1df20
-rw-r--r--man/man1/tot.1df2
-rw-r--r--man/man6/rot13.6df21
-rw-r--r--man/man7/dotfiles.7df.header2
-rw-r--r--mutt/muttrc.m46
-rw-r--r--readline/inputrc11
-rw-r--r--sh/shrc.d/ls.sh4
-rw-r--r--vim/vimrc5
45 files changed, 356 insertions, 62 deletions
diff --git a/.gitignore b/.gitignore
index bab3eb65..1e9e814f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ bin/tot
bin/unf
games/acq
games/kvlt
+games/rot13
games/zs
git/gitconfig
gnupg/gpg.conf
diff --git a/ISSUES.markdown b/ISSUES.markdown
index 3ff20fff..4a49c9d4 100644
--- a/ISSUES.markdown
+++ b/ISSUES.markdown
@@ -15,3 +15,10 @@ Known issues
* A key binding for importing sections of the screen and optionally uploading
it would be great, probably using ImageMagick import(1)
* sxhkd(1) might be nicer than xbindkeys; it's in Debian Testing now
+* New Git completion failing on 2.05a:
+
+ ~$ ssh ancientbox
+ bash: complete: bashdefault: invalid option name
+ tom@ancientbox:~$ bash --version
+ GNU bash, version 2.05a.0(1)-release (i386-pc-linux-gnu)
+ Copyright 2001 Free Software Foundation, Inc.
diff --git a/Makefile b/Makefile
index 6353688c..d8e61785 100644
--- a/Makefile
+++ b/Makefile
@@ -97,6 +97,7 @@ clean distclean :
bin/unf \
games/acq \
games/kvlt \
+ games/rot13 \
games/zs \
git/gitconfig \
gnupg/gpg.conf \
@@ -209,7 +210,7 @@ install-finger :
install -pm 0644 -- finger/project "$(HOME)"/.project
install -pm 0644 -- finger/pgpkey "$(HOME)"/.pgpkey
-install-games : games/acq games/kvlt games/zs check-games install-games-man
+install-games : games/acq games/kvlt games/rot13 games/zs check-games install-games-man
install -m 0755 -d -- "$(HOME)"/.local/games
for name in games/* ; do \
[ -x "$$name" ] || continue ; \
diff --git a/README.markdown b/README.markdown
index 66c83a55..3e566177 100644
--- a/README.markdown
+++ b/README.markdown
@@ -229,7 +229,7 @@ files, for things I really do get tired of typing repeatedly:
* Bash builtins: commands, help topics, shell options, variables, etc.
* `find(1)`'s more portable options
* `ftp(1)` hostnames from `~/.netrc`
-* `git(1)` branch names
+* `git(1)` subcommands, remotes, branches, tags, and addable files
* `gpg(1)` long options
* `make(1)` targets read from a `Makefile`
* `man(1)` page titles
@@ -382,9 +382,11 @@ Installed by the `install-bin` target:
arguments.
* `stws(1df)` strips trailing spaces from the ends of lines of the files
in its arguments.
-* Five stream formatting scripts:
+* Seven stream formatting scripts:
* `sd2u(1df)` converts DOS line endings in streams to UNIX ones.
* `su2d(1df)` converts UNIX line endings in streams to DOS ones.
+ * `slow(1df)` converts uppercase to lowercase.
+ * `supp(1df)` converts lowercase to uppercase.
* `tl(1df)` tags input lines with a prefix or suffix, basically a
`sed(1)` shortcut.
* `tlcs(1df)` executes a command and uses `tl(1df)` to tag stdout and
@@ -392,7 +394,7 @@ Installed by the `install-bin` target:
* `unf(1df)` joins lines with leading spaces to the previous line.
Intended for unfolding HTTP headers, but it should work for most RFC
822 formats.
-* Four simple aggregators for integer data:
+* Four simple aggregators for numbers:
* `mean(1df)` prints the mean.
* `med(1df)` prints the median.
* `mode(1df)` prints the first encountered mode.
@@ -476,6 +478,7 @@ There's some silly stuff in `install-games`:
* `kvlt(6df)` translates input to emulate a style of typing unique to black
metal communities on the internet.
* `rndn(6df)` implements an esoteric random number generation algorithm.
+* `rot13(6df)` rotates the Latin letters in its input.
* `xyzzy(6df)` teleports to a marked location on the filesystem.
* `zs(6df)` prepends "z" case-appropriately to every occurrence of "s" in the
text on its standard input.
diff --git a/bash/bash_completion.d/awk.bash b/bash/bash_completion.d/awk.bash
index 6c6f4b72..1e01381a 100644
--- a/bash/bash_completion.d/awk.bash
+++ b/bash/bash_completion.d/awk.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames awk
-
diff --git a/bash/bash_completion.d/cat.bash b/bash/bash_completion.d/cat.bash
index 894b18ea..430cd58c 100644
--- a/bash/bash_completion.d/cat.bash
+++ b/bash/bash_completion.d/cat.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames cat
-
diff --git a/bash/bash_completion.d/ed.bash b/bash/bash_completion.d/ed.bash
index 9bc2bf59..c7fc6fde 100644
--- a/bash/bash_completion.d/ed.bash
+++ b/bash/bash_completion.d/ed.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames ed
-
diff --git a/bash/bash_completion.d/ex.bash b/bash/bash_completion.d/ex.bash
index 6e2ac9fb..6805b8b1 100644
--- a/bash/bash_completion.d/ex.bash
+++ b/bash/bash_completion.d/ex.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames ex
-
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash
index 8c0335c5..bde515ee 100644
--- a/bash/bash_completion.d/git.bash
+++ b/bash/bash_completion.d/git.bash
@@ -1,27 +1,231 @@
-# Completion for git(1) local branch names
+# Some simple completion for Git
_git() {
- # Bail if not a git repo (or no git!)
- git rev-parse --git-dir >/dev/null 2>&1 || return 1
+ # Subcommands for this function to stack words onto COMPREPLY; if the first
+ # argument is not given, the rest of the function is reached
+ case $1 in
- # Switch on the previous word
- case ${COMP_WORDS[1]} in
+ # No argument; continue normal completion
+ '') ;;
- # If the first word is appropriate, complete with branch/tag names
- checkout|merge|rebase)
- local branch
- while read -r _ _ branch ; do
- branch=${branch##*/}
- [[ $branch == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$branch
- done < <(git for-each-ref refs/heads refs/tags 2>/dev/null)
+ # Symbolic references, remote or local
+ refs)
+ local ref
+ while IFS= read -r ref ; do
+ [[ -n $ref ]] || continue
+ ref=${ref#refs/*/}
+ case $ref in
+ "${COMP_WORDS[COMP_CWORD]}"*)
+ COMPREPLY[${#COMPREPLY[@]}]=$ref
+ ;;
+ esac
+ done < <(git for-each-ref \
+ --format '%(refname)' \
+ 2>/dev/null)
return
;;
- # Bail if it isn't
- *)
- return 1
+ # Remote names
+ remotes)
+ local remote
+ while IFS= read -r remote ; do
+ case $remote in
+ '') continue ;;
+ "${COMP_WORDS[COMP_CWORD]}"*)
+ COMPREPLY[${#COMPREPLY[@]}]=$remote
+ ;;
+ esac
+ done < <(git remote 2>/dev/null)
+ return
+ ;;
+
+ # Git aliases
+ aliases)
+ local alias
+ while IFS= read -r alias ; do
+ alias=${alias#alias.}
+ alias=${alias%% *}
+ case $alias in
+ '') continue ;;
+ "${COMP_WORDS[COMP_CWORD]}"*)
+ COMPREPLY[${#COMPREPLY[@]}]=$alias
+ ;;
+ esac
+ done < <(git config \
+ --get-regexp '^alias\.' \
+ 2>/dev/null)
+ return
+ ;;
+
+ # Git subcommands
+ subcommands)
+ local execpath
+ execpath=$(git --exec-path) || return
+ local path
+ for path in "$execpath"/git-"${COMP_WORDS[COMP_CWORD]}"* ; do
+ [[ -f $path ]] || continue
+ [[ -x $path ]] || continue
+ COMPREPLY[${#COMPREPLY[@]}]=${path#"$execpath"/git-}
+ done
+ return
+ ;;
+
+ # Untracked files
+ untracked_files)
+ local file
+ while IFS= read -rd '' file ; do
+ [[ -n $file ]] || continue
+ COMPREPLY[${#COMPREPLY[@]}]=$file
+ done < <(git ls-files \
+ --directory \
+ --exclude-standard \
+ --no-empty-directory \
+ --others \
+ -z \
+ -- "${COMP_WORDS[COMP_CWORD]}"'*' \
+ 2>/dev/null)
+ return
+ ;;
+ esac
+
+ # Try to find the index of the Git subcommand
+ local -i sci i
+ for ((i = 1; !sci && i <= COMP_CWORD; i++)) ; do
+ case ${COMP_WORDS[i]} in
+
+ # Skip --option=value
+ --*=*) ;;
+
+ # These ones have arguments, so bump the index up one more
+ -C|-c|--exec-path|--git-dir|--work-tree|--namespace) ((i++)) ;;
+
+ # Skip --option
+ --?*) ;;
+
+ # We have hopefully found our subcommand
+ *) ((sci = i)) ;;
+ esac
+ done
+
+ # Complete initial subcommand or alias
+ if ((sci == COMP_CWORD)) ; then
+ _git subcommands
+ _git aliases
+ return
+ fi
+
+ # Test subcommand to choose completions
+ case ${COMP_WORDS[sci]} in
+
+ # Complete with untracked, unignored files
+ add)
+ _git untracked_files
+ return
+ ;;
+
+ # Help on real subcommands (not aliases)
+ help)
+ _git subcommands
+ return
+ ;;
+
+ # Complete with remote subcommands and then remote names
+ remote)
+ if ((COMP_CWORD == 2)) ; then
+ local word
+ while IFS= read -r word ; do
+ [[ -n $word ]] || continue
+ COMPREPLY[${#COMPREPLY[@]}]=$word
+ done < <(compgen -W '
+ add
+ get-url
+ prune
+ remove
+ rename
+ set-branches
+ set-head
+ set-url
+ show
+ update
+ ' -- "${COMP_WORDS[COMP_CWORD]}")
+ else
+ _git remotes
+ fi
+ return
+ ;;
+
+ # Complete with stash subcommands
+ stash)
+ ((COMP_CWORD == 2)) || return
+ local word
+ while IFS= read -r word ; do
+ [[ -n $word ]] || continue
+ COMPREPLY[${#COMPREPLY[@]}]=$word
+ done < <(compgen -W '
+ apply
+ branch
+ clear
+ create
+ drop
+ list
+ pop
+ save
+ show
+ store
+ ' -- "${COMP_WORDS[COMP_CWORD]}")
+ return
+ ;;
+
+ # Complete with submodule subcommands
+ submodule)
+ ((COMP_CWORD == 2)) || return
+ local word
+ while IFS= read -r word ; do
+ [[ -n $word ]] || continue
+ COMPREPLY[${#COMPREPLY[@]}]=$word
+ done < <(compgen -W '
+ add
+ deinit
+ foreach
+ init
+ status
+ summary
+ sync
+ update
+ ' -- "${COMP_WORDS[COMP_CWORD]}")
+ return
+ ;;
+
+ # Complete with remotes and then refs
+ fetch|pull|push)
+ if ((COMP_CWORD == 2)) ; then
+ _git remotes
+ else
+ _git refs
+ fi
+ ;;
+
+ # Commands for which I'm likely to want a ref
+ branch|checkout|merge|rebase|tag)
+ _git refs
+ ;;
+
+ # I normally only want a refspec for "reset" if I'm using the --hard or
+ # --soft option; otherwise, files are fine
+ reset)
+ case ${COMP_WORDS[COMP_CWORD-1]} in
+ --hard|--soft)
+ _git refs
+ ;;
+ esac
;;
esac
}
-complete -F _git -o default git
+
+# Defaulting to directory/file completion is important in Git's case;
+# bashdefault requires Bash >=3.0
+if ((BASH_VERSINFO[0] >= 3)) ; then
+ complete -F _git -o bashdefault -o default git
+else
+ complete -F _git -o default git
+fi
diff --git a/bash/bash_completion.d/grep.bash b/bash/bash_completion.d/grep.bash
index dec9f7d3..86c191cb 100644
--- a/bash/bash_completion.d/grep.bash
+++ b/bash/bash_completion.d/grep.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames grep
-
diff --git a/bash/bash_completion.d/head.bash b/bash/bash_completion.d/head.bash
index 65a32628..fa7cb878 100644
--- a/bash/bash_completion.d/head.bash
+++ b/bash/bash_completion.d/head.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames head
-
diff --git a/bash/bash_completion.d/m4.bash b/bash/bash_completion.d/m4.bash
index 4cf27e63..5811fd5b 100644
--- a/bash/bash_completion.d/m4.bash
+++ b/bash/bash_completion.d/m4.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames m4
-
diff --git a/bash/bash_completion.d/sed.bash b/bash/bash_completion.d/sed.bash
index 4e27d34f..7957ebe2 100644
--- a/bash/bash_completion.d/sed.bash
+++ b/bash/bash_completion.d/sed.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames sed
-
diff --git a/bash/bash_completion.d/source.bash b/bash/bash_completion.d/source.bash
index 3dba710f..abd468af 100644
--- a/bash/bash_completion.d/source.bash
+++ b/bash/bash_completion.d/source.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames source
-
diff --git a/bash/bash_completion.d/tail.bash b/bash/bash_completion.d/tail.bash
index e72d0d8d..e80f40a5 100644
--- a/bash/bash_completion.d/tail.bash
+++ b/bash/bash_completion.d/tail.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames tail
-
diff --git a/bash/bash_completion.d/vi.bash b/bash/bash_completion.d/vi.bash
index 8e385318..728be438 100644
--- a/bash/bash_completion.d/vi.bash
+++ b/bash/bash_completion.d/vi.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames vi
-
diff --git a/bash/bash_completion.d/view.bash b/bash/bash_completion.d/view.bash
index ce381ecf..e228500f 100644
--- a/bash/bash_completion.d/view.bash
+++ b/bash/bash_completion.d/view.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames view
-
diff --git a/bash/bash_completion.d/vim.bash b/bash/bash_completion.d/vim.bash
index 4d3355aa..02d085d1 100644
--- a/bash/bash_completion.d/vim.bash
+++ b/bash/bash_completion.d/vim.bash
@@ -2,4 +2,3 @@
declare -F _text_filenames >/dev/null ||
source "$HOME"/.bash_completion.d/_text_filenames.bash
complete -F _text_filenames -o filenames vim
-
diff --git a/bash/bashrc b/bash/bashrc
index a48a9081..1c7d7802 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,6 +4,10 @@ case $- in
*) return ;;
esac
+# If ENV is set, source it to get all the POSIX-compatible interactive stuff;
+# we should be able to do this even if we're running a truly ancient Bash
+[ -n "$ENV" ] && . "$ENV"
+
# Ensure we're using at least version 2.05. Weird arithmetic syntax needed here
# due to leading zeroes and trailing letters in some 2.x version numbers (e.g.
# 2.05a).
@@ -82,8 +86,8 @@ if ((BASH_VERSINFO[0] >= 4)) ; then
((BASH_VERSINFO[1] >= 3)) && shopt -s direxpand
fi
-# Load POSIX shell startup files and then Bash-specific ones
-for sh in "$ENV" "$HOME"/.bashrc.d/*.bash ; do
+# Load Bash-specific startup files
+for sh in "$HOME"/.bashrc.d/*.bash ; do
[[ -e $sh ]] && source "$sh"
done
unset -v sh
diff --git a/bin/gms b/bin/gms
index f468c375..1cc5b0df 100755
--- a/bin/gms
+++ b/bin/gms
@@ -20,12 +20,12 @@ uid=$(id -u) || exit
# Iterate through the getmailrc.* files in $GETMAIL if defined, or
# $HOME/.getmail if not
-for rcfile in "${GETMAIL:-$HOME/.getmail}"/getmailrc.* ; do {
+for rcfile in "${GETMAIL:-$HOME/.getmail}"/getmailrc.* ; do (
lockdir=${TMPDIR:-/tmp}/getmail.$uid.${rcfile##*/}.lock
- mkdir -m 0700 -- "$lockdir" 2>/dev/null || continue
+ mkdir -m 0700 -- "$lockdir" 2>/dev/null || exit
try -n 3 -s 15 getmail --rcfile "$rcfile" "$@"
rm -fr -- "$lockdir" && lockdir=
-} & done
+) & done
# Wait for all of the enqueued tasks to finish
wait
diff --git a/bin/hurl b/bin/hurl
index dcc0fd73..16ea48f8 100755
--- a/bin/hurl
+++ b/bin/hurl
@@ -2,7 +2,7 @@
# Extract <a href="..."> URLs from an HTML document or documents
# Input is either stdin or the given arguments concatenated
-cat -- "${@:-/dev/stdin}" | # shellcheck disable=SC2002
+cat -- "${@:--}" |
# Pipe through pup to get all the href links
pup -p 'a attr{href}' |
diff --git a/bin/mean.awk b/bin/mean.awk
index 4506b3b0..74bdcab3 100644
--- a/bin/mean.awk
+++ b/bin/mean.awk
@@ -4,5 +4,5 @@ END {
# Error out if we read no values at all
if (!NR)
exit(1)
- printf "%u\n", tot / NR
+ print tot / NR
}
diff --git a/bin/med.awk b/bin/med.awk
index b4a899a1..34d81c41 100644
--- a/bin/med.awk
+++ b/bin/med.awk
@@ -13,7 +13,7 @@ END {
} else {
med = (vals[NR/2] + vals[NR/2+1]) / 2
}
- printf "%u\n", med
+ print med
if (warn)
exit(1)
}
diff --git a/bin/mode.awk b/bin/mode.awk
index beced1f4..500fce2a 100644
--- a/bin/mode.awk
+++ b/bin/mode.awk
@@ -9,5 +9,5 @@ END {
for (val in vals)
if (vals[val] > vals[mode])
mode = val
- printf "%u\n", mode
+ print mode
}
diff --git a/bin/slow b/bin/slow
new file mode 100755
index 00000000..a7bdae76
--- /dev/null
+++ b/bin/slow
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Convert uppercase letters in a stream to lowercase
+cat "${@:--}" |
+tr '[:upper:]' '[:lower:]'
diff --git a/bin/spr b/bin/spr
index 5fc111e6..8ac846a6 100755
--- a/bin/spr
+++ b/bin/spr
@@ -1,4 +1,4 @@
#!/bin/sh
# Convenience script for posting to sprunge.us pastebin
-cat -- "${@:--}" | # shellcheck disable=SC2002
+cat -- "${@:--}" |
curl -F 'sprunge=<-' http://sprunge.us/
diff --git a/bin/supp b/bin/supp
new file mode 100755
index 00000000..1ba6c850
--- /dev/null
+++ b/bin/supp
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Convert lowercase letters in a stream to uppercase
+cat "${@:--}" |
+tr '[:lower:]' '[:upper:]'
diff --git a/bin/tot.awk b/bin/tot.awk
index c25c718d..d1174d7b 100644
--- a/bin/tot.awk
+++ b/bin/tot.awk
@@ -1,3 +1,3 @@
# Total a column of integers
{ tot += $1 }
-END { printf "%u\n", tot }
+END { print tot }
diff --git a/bin/urlc b/bin/urlc
index e306d48f..0998ad4d 100755
--- a/bin/urlc
+++ b/bin/urlc
@@ -26,7 +26,6 @@ td=$(mktd "$self") || exit
list=$td/list head=$td/head body=$td/body
# Iterate through input; ignore leading/trailing whitespace
-# shellcheck disable=SC2002
cat -- "${@:--}" >"$list"
while read -r url ; do
diff --git a/bin/xgo b/bin/xgo
index 6b354ac9..49861aa8 100755
--- a/bin/xgo
+++ b/bin/xgo
@@ -9,7 +9,7 @@ fi
# Iterate over the URL arguments
for url ; do (
- # If it's a YouTube video without a given start time, load it in mpv(1)
+ # Look for patterns in the URL that suggest transformations
case $url in
# If this is a GitHub or GitLab link, swap "blob" for "raw" to get the actual file
diff --git a/games/rot13.sed b/games/rot13.sed
new file mode 100755
index 00000000..7fb8fac9
--- /dev/null
+++ b/games/rot13.sed
@@ -0,0 +1,3 @@
+# Latin ROT-13 cipher
+y/abcdefghijklmnopqrstuvwxyz/nopqrstuvwxyzabcdefghijklm/
+y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/NOPQRSTUVWXYZABCDEFGHIJKLM/
diff --git a/git/gitconfig.m4 b/git/gitconfig.m4
index 2f6953fd..d13e7fdb 100644
--- a/git/gitconfig.m4
+++ b/git/gitconfig.m4
@@ -5,7 +5,10 @@
pushUpdateRejected = false
[alias]
+ amend = commit --amend
+ ls = log --oneline
others = ls-files --others --exclude-standard
+ fuckit = "!git clean -dfx ; git reset --hard"
[color]
ui = true
diff --git a/man/man1/mean.1df b/man/man1/mean.1df
index 21f509f2..2fcc0f05 100644
--- a/man/man1/mean.1df
+++ b/man/man1/mean.1df
@@ -1,7 +1,7 @@
.TH MEAN 1df "September 2016" "Manual page for mean"
.SH NAME
.B mean
-\- print the mean of a list of integers
+\- print the mean of a list of numbers
.SH SYNOPSIS
printf '%u\\n' 8 1 58 |
.B mean
@@ -13,7 +13,7 @@ file
file1 file2
.SH DESCRIPTION
.B mean
-collects all the newline-delimited integers given as input, and prints the
+collects all the newline-delimited numbers given as input, and prints the
mean.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/med.1df b/man/man1/med.1df
index 0fab7db2..1d9bbf7f 100644
--- a/man/man1/med.1df
+++ b/man/man1/med.1df
@@ -1,7 +1,7 @@
.TH MED 1df "September 2016" "Manual page for med"
.SH NAME
.B med
-\- print the med of a list of integers
+\- print the median of a list of numbers
.SH SYNOPSIS
printf '%u\\n' 14 2 10 |
.B med
@@ -13,7 +13,7 @@ file
file1 file2
.SH DESCRIPTION
.B med
-collects all the newline-delimited integers given as input, and prints the
+collects all the newline-delimited numbers given as input, and prints the
median. It uses the floor of the mean of the two median values if the number of
records is even. The input must be sorted, and a warning will be issued if it
isn't.
diff --git a/man/man1/mode.1df b/man/man1/mode.1df
index d4727235..a0a30047 100644
--- a/man/man1/mode.1df
+++ b/man/man1/mode.1df
@@ -1,7 +1,7 @@
.TH MODE 1df "September 2016" "Manual page for mode"
.SH NAME
.B mode
-\- print the mode of a list of integers
+\- print the mode of a list of numbers
.SH SYNOPSIS
printf '%u\\n' 2 35 3 8 |
.B mode
@@ -13,7 +13,7 @@ file
file1 file2
.SH DESCRIPTION
.B mode
-collects all the newline-delimited integers given as input, and prints the
+collects all the newline-delimited numbers given as input, and prints the
mode. If two values have the same frequency (i.e. a multimodal distribution),
it will print the one that reaches that frequency first in the data set.
.SH AUTHOR
diff --git a/man/man1/sd2u.1df b/man/man1/sd2u.1df
index 53fd4f95..bf671bd4 100644
--- a/man/man1/sd2u.1df
+++ b/man/man1/sd2u.1df
@@ -11,7 +11,6 @@ FILE1 [FILE2 ...]
.br
program |
.B sd2u
-.B sd2u
.SH DESCRIPTION
Applies sed(1) to change DOS \\r\\n (CRLF) line endings to UNIX \\n line
endings. Lines already in UNIX format should be unchanged.
diff --git a/man/man1/slow.1df b/man/man1/slow.1df
new file mode 100644
index 00000000..da7fb5d3
--- /dev/null
+++ b/man/man1/slow.1df
@@ -0,0 +1,20 @@
+.TH SLOW 1df "September 2016" "Manual page for slow"
+.SH NAME
+.B slow
+\- change uppercase letters in a stream to lowercase
+.SH USAGE
+.B slow
+FILE1 [FILE2 ...]
+.br
+.B slow
+< FILE
+.br
+program |
+.B slow
+.SH DESCRIPTION
+Applies tr(1) to change instances of characters from the current locale's
+uppercase letter set in the input into their lowercase equivalents.
+.SH SEE ALSO
+supp(1df)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/supp.1df b/man/man1/supp.1df
new file mode 100644
index 00000000..f4342ac2
--- /dev/null
+++ b/man/man1/supp.1df
@@ -0,0 +1,20 @@
+.TH SUPP 1df "September 2016" "Manual page for supp"
+.SH NAME
+.B supp
+\- change lowercase letters in a stream to uppercase
+.SH USAGE
+.B supp
+FILE1 [FILE2 ...]
+.br
+.B supp
+< FILE
+.br
+program |
+.B supp
+.SH DESCRIPTION
+Applies tr(1) to change instances of characters from the current locale's
+lowercase letter set in the input into their uppercase equivalents.
+.SH SEE ALSO
+slow(1df)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/tot.1df b/man/man1/tot.1df
index c098cbe1..ed2983a2 100644
--- a/man/man1/tot.1df
+++ b/man/man1/tot.1df
@@ -13,7 +13,7 @@ file
file1 file2
.SH DESCRIPTION
.B tot
-adds up all the newline-delimited integers given as input, and prints the
+adds up all the newline-delimited numbers given as input, and prints the
total.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man6/rot13.6df b/man/man6/rot13.6df
new file mode 100644
index 00000000..9f7a72e6
--- /dev/null
+++ b/man/man6/rot13.6df
@@ -0,0 +1,21 @@
+.TH ROT13 6df "September 2016" "Manual page for rot13"
+.SH NAME
+.B rot13
+\- Latin ROT13 cipher
+.SH USAGE
+.B rot13
+.br
+.B rot13
+file
+.br
+.B rot13
+file1 file2 file3
+.br
+.B rot13
+< file
+.SH DESCRIPTION
+.B rot13
+implements the ROT13 Caesar cipher for the Latin letters with sed(1), both
+upper and lowercase.
+.SH AUTHORS
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man7/dotfiles.7df.header b/man/man7/dotfiles.7df.header
index 70cb6c2e..cc8aef57 100644
--- a/man/man7/dotfiles.7df.header
+++ b/man/man7/dotfiles.7df.header
@@ -1,3 +1,3 @@
-% DOTFILES(7df)
+% DOTFILES(7) Tom Ryder's personal scripts and configuration
% Tom Ryder
% June 2016
diff --git a/mutt/muttrc.m4 b/mutt/muttrc.m4
index fd425e5e..587d879e 100644
--- a/mutt/muttrc.m4
+++ b/mutt/muttrc.m4
@@ -46,7 +46,7 @@ color normal default default
color quoted green default
color signature cyan default
color status default color22
-color tilde blue default
+color tilde brightblack default
color tree default default
# Completion
@@ -124,11 +124,9 @@ set crypt_replysign = yes
set crypt_replyencrypt = yes
set crypt_replysignencrypted = yes
set crypt_use_gpgme = yes
+set crypt_use_pka = yes
set crypt_verify_sig = yes
-# PGP settings
-set pgp_auto_decode = yes
-
# Vim-ish bindings
bind index gg first-entry
bind index G last-entry
diff --git a/readline/inputrc b/readline/inputrc
index 3f98c08d..6b747104 100644
--- a/readline/inputrc
+++ b/readline/inputrc
@@ -23,6 +23,9 @@ set echo-control-characters off
# Expand tilde to full path on completion
set expand-tilde on
+# Keep the cursor column when iterating through history
+set history-preserve-point on
+
# Add a trailing slash for directories and symlinked directories
set mark-directories on
set mark-symlinked-directories on
@@ -53,8 +56,16 @@ set skip-completed-text on
$if Bash
# Expand ! history with a spacebar press
+ # Note that this makes your shell unusable if your Bash doesn't have
+ # magic-space. It's had this feature since 2.02, which is below the minimum
+ # 2.05a supported by these dotfiles.
Space: magic-space
+ # Tab does traditional blocking completion
+ Tab: complete
+ # Alt+A cycles through completion options
+ "\ea": menu-complete
+
# Alt-E (for exec) to prepend "exec " to a command and return to the end of
# the line
"\ee": "\C-aexec \C-e"
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index b4e2d072..7e916239 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -28,8 +28,8 @@ ls() {
[ -e "$HOME"/.cache/ls/hide-control-chars ] &&
set -- --hide-control-chars "$@"
- # Add --time-style='+%Y-%m-%d %H:%M:%S' to show trailing indicators of the
- # filetype
+ # Add --time-style='+%Y-%m-%d %H:%M:%S' to show the date in my preferred
+ # format
[ -e "$HOME"/.cache/ls/time-style ] &&
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
diff --git a/vim/vimrc b/vim/vimrc
index ab7acf30..45751577 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -72,6 +72,11 @@ if has('syntax')
silent! colorscheme sahara
endif
+" Use all ancestors of current directory for :find
+if has('file_in_path')
+ set path=**
+endif
+
" Command-line based features
if has('cmdline_info')