aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore10
-rw-r--r--.gitmodules9
-rw-r--r--IDEAS.md5
-rw-r--r--ISSUES.md5
-rw-r--r--Makefile380
-rw-r--r--README.md255
-rw-r--r--TABS.md4
-rw-r--r--VERSION4
-rw-r--r--X/sxhkdrc32
-rw-r--r--bash/bash_completion.d/keep.bash2
-rw-r--r--bash/bashrc.d/keep.bash4
-rwxr-xr-xbin/msc.sh12
-rw-r--r--[-rwxr-xr-x]bin/phpcsff.mi50
-rw-r--r--bin/qat.sh12
-rw-r--r--bin/urlmt.sh16
-rw-r--r--check/sh.sh4
-rw-r--r--finger/pgpkey11
-rw-r--r--finger/plan6
-rw-r--r--games/xyzzy.sh13
-rw-r--r--git/config.mi5 (renamed from git/gitconfig.mi5)5
-rw-r--r--gnupg/gpg.conf14
-rw-r--r--gnupg/profile.d/gnupg.sh.mi53
-rw-r--r--i3/config38
-rw-r--r--i3/status10
-rw-r--r--install/conf.sh7
-rw-r--r--install/helptags.vim2
-rw-r--r--ksh/kshrc.d/keep.ksh4
-rw-r--r--less/profile.d/less.sh2
-rw-r--r--lint/sh.sh4
-rw-r--r--man/man1/msc.1df12
-rw-r--r--man/man1/phpcsff.1df21
-rw-r--r--man/man1/qat.1df19
-rw-r--r--man/man6/xyzzy.6df4
-rw-r--r--man/man7/dotfiles.7df276
-rw-r--r--mpd/mpdconf4
-rw-r--r--mutt/filters/markdown-to-html.sh8
-rw-r--r--mutt/mailcap11
-rw-r--r--mutt/muttrc418
-rwxr-xr-xmutt/muttrc.d/src19
-rw-r--r--newsboat/config17
-rw-r--r--newsboat/systemd/user/reload-newsboat.service30
-rw-r--r--newsboat/systemd/user/reload-newsboat.timer9
-rw-r--r--perlcritic/profile.d/perlcritic.sh2
-rw-r--r--perltidy/profile.d/perltidy.sh2
-rw-r--r--plenv/shrc.d/plenv.sh4
-rw-r--r--pyenv/profile.d/pyenv.sh5
-rw-r--r--pyenv/shrc.d/pyenv.sh21
-rw-r--r--rbenv/profile.d/rbenv.sh5
-rw-r--r--rbenv/shrc.d/rbenv.sh21
-rw-r--r--readline/inputrc97
-rw-r--r--sh/profile.d/options.sh1
-rw-r--r--sh/profile.d/visual.sh15
-rw-r--r--sh/profile.d/welcome.sh24
-rw-r--r--sh/shrc.d/ls.sh4
-rw-r--r--systemd/parcimonie.service8
-rw-r--r--systemd/user/notify-email@.service17
-rw-r--r--terminfo/putty-256color.ti12
-rw-r--r--terminfo/putty.ti254
-rw-r--r--terminfo/rxvt-256color.ti14
-rw-r--r--terminfo/rxvt-unicode-256color.ti6
-rw-r--r--terminfo/rxvt-unicode.ti318
-rw-r--r--terminfo/rxvt.ti300
-rw-r--r--terminfo/screen-256color.ti12
-rw-r--r--terminfo/screen.ti198
-rw-r--r--terminfo/tmux-256color.ti6
-rw-r--r--terminfo/tmux.ti104
-rw-r--r--tidy/profile.d/tidy.sh2
-rw-r--r--tmux/tmux.conf4
-rw-r--r--vim/after/ftplugin/gitcommit.vim16
-rw-r--r--vim/after/ftplugin/html.vim2
-rw-r--r--vim/after/ftplugin/mail.vim16
-rw-r--r--vim/after/ftplugin/vim.vim6
-rw-r--r--vim/after/plugin/2html.vim11
-rw-r--r--vim/after/plugin/spellfile_local.vim13
-rw-r--r--vim/after/syntax/bindzone.vim4
-rw-r--r--vim/after/syntax/mail.vim3
-rw-r--r--vim/after/syntax/resolv.vim6
-rw-r--r--vim/after/syntax/sh.vim12
-rw-r--r--vim/after/syntax/vim.vim2
-rw-r--r--vim/autoload/argument.vim8
-rw-r--r--vim/autoload/diff.vim2
-rw-r--r--vim/autoload/filetype/repeat.vim2
-rw-r--r--vim/autoload/fortune.vim59
-rw-r--r--vim/autoload/getenv.vim17
-rw-r--r--vim/autoload/html/timestamp.vim2
-rw-r--r--vim/autoload/mail.vim4
-rw-r--r--vim/autoload/mail/header/field.vim2
-rw-r--r--vim/autoload/option.vim8
-rw-r--r--vim/autoload/path.vim14
-rw-r--r--vim/autoload/put_date.vim24
-rw-r--r--vim/autoload/quote.vim4
-rw-r--r--vim/autoload/xdg.vim61
m---------vim/bundle/cursorline_current0
m---------vim/bundle/detect_indent0
m---------vim/bundle/paste_insert0
m---------vim/bundle/put_date0
m---------vim/bundle/spellfile_local0
m---------vim/bundle/squeeze_repeat_blanks0
m---------vim/bundle/undofileskip0
-rw-r--r--vim/filetype.vim46
-rw-r--r--vim/ftplugin/csv.vim2
-rw-r--r--vim/ftplugin/mail.vim15
-rw-r--r--vim/ftplugin/markdown.vim2
-rw-r--r--vim/plugin/2html.vim1
-rw-r--r--vim/plugin/fortune.vim4
-rw-r--r--vim/plugin/put_date.vim6
-rw-r--r--vim/vimrc537
-rw-r--r--vim/vimrc.stub15
-rw-r--r--vint/vintrc.yaml2
-rw-r--r--wget/profile.d/wget.sh5
-rw-r--r--zsh/zshrc2
-rw-r--r--zsh/zshrc.d/keep.zsh4
112 files changed, 2330 insertions, 1786 deletions
diff --git a/.gitignore b/.gitignore
index 9b244d4d..8d022b56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,6 +73,7 @@
/bin/mkvi
/bin/mode
/bin/motd
+/bin/msc
/bin/murl
/bin/mw
/bin/nlbr
@@ -97,6 +98,7 @@
/bin/pst.sh
/bin/pvi
/bin/pwg
+/bin/qat
/bin/quo
/bin/rep
/bin/rfcf
@@ -174,10 +176,14 @@
/games/uuu
/games/xyzzy
/games/zs
-/git/gitconfig
-/git/gitconfig.m4
+/git/config
+/git/config.m4
/git/template/hooks/pre-commit
/git/template/hooks/prepare-commit-msg
/git/template/hooks/post-update
+/gnupg/profile.d/gnupg.sh
+/gnupg/profile.d/gnupg.sh.m4
/include/mktd.m4
+/less/less
+/mutt/filters/markdown-to-html
/urxvt/ext/select
diff --git a/.gitmodules b/.gitmodules
index 92fe319f..e892cefb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -14,6 +14,9 @@
[submodule "vim/bundle/cursorline_current"]
path = vim/bundle/cursorline_current
url = https://sanctum.geek.nz/code/vim-cursorline-current.git
+[submodule "vim/bundle/detect_indent"]
+ path = vim/bundle/detect_indent
+ url = https://sanctum.geek.nz/code/vim-detect-indent.git
[submodule "vim/bundle/digraph_search"]
path = vim/bundle/digraph_search
url = https://sanctum.geek.nz/code/vim-digraph-search.git
@@ -41,6 +44,9 @@
[submodule "vim/bundle/put_blank_lines"]
path = vim/bundle/put_blank_lines
url = https://sanctum.geek.nz/code/vim-put-blank-lines.git
+[submodule "vim/bundle/put_date"]
+ path = vim/bundle/put_date
+ url = https://sanctum.geek.nz/code/vim-put-date.git
[submodule "vim/bundle/quickfix_auto_open"]
path = vim/bundle/quickfix_auto_open
url = https://sanctum.geek.nz/code/vim-quickfix-auto-open.git
@@ -77,6 +83,9 @@
[submodule "vim/bundle/toggle_flags"]
path = vim/bundle/toggle_flags
url = https://sanctum.geek.nz/code/vim-toggle-flags.git
+[submodule "vim/bundle/undofileskip"]
+ path = vim/bundle/undofileskip
+ url = https://sanctum.geek.nz/code/vim-undofileskip.git
[submodule "vim/bundle/vertical_region"]
path = vim/bundle/vertical_region
url = https://sanctum.geek.nz/code/vim-vertical-region.git
diff --git a/IDEAS.md b/IDEAS.md
index 7622dd97..8bb8214c 100644
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -3,8 +3,6 @@ Ideas
* 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
a bit
* Wouldn't be too hard to add some HTTP BASIC authentication to `ix(1df)` to
@@ -31,6 +29,3 @@ Ideas
some point
* I'd like a Git hook that pre-fills out "Version X.Y.Z" if making an annotated
tag named `vX.Y.Z`.
-* There's no reason to limit `digraph_search.vim` to insert mode only
-* fortune.vim can be spun out into its own repository
-* put\_date.vim can be spun out into its own repository
diff --git a/ISSUES.md b/ISSUES.md
index 692bdb55..1d4a33b9 100644
--- a/ISSUES.md
+++ b/ISSUES.md
@@ -30,4 +30,7 @@ Known issues
pushed upstream.
* The `_text_filenames` completion handler for Bash won't work on files with
newlines in their names. Can it be made to?
-* Typing the normal mode mapping for `paste_open.vim` *twice* causes an error.
+* Highlighting the variable name in e.g. `unset -v VARNAME` works with `bash`
+ highlighting, but not with `sh` highlighting
+* The Markdown underline functions should count screen columns, not characters
+ or bytes
diff --git a/Makefile b/Makefile
index 8146f1cc..487b835c 100644
--- a/Makefile
+++ b/Makefile
@@ -34,31 +34,20 @@
install-newsboat \
install-perlcritic \
install-perltidy \
+ install-plenv \
install-psql \
+ install-pyenv \
+ install-rbenv \
install-readline \
install-sh \
install-subversion \
+ install-systemd \
install-terminfo \
install-tidy \
install-tmux \
install-urxvt \
install-vim \
- install-vim-after \
- install-vim-after-ftplugin \
- install-vim-after-indent \
- install-vim-after-plugin \
- install-vim-after-syntax \
- install-vim-bundle \
- install-vim-compiler \
- install-vim-config \
- install-vim-filetype \
- install-vim-ftplugin \
install-vim-gui \
- install-vim-gui-config \
- install-vim-indent \
- install-vim-plugin \
- install-vim-syntax \
- install-vim-thesaurus \
install-vint \
install-wget \
install-x \
@@ -89,10 +78,13 @@
.SUFFIXES:
.SUFFIXES: .awk .bash .m4 .mi5 .pl .sed .sh
+XDG_CACHE_HOME = $(HOME)/.cache
+XDG_CONFIG_HOME = $(HOME)/.config
+XDG_DATA_HOME = $(HOME)/.local/share
+
NAME = 'Tom Ryder'
EMAIL = tom@sanctum.geek.nz
-KEY = FA09C06E1B670CD0B2F5DE60C14286EA77BB8872
-SENDMAIL = msmtp
+GPG_KEYID = FA09C06E1B670CD0B2F5DE60C14286EA77BB8872
BINS = bin/ap \
bin/apf \
@@ -132,7 +124,6 @@ BINS = bin/ap \
bin/gred \
bin/gscr \
bin/gwp \
- bin/han \
bin/hms \
bin/htdec \
bin/htenc \
@@ -161,6 +152,7 @@ BINS = bin/ap \
bin/mkvi \
bin/mode \
bin/motd \
+ bin/msc \
bin/murl \
bin/mw \
bin/nlbr \
@@ -179,6 +171,7 @@ BINS = bin/ap \
bin/pst \
bin/pvi \
bin/pwg \
+ bin/qat \
bin/quo \
bin/rep \
bin/rfcf \
@@ -272,10 +265,14 @@ GAMES = games/aaf \
games/zs
GIT_TEMPLATE_HOOKS = git/template/hooks/post-update \
- git/template/hooks/pre-commit \
- git/template/hooks/prepare-commit-msg
+ git/template/hooks/pre-commit \
+ git/template/hooks/prepare-commit-msg
-all: $(BINS) git/gitconfig $(GIT_TEMPLATE_HOOKS)
+all: $(BINS) \
+ $(GIT_TEMPLATE_HOOKS) \
+ git/config \
+ gnupg/profile.d/gnupg.sh \
+ less/less
clean distclean:
rm -f -- \
@@ -284,11 +281,15 @@ clean distclean:
$(BINS_SH) \
$(GAMES) \
$(GIT_TEMPLATE_HOOKS) \
+ bin/han \
dillo/dillorc \
dillo/dillorc.m4 \
- git/gitconfig \
- git/gitconfig.m4 \
+ git/config \
+ git/config.m4 \
+ gnupg/profile.d/gnupg.sh \
include/mktd.m4 \
+ less/less \
+ mutt/filters/markdown-to-html \
urxvt/ext/select \
vim/dist/*
@@ -335,13 +336,21 @@ dillo/dillorc: dillo/dillorc.m4
-D HOME=$(HOME) \
dillo/dillorc.m4 > $@
-git/gitconfig: git/gitconfig.m4
+git/config: git/config.m4
m4 \
-D NAME=$(NAME) \
-D EMAIL=$(EMAIL) \
- -D KEY=$(KEY) \
- -D SENDMAIL=$(SENDMAIL) \
- git/gitconfig.m4 > $@
+ -D GPG_KEYID=$(GPG_KEYID) \
+ -D XDG_CONFIG_HOME=$(XDG_CONFIG_HOME) \
+ git/config.m4 > $@
+
+less/less: less/lesskey
+ lesskey --output $@ less/lesskey
+
+gnupg/profile.d/gnupg.sh: gnupg/profile.d/gnupg.sh.m4
+ m4 \
+ -D GPG_KEYID=$(GPG_KEYID) \
+ gnupg/profile.d/gnupg.sh.m4 > $@
MAILDIR = $(HOME)/Mail
@@ -351,8 +360,8 @@ install: install-bin \
install-git \
install-gnupg \
install-less \
- install-man \
install-login-shell \
+ install-man \
install-readline \
install-vim
@@ -363,27 +372,27 @@ install-abook:
mkdir -p -- $(HOME)/.abook
cp -p -- abook/abookrc $(HOME)/.abook
-install-bash: check-bash install-sh
- mkdir -p -- $(HOME)/.bashrc.d
+install-bash: check-bash install-sh bin/han
+ mkdir -p -- $(HOME)/.bashrc.d $(HOME)/.local/bin
cp -p -- bash/bashrc $(HOME)/.bashrc
- cp -p -- bash/bashrc.d/* $(HOME)/.bashrc.d
+ cp -p -- bash/bashrc.d/*.bash $(HOME)/.bashrc.d
cp -p -- bash/bash_profile $(HOME)/.bash_profile
cp -p -- bash/bash_logout $(HOME)/.bash_logout
+ cp -p -- bin/han $(HOME)/.local/bin
install-bash-completion: install-bash
- mkdir -p -- $(HOME)/.bash_completion.d $(HOME)/.config
- cp -p -- bash/bash_completion $(HOME)/.config
- cp -p -- bash/bash_completion.d/* $(HOME)/.bash_completion.d
+ mkdir -p -- $(HOME)/.bash_completion.d $(XDG_CONFIG_HOME)
+ cp -p -- bash/bash_completion $(XDG_CONFIG_HOME)
+ cp -p -- bash/bash_completion.d/*.bash $(HOME)/.bash_completion.d
install-bin: $(BINS) install-bin-man
mkdir -p -- $(HOME)/.local/bin
- find bin -type f -perm -u=x \
- -exec cp -p -- {} $(HOME)/.local/bin \;
+ cp -p -- $(BINS) $(HOME)/.local/bin
install-bin-man:
- mkdir -p -- $(HOME)/.local/share/man/man1 $(HOME)/.local/share/man/man8
- cp -p -- man/man1/*.1df $(HOME)/.local/share/man/man1
- cp -p -- man/man8/*.8df $(HOME)/.local/share/man/man8
+ mkdir -p -- $(XDG_DATA_HOME)/man/man1 $(XDG_DATA_HOME)/man/man8
+ cp -p -- man/man1/*.1df $(XDG_DATA_HOME)/man/man1
+ cp -p -- man/man8/*.8df $(XDG_DATA_HOME)/man/man8
install-curl:
cp -p -- curl/curlrc $(HOME)/.curlrc
@@ -393,8 +402,8 @@ install-dillo: dillo/dillorc install-x
cp -p -- dillo/dillorc $(HOME)/.dillo/dillorc
install-dunst: install-x
- mkdir -p -- $(HOME)/.config/dunst
- cp -p -- dunst/dunstrc $(HOME)/.config/dunst
+ mkdir -p -- $(XDG_CONFIG_HOME)/dunst
+ cp -p -- dunst/dunstrc $(XDG_CONFIG_HOME)/dunst
install-emacs: emacs/bin/emacsm install-sh
mkdir -p -- $(HOME)/.local/bin
@@ -412,256 +421,227 @@ install-finger:
install-games: $(GAMES) install-games-man
mkdir -p -- $(HOME)/.local/games
- find games -type f -perm -u=x \
- -exec cp -p -- {} $(HOME)/.local/games \;
+ cp -p -- $(GAMES) $(HOME)/.local/games
install-games-man:
- mkdir -p -- $(HOME)/.local/share/man/man6
- cp -p -- man/man6/*.6df $(HOME)/.local/share/man/man6
-
-install-git: git/gitconfig $(GIT_TEMPLATE_HOOKS)
- cp -p -- git/gitconfig $(HOME)/.gitconfig
- find git/template \
- -type d -exec sh -c 'mkdir -p -- \
- $(HOME)/.git-template"$${1#git/template}"' \
- _ {} \; \
- -o ! -name '*.*' -exec sh -c 'cp -p -- "$$1" \
- $(HOME)/.git-template"$${1#git/template}"' \
- _ {} \;
-
-install-gnupg:
- mkdir -m 0700 -p -- $(HOME)/.gnupg
- cp -p -- gnupg/*.conf $(HOME)/.gnupg
+ mkdir -p -- $(XDG_DATA_HOME)/man/man6
+ cp -p -- man/man6/*.6df $(XDG_DATA_HOME)/man/man6
+
+install-git: git/config $(GIT_TEMPLATE_HOOKS)
+ mkdir -p -- $(XDG_CONFIG_HOME)/git
+ cp -p -- git/config $(XDG_CONFIG_HOME)/git/config
+ mkdir -p -- $(XDG_CONFIG_HOME)/git/template
+ cp -pR -- git/template/description \
+ $(XDG_CONFIG_HOME)/git/template/description
+ mkdir -p -- $(XDG_CONFIG_HOME)/git/template/hooks
+ cp -pR -- $(GIT_TEMPLATE_HOOKS) \
+ $(XDG_CONFIG_HOME)/git/template/hooks
+
+install-gnupg: gnupg/profile.d/gnupg.sh install-sh
+ cp -p -- gnupg/profile.d/*.sh $(HOME)/.profile.d
install-gtk:
- mkdir -p -- $(HOME)/.config/gtk-3.0
+ mkdir -p -- $(XDG_CONFIG_HOME)/gtk-3.0
cp -p -- gtk/gtkrc-2.0 $(HOME)/.gtkrc-2.0
- cp -p -- gtk/gtk-3.0/settings.ini $(HOME)/.config/gtk-3.0
+ cp -p -- gtk/gtk-3.0/settings.ini $(XDG_CONFIG_HOME)/gtk-3.0
install-i3: install-x
- mkdir -p -- $(HOME)/.i3
- cp -p -- i3/* $(HOME)/.i3
+ mkdir -p -- $(XDG_CONFIG_HOME)/i3
+ cp -p -- i3/* $(XDG_CONFIG_HOME)/i3
install-keychain: install-sh
- cp -p -- keychain/profile.d/* $(HOME)/.profile.d
- cp -p -- keychain/shrc.d/* $(HOME)/.shrc.d
+ cp -p -- keychain/profile.d/*.sh $(HOME)/.profile.d
+ cp -p -- keychain/shrc.d/*.sh $(HOME)/.shrc.d
-install-less:
- cp -p -- less/lesskey $(HOME)/.lesskey
- lesskey
+install-less: less/less
+ mkdir -p -- $(HOME)/.profile.d
+ cp -- less/profile.d/*.sh $(HOME)/.profile.d
+ mkdir -p -- $(XDG_CONFIG_HOME)/less
+ cp -p -- less/less $(XDG_CONFIG_HOME)/less/key
install-mail:
cp -p -- mail/signature $(HOME)/.signature
install-man:
- mkdir -p -- $(HOME)/.local/share/man/man7
- cp -p -- man/man7/dotfiles.7df $(HOME)/.local/share/man/man7
+ mkdir -p -- $(XDG_DATA_HOME)/man/man7
+ cp -p -- man/man7/dotfiles.7df $(XDG_DATA_HOME)/man/man7
install-mpd: install-sh
mkdir -p -- $(HOME)/.mpd/playlists
- cp -p -- mpd/profile.d/* $(HOME)/.profile.d
+ cp -p -- mpd/profile.d/*.sh $(HOME)/.profile.d
cp -p -- mpd/mpdconf $(HOME)/.mpdconf
install-mpv:
- mkdir -p -- $(HOME)/.config/mpv
- cp -p -- mpv/* $(HOME)/.config/mpv
+ mkdir -p -- $(XDG_CONFIG_HOME)/mpv
+ cp -p -- mpv/* $(XDG_CONFIG_HOME)/mpv
-install-mutt: install-mail
- mkdir -p -- $(HOME)/.muttrc.d $(HOME)/.cache/mutt
- cp -p -- mutt/muttrc $(HOME)/.muttrc
- cp -p -- mutt/muttrc.d/src $(HOME)/.muttrc.d
+install-mutt: install-gnupg install-mail mutt/filters/markdown-to-html
+ mkdir -p -- \
+ $(XDG_CONFIG_HOME)/mutt \
+ $(XDG_CONFIG_HOME)/mutt/muttrc.d \
+ $(XDG_CACHE_HOME)/mutt/headers \
+ $(XDG_DATA_HOME)/mutt/autocrypt \
+ $(HOME)/.local/libexec/mutt/filters
+ cp -p -- mutt/muttrc \
+ mutt/mailcap \
+ $(XDG_CONFIG_HOME)/mutt
+ cp -p -- mutt/muttrc.d/src \
+ $(XDG_CONFIG_HOME)/mutt/muttrc.d
+ touch -- $(XDG_CONFIG_HOME)/mutt/aliases
+ cp -p -- mutt/filters/markdown-to-html \
+ $(HOME)/.local/libexec/mutt/filters
install-ncmcpp: install-mpd
mkdir -p -- $(HOME)/.ncmpcpp
cp -p -- ncmpcpp/config $(HOME)/.ncmpcpp
-install-newsboat:
- mkdir -p -- $(HOME)/.config/newsboat $(HOME)/.local/share/newsboat
- cp -p -- newsboat/config $(HOME)/.config/newsboat
+install-newsboat: install-systemd
+ mkdir -p -- $(XDG_CONFIG_HOME)/newsboat $(XDG_DATA_HOME)/newsboat
+ cp -p -- newsboat/config $(XDG_CONFIG_HOME)/newsboat
+ -command -v systemctl >/dev/null 2>&1 \
+ && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \
+ && cp -p -- newsboat/systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \
+ && systemctl --user daemon-reload \
+ && systemctl --user start reload-newsboat.timer \
+ && systemctl --user enable reload-newsboat.timer
install-mysql:
cp -p -- mysql/my.cnf $(HOME)/.my.cnf
install-ksh: check-ksh install-sh
mkdir -p -- $(HOME)/.kshrc.d
- cp -p -- ksh/shrc.d/* $(HOME)/.shrc.d
+ cp -p -- ksh/shrc.d/*.sh $(HOME)/.shrc.d
cp -p -- ksh/kshrc $(HOME)/.kshrc
- cp -p -- ksh/kshrc.d/* $(HOME)/.kshrc.d
+ cp -p -- ksh/kshrc.d/*.ksh $(HOME)/.kshrc.d
install-login-shell: check-login-shell
sh install/login-shell.sh
-install-perlcritic:
- cp -p -- perlcritic/perlcriticrc $(HOME)/.perlcriticrc
+install-perlcritic: install-sh
+ cp -p -- perlcritic/profile.d/*.sh $(HOME)/.profile.d
+ mkdir -p -- $(XDG_CONFIG_HOME)/perlcritic
+ cp -p -- perlcritic/perlcriticrc $(XDG_CONFIG_HOME)/perlcritic/perlcriticrc
-install-perltidy:
- cp -p -- perltidy/perltidyrc $(HOME)/.perltidyrc
+install-perltidy: install-sh
+ cp -p -- perltidy/profile.d/*.sh $(HOME)/.profile.d
+ mkdir -p -- $(XDG_CONFIG_HOME)/perltidy
+ cp -p -- perltidy/perltidyrc $(XDG_CONFIG_HOME)/perltidy/perltidyrc
install-plenv: install-sh
- cp -p -- plenv/profile.d/* $(HOME)/.profile.d
- cp -p -- plenv/shrc.d/* $(HOME)/.shrc.d
+ cp -p -- plenv/profile.d/*.sh $(HOME)/.profile.d
+ cp -p -- plenv/shrc.d/*.sh $(HOME)/.shrc.d
install-psql:
cp -p -- psql/psqlrc $(HOME)/.psqlrc
+install-pyenv: install-sh
+ cp -p -- pyenv/profile.d/*.sh $(HOME)/.profile.d
+ cp -p -- pyenv/shrc.d/*.sh $(HOME)/.shrc.d
+
+install-rbenv: install-sh
+ cp -p -- rbenv/profile.d/*.sh $(HOME)/.profile.d
+ cp -p -- rbenv/shrc.d/*.sh $(HOME)/.shrc.d
+
install-readline:
cp -p -- readline/inputrc $(HOME)/.inputrc
install-sh: check-sh
mkdir -p -- $(HOME)/.profile.d $(HOME)/.shrc.d
cp -p -- sh/profile $(HOME)/.profile
- cp -p -- sh/profile.d/* $(HOME)/.profile.d
+ cp -p -- sh/profile.d/*.sh $(HOME)/.profile.d
cp -p -- sh/shinit $(HOME)/.shinit
cp -p -- sh/shrc $(HOME)/.shrc
- cp -p -- sh/shrc.d/* $(HOME)/.shrc.d
+ cp -p -- sh/shrc.d/*.sh $(HOME)/.shrc.d
install-subversion:
mkdir -p -- $(HOME)/.subversion
cp -p -- subversion/config $(HOME)/.subversion
+install-systemd:
+ -command -v systemctl >/dev/null 2>&1 \
+ && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \
+ && cp -p -- systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \
+ && systemctl --user daemon-reload \
+
+# Need to install these in appropriate order to meet dependencies; could trust
+# the system glob, but a fixed list is just more straightforward
install-terminfo:
- find terminfo -type f -name '*.ti' \
- -exec tic -- {} \;
+ tic terminfo/putty.ti
+ tic terminfo/putty-256color.ti
+ tic terminfo/rxvt.ti
+ tic terminfo/rxvt-256color.ti
+ tic terminfo/rxvt-unicode.ti
+ tic terminfo/rxvt-unicode-256color.ti
+ tic terminfo/screen.ti
+ tic terminfo/screen-256color.ti
install-tidy: install-sh
- cp -p -- tidy/profile.d/* $(HOME)/.profile.d
- cp -p -- tidy/tidyrc $(HOME)/.tidyrc
+ cp -p -- tidy/profile.d/*.sh $(HOME)/.profile.d
+ mkdir -p -- $(XDG_CONFIG_HOME)/tidy
+ cp -p -- tidy/tidyrc $(XDG_CONFIG_HOME)/tidy/tidyrc
install-tmux: tmux/tmux.conf install-terminfo
cp -p -- tmux/tmux.conf $(HOME)/.tmux.conf
install-urxvt: urxvt/ext/select
mkdir -p -- $(HOME)/.urxvt/ext
- find urxvt/ext -type f ! -name '*.pl' \
- -exec cp -p -- {} $(HOME)/.urxvt/ext \;
+ cp -- urxvt/ext/select $(HOME)/.urxvt/ext
VIM = vim
VIMDIR = $(HOME)/.vim
-VIMRC = $(HOME)/.vim/vimrc
-
-install-vim: install-vim-after \
- install-vim-autoload \
- install-vim-bundle \
- install-vim-compiler \
- install-vim-config \
- install-vim-filetype \
- install-vim-ftplugin \
- install-vim-indent \
- install-vim-plugin \
- install-vim-syntax
-
-install-vim-after: install-vim-after-ftplugin \
- install-vim-after-indent \
- install-vim-after-plugin \
- install-vim-after-syntax
-
-install-vim-after-ftplugin: install-vim-compiler
- mkdir -p $(VIMDIR)/after/ftplugin
- cp -p -- vim/after/ftplugin/*.vim $(VIMDIR)/after/ftplugin
-
-install-vim-after-indent: install-vim-autoload
- mkdir -p $(VIMDIR)/after/indent
- cp -p -- vim/after/indent/*.vim $(VIMDIR)/after/indent
-
-install-vim-after-plugin: install-vim-autoload
- mkdir -p $(VIMDIR)/after/plugin
- cp -p -- vim/after/plugin/*.vim $(VIMDIR)/after/plugin
-
-install-vim-after-syntax:
- mkdir -p $(VIMDIR)/after/syntax
- cp -p -- vim/after/syntax/*.vim $(VIMDIR)/after/syntax
-
-install-vim-autoload:
- mkdir -p $(VIMDIR)/autoload
- cd vim && find autoload \
- -type d -exec sh -c \
- 'mkdir -p -- $(VIMDIR)/"$$1"' _ {} \; \
- -o \
- -type f -exec sh -c \
- 'cp -p -- "$$1" $(VIMDIR)/"$$1"' _ {} \;
-
-install-vim-bundle: install-vim-config
- cd vim/bundle && find */* \
- -type d -exec sh -c \
- 'mkdir -p -- $(VIMDIR)/"$${1#*/}"' _ {} \;
- cd vim/bundle && find */*/* \
- -type f -exec sh -c \
- 'cp -p -- "$$1" $(VIMDIR)/"$${1#*/}"' _ {} \;
- $(VIM) -e -u NONE -c 'helptags $(VIMDIR)/doc' -c quit
-
-install-vim-cache:
- mkdir -p -- \
- $(VIMDIR)/cache \
- $(VIMDIR)/cache/backup \
- $(VIMDIR)/cache/spell \
- $(VIMDIR)/cache/swap \
- $(VIMDIR)/cache/undo
-
-install-vim-compiler:
- mkdir -p -- $(VIMDIR)/compiler
- cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler
+VIMRC = $(VIMDIR)/vimrc
-install-vim-config: install-vim-autoload install-vim-cache
+install-vim:
+ mkdir -p -- $(VIMDIR)
cp -p -- vim/vimrc.stub $(HOME)/.vimrc
cp -p -- vim/vimrc $(VIMRC)
-
-install-vim-filetype:
- cp -p -- vim/filetype.vim vim/scripts.vim $(VIMDIR)
-
-install-vim-ftplugin: install-vim-autoload
- mkdir -p -- $(VIMDIR)/ftplugin
- cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin
+ cp -p -- vim/filetype.vim \
+ vim/scripts.vim \
+ $(VIMDIR)
+ cp -pR -- vim/after \
+ vim/autoload \
+ vim/compiler \
+ vim/ftplugin \
+ vim/indent \
+ vim/plugin \
+ vim/syntax \
+ $(VIMDIR)
+ for ent in vim/bundle/*/* ; do \
+ [ -d "$$ent" ] || continue ; \
+ cp -pR -- "$$ent" $(VIMDIR) ; \
+ done
GVIMRC = $(HOME)/.gvimrc
-install-vim-gui: install-vim \
- install-vim-gui-config
-
-install-vim-gui-config:
- cp -p -- vim/gvimrc $(GVIMRC)
-
-install-vim-indent:
- mkdir -p -- $(VIMDIR)/indent
- cp -p -- vim/indent/*.vim $(VIMDIR)/indent
-
-install-vim-plugin: install-vim-autoload
- mkdir -p -- $(VIMDIR)/plugin
- cp -p -- vim/plugin/*.vim $(VIMDIR)/plugin
-
-install-vim-syntax:
- mkdir -p -- $(VIMDIR)/syntax
- cp -p -- vim/syntax/*.vim $(VIMDIR)/syntax
-
-install-vim-thesaurus:
- mkdir -p -- $(VIMDIR)/ref
- curl 'https://sanctum.geek.nz/ref/thesaurus.txt' \
- > $(VIMDIR)/ref/thesaurus.txt
+install-vim-gui: install-vim
+ cp -- vim/gvimrc $(GVIMRC)
install-vint:
cp -p -- vint/vintrc.yaml $(HOME)/.vintrc.yaml
-install-wget:
- cp -p -- wget/wgetrc $(HOME)/.wgetrc
+install-wget: install-sh
+ cp -p -- wget/profile.d/*.sh $(HOME)/.profile.d
+ mkdir -p -- $(XDG_CACHE_HOME)/wget $(XDG_CONFIG_HOME)/wget
+ cp -p -- wget/wgetrc $(XDG_CONFIG_HOME)/wget/wgetrc
install-x: check-xinit
mkdir -p -- \
- $(HOME)/.config \
- $(HOME)/.config/sxhkd \
+ $(XDG_CONFIG_HOME)/sxhkd \
$(HOME)/.xinitrc.d \
$(HOME)/.Xresources.d
- cp -p -- X/redshift.conf $(HOME)/.config
- cp -p -- X/sxhkdrc $(HOME)/.config/sxhkd
+ cp -p -- X/redshift.conf $(XDG_CONFIG_HOME)
+ cp -p -- X/sxhkdrc $(XDG_CONFIG_HOME)/sxhkd
cp -p -- X/xinitrc $(HOME)/.xinitrc
- cp -p -- X/xinitrc.d/* $(HOME)/.xinitrc.d
+ cp -p -- X/xinitrc.d/*.sh $(HOME)/.xinitrc.d
cp -p -- X/Xresources $(HOME)/.Xresources
- cp -p -- X/Xresources.d/* $(HOME)/.Xresources.d
+ cp -p -- X/Xresources.d/*.sh $(HOME)/.Xresources.d
install-zsh: check-zsh install-sh
- mkdir -p -- $(HOME)/.profile.d $(HOME)/.zshrc.d
- cp -p -- zsh/profile.d/* $(HOME)/.profile.d
+ mkdir -p -- $(HOME)/.zshrc.d
+ cp -p -- zsh/profile.d/*.sh $(HOME)/.profile.d
cp -p -- zsh/zprofile $(HOME)/.zprofile
cp -p -- zsh/zshrc $(HOME)/.zshrc
- cp -p -- zsh/zshrc.d/* $(HOME)/.zshrc.d
+ cp -p -- zsh/zshrc.d/*.zsh $(HOME)/.zshrc.d
check: check-bin \
check-git-template-hooks \
diff --git a/README.md b/README.md
index 774031a0..130caa01 100644
--- a/README.md
+++ b/README.md
@@ -5,28 +5,29 @@ This is my personal repository of configuration files and scripts for `$HOME`,
including most of the settings that migrate well between machines.
This repository began as a simple way to share Vim and tmux configuration, but
-over time a lot of scripts and shell configuration have been added, making it
+a lot of scripts and shell configuration have been added over time, making it
into a personal suite of custom Unix tools.
Installation
------------
- $ git clone https://sanctum.geek.nz/code/dotfiles.git ~/.dotfiles
- $ cd ~/.dotfiles
+ $ mkdir -p ~/.local/share
+ $ git clone https://sanctum.geek.nz/code/dotfiles.git ~/.local/share/dotfiles
+ $ cd ~/.local/share/dotfiles
$ git submodule init
$ git submodule update
$ make
- $ make -n install
+ $ make -n install # Check output carefully
$ make install
For the default `all` target, you'll need a POSIX-fearing userland, including
`make(1)` and `m4(1)`.
-The installation `Makefile` will overwrite things standing in the way of its
+The installation `Makefile` overwrites things standing in the way of its
installed files without backing them up, so read the output of `make -n
-install` before running `make install` to make sure you aren't going to lose
-anything unexpected. If you're still not sure, install it in a temporary
-directory so you can explore:
+install` before running `make install` carefully, to make sure you aren't going
+to lose anything unexpected. If you're still not sure, install it in
+a temporary directory first, so you can explore:
$ tmpdir=$(mktemp -d)
$ make install HOME="$tmpdir"
@@ -36,36 +37,36 @@ The default `install` target will install these targets and all their
dependencies:
* `install-bin`
-* `install-bin-man`
* `install-curl`
* `install-ex`
* `install-git`
* `install-gnupg`
* `install-less`
* `install-login-shell`
+* `install-man`
* `install-readline`
* `install-vim`
-The `install-login-shell` looks at your `SHELL` environment variable and tries
-to figure out which shell's configuration files to install, falling back on
-`install-sh`.
+The `install-login-shell` target looks at your `SHELL` environment variable,
+and tries to figure out which shell's configuration files to install, falling
+back on `install-sh`.
The remaining files can be installed with the other `install-*` targets. Try
`awk -f bin/mftl.awk Makefile` in the project's root directory to see a list.
### Configuration
-To save a set of `make` targets useful for a specific user or host, you can
-save them in a newline-separated file `~/.dotfiles.conf`, and install using
-that with the special `install-conf` target. This can include variable
-settings, too:
+To keep a set of `make` targets useful for a specific user or host, you can
+list them in a newline-separated file `~/.config/dotfiles/config`, and install
+using that with the special `install-conf` target. This can include macro
+settings for the `Makefile`, too:
$ cd
- $ cat .dotfiles.conf
+ $ cat .config/dotfiles/config
install-bash
install-bin
EMAIL=you@example.com
- $ make -C .dotfiles install-conf
+ $ make -C .local/share/dotfiles install-conf
Tools
-----
@@ -74,115 +75,128 @@ 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/) (3.0 or higher)
+ * [GNU Bash](https://www.gnu.org/software/bash/) (v3.0 or newer)
* [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 with
+* [Abook](http://abook.sourceforge.net/)---curses address book program
+* [cURL](https://curl.haxx.se/)---Command-line tool for transferring data with
URL syntax
-* [Dillo](https://www.dillo.org/) -- A lightweight web browser
-* [Dunst](https://dunst-project.org/) -- A lightweight X11 notification daemon
+* [Dillo](https://www.dillo.org/)---A lightweight web browser
+* [Dunst](https://dunst-project.org/)---A lightweight X11 notification daemon
that works with `libnotify`
-* `finger(1)` -- User information lookup program
-* [Git](https://git-scm.com/) -- Distributed version control system
-* [GNU Emacs](https://www.gnu.org/software/emacs/) -- Extensible text editor
-* [GnuPG](https://www.gnupg.org/) -- GNU Privacy Guard, for private
+* `finger(1)`---User information lookup program
+* [Git](https://git-scm.com/)---Distributed version control system
+* [GNU Emacs](https://www.gnu.org/software/emacs/)---Extensible text editor
+* [GnuPG](https://www.gnupg.org/)---GNU Privacy Guard, for private
communication and file encryption
-* [GTK+](https://www.gtk.org/) -- GIMP Toolkit, for graphical user interface
+* [GTK+](https://www.gtk.org/)---GIMP Toolkit, for graphical user interface
elements
-* [i3](https://i3wm.org/) -- Tiling window manager
-* [less](https://www.gnu.org/software/less/) -- Terminal pager
-* [mpv](https://mpv.io/) -- Media player
-* [Mutt](http://www.mutt.org/) -- Terminal mail user agent
-* [`mysql(1)`](https://linux.die.net/man/1/mysql) -- Command-line MySQL client
-* [Ncmpcpp](https://rybczak.net/ncmpcpp/) -- ncurses music player client
-* [Newsboat](https://newsboat.org/) -- Terminal RSS/Atom feed reader
-* [`psql(1)`](https://linux.die.net/man/1/psql) -- Command-line PostgreSQL
+* [i3](https://i3wm.org/)---Tiling window manager
+* [less](https://www.gnu.org/software/less/)---Terminal pager
+* [mpv](https://mpv.io/)---Media player
+* [Mutt](http://www.mutt.org/)---Terminal mail user agent
+* [`mysql(1)`](https://linux.die.net/man/1/mysql)---Command-line MySQL client
+* [Ncmpcpp](https://rybczak.net/ncmpcpp/)---ncurses music player client
+* [Newsboat](https://newsboat.org/)---Terminal RSS/Atom feed reader
+* [`psql(1)`](https://linux.die.net/man/1/psql)---Command-line PostgreSQL
client
-* [Perl::Critic](http://perlcritic.com/) -- static source code analysis engine
+* [Perl::Critic](http://perlcritic.com/)---static source code analysis engine
for Perl
-* [Perl::Tidy](http://perltidy.sourceforge.net/) -- Perl source code
- reformatter
-* [Readline](https://tiswww.case.edu/php/chet/readline/rltop.html) -- GNU
+* [Perl::Tidy](http://perltidy.sourceforge.net/)---reformats Perl source code
+* [Readline](https://tiswww.case.edu/php/chet/readline/rltop.html)---GNU
library for user input used by Bash, MySQL, and others
-* [rxvt-unicode](http://software.schmorp.de/pkg/rxvt-unicode.html) -- Fork of
+* [rxvt-unicode](http://software.schmorp.de/pkg/rxvt-unicode.html)---Fork of
the rxvt terminal emulator with Unicode support
-* [Subversion](https://subversion.apache.org/) -- Apache Subversion, a version
+* [Subversion](https://subversion.apache.org/)---Apache Subversion, a version
control system
-* [tidy](http://www.html-tidy.org/) -- HTML/XHTML linter and tidier
-* [tmux](https://tmux.github.io/) -- Terminal multiplexer similar to GNU Screen
-* [Vim](https://www.vim.org/) -- Vi IMproved, a text editor
-* [X11](https://www.x.org/wiki/) -- Windowing system with network transparency
+* [tidy](http://www.html-tidy.org/)---HTML/XHTML linter and tidier
+* [tmux](https://tmux.github.io/)---Terminal multiplexer similar to GNU Screen
+* [Vim](https://www.vim.org/)---Vi IMproved, a text editor
+* [X11](https://www.x.org/wiki/)---Windowing system with network transparency
for Unix
-The configurations for shells, GnuPG, Mutt, tmux, and Vim are the most
-expansive, and most likely to be of interest. The i3 configuration is mostly
-changed to make window switching behave like Vim windows and tmux panes do, and
-there's a fair few resources defined for rxvt-unicode.
+There is also some slightly customized support for multi-version environment
+management for three major scripting languages:
+
+* [plenv](https://github.com/tokuhirom/plenv)---Perl
+* [pyenv](https://github.com/pyenv/pyenv)---Python
+* [rbenv](https://github.com/rbenv/rbenv)---Ruby
+
+The configurations for shells, Mutt, tmux, and Vim are the most likely to be of
+interest. The i3 configuration is limited mainly to changing window switching
+key bindings to match Vim's. There are a fair few resources defined for
+rxvt-unicode.
### Shell
-My `.profile` and other files in `sh` are written in POSIX shell script, so
-they should work in most `sh(1)` implementations. Individual scripts called by
-`.profile` are saved in `.profile.d` and iterated on login for ease of
-management. Most of these boil down to exporting variables appropriate to the
-system and the software it has available.
+On GNU/Linux, I use Bash; on \*BSD, I use some variant of Korn Shell,
+preferably `ksh93` if it's available.
+
+#### POSIX core
+
+My `~/.profile` and other files in `sh` are written in POSIX shell script, so
+they *should* work in most POSIX-conforming `sh(1)` implementations. Please
+email me if you find a case where they don't!
+
+Further shell snippets to run on login are sourced from `~/.profile.d` by
+`~/.profile`. Most of these boil down to exporting variables appropriate to
+the system and the software it has available.
-Configuration that should be sourced for all POSIX-fearing interactive shells
-is kept in `~/.shrc`, with subscripts read from `~/.shrc.d`. There's a shim in
-`~/.shinit` to act as `ENV`. I make an effort to target POSIX for my functions
-and scripts where I can so that the same files can be loaded for all shells.
+Configuration that should be sourced for all conforming *interactive* shells is
+kept in `~/.shrc`, with subscripts read from `~/.shrc.d`. There's
+a `~/.shinit` shim to act as `ENV`.
-On GNU/Linux I use Bash, on BSD I use some variant of Korn Shell, preferably
-`ksh93` if it's available.
+#### GNU Bash
-My Bash is written to work with [any version 3.0 or
+My Bash scripts are written to work with GNU Bash [v3.0 or
newer](https://wiki.bash-hackers.org/scripting/bashchanges). This is why I use
older syntax for certain things such as appending items to arrays:
array[${#array[@]}]=$item
-Compare this to the much nicer syntax available since 3.1-alpha1, which
-actually works for arrays with sparse indices, unlike the above syntax:
+This doesn't work for arrays with sparse indices; compare this to the much
+nicer syntax available since 3.1-alpha1, which does:
array+=("$item")
-Where I do use features that are only available in versions of Bash newer than
-3.0, such as newer `shopt` options or `PROMPT_DIRTRIM`, they are only run after
-testing `BASH_VERSINFO` appropriately.
+I do use some features that are only available in versions after v3.0, such as
+newer `shopt` options like `dirspell`, or variables like `PROMPT_DIRTRIM`.
+These are set only after testing `BASH_VERSINFO` appropriately.
#### Prompt
A terminal session with my prompt looks something like this:
~$ ssh remote
- remote:~$ cd .dotfiles
- remote:~/.dotfiles(master+!)$ git status
+ remote:~$ cd .local/share/dotfiles
+ remote:~/.local/share/dotfiles(master+!)$ git status
M README.md
M bash/bashrc.d/prompt.bash
A init
- remote:~/.dotfiles(master+!)$ foobar
+ remote:~/.local/share/dotfiles(master+!)$ foobar
foobar: command not found
- remote:~/.dotfiles(master+!)<127>$ sleep 5 &
+ remote:~/.local/share/dotfiles(master+!)<127>$ sleep 5 &
[1] 28937
- remote:~/.dotfiles(master+!){1}$
+ remote:~/.local/share/dotfiles(master+!){1}$
The hostname is elided if not connected via SSH. The working directory with
tilde abbreviation for `$HOME` is always shown. The rest of the prompt expands
-based on context to include these elements in this order:
+based on context to include these elements, in this order:
-* Whether in a Git repository if applicable, and punctuation to show repository
- status including reference to upstreams at a glance. Subversion support can
- also be enabled (I need it at work), in which case a `git:` or `svn:` prefix
- is added appropriately.
+* Whether in a Git repository if applicable,
+
+* The current version control branch, tag, or commit/revision if applicable,
+ and punctuation to show repository status including reference to upstreams at
+ a glance. Subversion support can also be enabled, in which case a `git:` or
+ `svn:` prefix is added appropriately for disambiguation.
* The number of running background jobs, if non-zero.
* The exit status of the last command, if non-zero.
You can set `PROMPT_COLOR`, `PROMPT_PREFIX`, and `PROMPT_SUFFIX` too, which all
do about what you'd expect.
-If you start up Bash, Korn shell, or Z shell, and it detects that it's not your
-login shell, the prompt will display an appropriate prefix.
+If you start up GNU Bash, Korn shell, or Z shell, and that doesn't match your
+login shell, the prompt should display an appropriate prefix.
This is all managed within the `prompt` function. There's some mildly hacky
logic on `tput` codes included such that it should work correctly for most
@@ -247,7 +261,7 @@ non-POSIX features, as compatibility allows:
* `pushd()` adds a default destination of `$HOME` to the `pushd` builtin
(Bash).
* `vared()` allows interactively editing a variable with Readline, emulating a
- Zsh function I like by the same name (Bash).
+ Z shell function I like by the same name (Bash).
* `ver()` prints the current shell's version information (Bash, Korn Shell, Z
shell).
@@ -258,8 +272,8 @@ off using a stub file installed in `~/.config/bash_completion`. The majority
of the time I just want to complete paths anyway, and this makes for a quicker
startup without a lot of junk functions in my Bash namespace.
-I do make some exceptions with completions defined in `.bash_completion.d`
-files, for things I really do get tired of typing repeatedly:
+I do make some exceptions with completions defined in files in
+`~/.bash_completion.d` 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
@@ -290,19 +304,11 @@ These are experimental; I do not like Z shell much at the moment. The files
started as a joke (`exec bash`). `zsh` shells default to having a prompt
colored cyan.
-### GnuPG
-
-The configuration for GnuPG is intended to follow [RiseUp's OpenPGP best
-practices](https://riseup.net/en/security/message-security/openpgp/best-practices).
-The configuration file is rebuilt using `mi5(1df)` and `make(1)` because it
-requires hard-coding a path to the SKS keyserver certificate authority, and
-neither tilde nor `$HOME` expansion works for this.
-
### Mutt
-My mail is kept in individual Maildirs under `~/Mail`, with `inbox` being where
-most unfiltered mail is sent. I use
-[Getmail](http://pyropus.ca/software/getmail/),
+My mail is kept in individual Maildir-format directories under `~/mail`, with
+the system mail spool in e.g. `/var/mail/tejr` being where most unfiltered new
+mail is spooled. I use [Getmail](http://pyropus.ca/software/getmail/),
[maildrop](https://www.courier-mta.org/maildrop/), and
[msmtp](https://marlam.de/msmtp/); the configurations for these are not
included here. I sign whenever I have some indication that the recipient might
@@ -328,10 +334,10 @@ Perl extensions. If you're missing functionality, try changing
### tmux
-These are just generally vi-friendly settings, not much out of the ordinary.
-Note that the configuration presently uses a hard-coded 256-color color scheme,
-and uses non-login shells, with an attempt to control the environment to stop
-shells thinking they have access to an X display.
+These are just generally vi-friendly settings, and there isn't much out of the
+ordinary. Note that the configuration presently uses a hard-coded 256-color
+color scheme, and uses non-login shells, with an attempt to control the
+environment to stop shells thinking they have access to an X display.
The shell scripts in `bin` include `tm(1df)`, a shortcut to make `attach` into
the default command if no arguments are given and sessions do already exist.
@@ -341,9 +347,19 @@ key combination to detach.
### Vim
The majority of the Vim configuration is just setting options, with a fair few
-mappings and remappings, both global and buffer-local. I try not to deviate
-too much from the Vim defaults behavior in terms of interactive behavior and
-keybindings. It's extensively commented.
+mappings and remappings, both global and buffer-local. It's extensively
+commented.
+
+#### XDG Basedirs
+
+The [XDG Base Directory
+Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)'s
+environment variables are checked on startup, and appropriate directories are
+added to the start and end of `'runtimepath'`. I use these separate
+directories for machine-local configuration, usually in `~/.config/vim`, while
+all the files that this suite installs land in `~/.vim`. Backups, swap files,
+persistent undo data, saved views, and the `viminfo` file all live under
+`XDG_CACHE_HOME`, normally `~/.cache/vim`.
#### Filetypes
@@ -355,45 +371,47 @@ filetypes in custom `ftdetect` rules.
#### Plugins
If the logic for doing something involves more than a few lines or any
-structures like functions, I like to implement it as a plugin in
-`~/.vim/plugin` and/or `~/.vim/autoload`, with documentation for each in
-`~/.vim/doc`.
+structures like functions that can be decoupled from `$MYVIMRC`, I like to
+implement it as a plugin in `~/.vim/plugin` and/or `~/.vim/autoload`, with
+documentation for each in `~/.vim/doc`.
They eventually get either discarded if I stop using them, or spun off into
-their own repositories if I don't, and added to this repository as submodules
-under `vim/bundle` instead. Some of them I upload to
+their own repositories and added to this repository as submodules under
+`vim/bundle` if I don't. Some of them I upload to
[vim.org](https://www.vim.org/account/profile.php?user_id=73687).
#### Filetype plugins
I apply some replacement or supplementary configuration specific to file types
I often edit in `~/.vim` and `~/.vim/after`, in the `ftplugin`, `indent`, and
-`syntax` subdirectories. Some of these filetype plugins or extensions will
-also eventually be removed to be separately distributed, and installed via
+`syntax` subdirectories. Some of these filetype plugins or extensions may also
+eventually be removed to be separately distributed, and installed via
submodules instead.
#### Compilers
I define a few of my own `:compiler` scripts for `~/.vim/compiler` to check and
-lint appropriate filetypes. I bind checking--"does it run?"--and linting--"is
-it good?"--with separate local leader maps; for example, for `perl` filetypes,
+lint appropriate filetypes. I bind checking---"does it run?"---and linting---"is
+it good?"---with separate local leader maps; for example, for `perl` filetypes,
`<LocalLeader>c` switches `makeprg` to `perl -c` for checking, and
`<LocalLeader>l` to `perlcritic` for linting.
#### No Neovim support
The configuration doesn't explicitly support Neovim, although most of it will
-probably work.
+probably work; you would probably just comment out the settings for a few of
+the removed options.
Scripts
-------
Where practical, I make short scripts into POSIX (but not Bourne) `sh(1)`,
`awk(1)`, or `sed(1)` scripts in `~/.local/bin`. I try to use shell functions
-only when I actually need to, which tends to be when I need to tinker with the
-namespace of the user's current shell.
+only when I actually need to, which tends to be when I need to change the state
+of the user's current shell, or to limit a change in behavior only to
+interactive shells.
-Installed by the `install-bin` target:
+These scripts are installed by the `install-bin` target:
* Three SSH-related scripts:
* `sls(1df)` prints hostnames read from a `ssh_config(5)` file. It uses
@@ -541,6 +559,7 @@ Installed by the `install-bin` target:
* `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.
+* `msc(1df)` crudely counts messages in an mbox.
* `mw(1df)` prints alphabetic space-delimited words from the input one per
line.
* `oii(1df)` runs a command on input only if there is any.
@@ -562,6 +581,7 @@ Installed by the `install-bin` target:
[`plenv`](https://github.com/tokuhirom/plenv), filters out any modules in
`~/.plenv/non-cpan-modules`, and updates them all.
* `pwg(1df)` generates just one decent password with `pwgen(1)`.
+* `qat(1df)` disables `stty echo` for the duration of a paste.
* `rep(1df)` repeats a command a given number of times.
* `rgl(1df)` is a very crude interactive `grep(1)` loop.
* `shb(1df)` attempts to build shebang lines for scripts from the system paths.
@@ -615,16 +635,15 @@ There's some silly stuff in `install-games`:
Manuals
-------
-The `install-bin` and `install-games` targets install manuals for each script
-they install. If you want to use the manuals, you may need to add
-`~/.local/share/man` to your `~/.manpath` or `/etc/manpath` configuration,
-depending on your system.
+The `install-bin` and `install-games` targets install manuals for each script.
+If you want to read the manuals, you may need to add `~/.local/share/man` to
+your `~/.manpath` or `/etc/manpath` configuration, depending on your system.
Testing
-------
You can check that both sets of shell scripts are syntactically correct with
-`make check-bash`, `make check-sh`, or `make check` for everything including
+`make check-bash` or `make check-sh`, or `make check` for everything including
the scripts in `bin` and `games`. There's no proper test suite for the actual
functionality (yet).
diff --git a/TABS.md b/TABS.md
index 105d89d4..80c81294 100644
--- a/TABS.md
+++ b/TABS.md
@@ -6,12 +6,12 @@ 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' \
+ 'for f;do unexpand -t4 "$f">"$f".tmp;mv "$f".tmp "$f";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' \
+ 'for f;do unexpand -t2 "$f">"$f".tmp;mv "$f".tmp "$f";done' \
_ {} +
If you have GNU `unexpand(1)` and can add `--first-only` to each of those
diff --git a/VERSION b/VERSION
index 9375bb0b..1cd3bea5 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v8.13.0
-Sun, 16 Feb 2020 03:09:30 +0000
+tejr dotfiles v10.1.0
+Fri, 03 Jul 2020 13:07:45 +0000
diff --git a/X/sxhkdrc b/X/sxhkdrc
index 7816208f..9d9884c9 100644
--- a/X/sxhkdrc
+++ b/X/sxhkdrc
@@ -1,47 +1,47 @@
super + Return
- urxvtcd
+ urxvtcd
super + control + Return
- urxvtcd -e sh
+ urxvtcd -e sh
super + shift + Return
- urxvtcd -e ksh
+ urxvtcd -e ksh
super + alt + Return
- urxvtcd -e zsh
+ urxvtcd -e zsh
super + b
- br
+ br
super + d
- dmenu_run
+ dmenu_run
super + g
- xgoc
+ xgoc
super + i
- gimp
+ gimp
super + m
- urxvtcd -e tm
+ urxvtcd -e tm
super + p
- dmp
+ dmp
super + v
- urxvtcd -e "$VISUAL"
+ urxvtcd -e "$VISUAL"
super + slash
- i3lock --color=#000000 --image ~/.i3/lock.png --nofork
+ i3lock --color=#000000 --image ~/.i3/lock.png --nofork
XF86AudioMute
- amixer -q sset Master toggle
+ amixer -q sset Master toggle
XF86AudioRaiseVolume
- amixer -q sset Master 5%+ unmute
+ amixer -q sset Master 5%+ unmute
XF86AudioLowerVolume
- amixer -q sset Master 5%- unmute
+ amixer -q sset Master 5%- unmute
XF86Calculator
- urxvtcd -e bcq
+ urxvtcd -e bcq
diff --git a/bash/bash_completion.d/keep.bash b/bash/bash_completion.d/keep.bash
index 4b479eca..8bb4615f 100644
--- a/bash/bash_completion.d/keep.bash
+++ b/bash/bash_completion.d/keep.bash
@@ -44,7 +44,7 @@ _keep() {
fi
# Build list of kept names
- bashkeep=${BASHKEEP:-"$HOME"/.bashkeep.d}
+ bashkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/bashkeep
for keep in "$bashkeep"/"$2"*.bash ; do
# Skip directories
! [[ -d $keep ]] || continue
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash
index 6796aae7..2e2424a3 100644
--- a/bash/bashrc.d/keep.bash
+++ b/bash/bashrc.d/keep.bash
@@ -29,7 +29,7 @@ keep() {
# Figure out the directory to which we're reading and writing these scripts
local bashkeep
- bashkeep=${BASHKEEP:-"$HOME"/.bashkeep.d}
+ bashkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/bashkeep
mkdir -p -- "$bashkeep" || return
# Parse options
@@ -140,7 +140,7 @@ EOF
}
# Load any existing scripts in bashkeep
-for bashkeep in "${BASHKEEP:-"$HOME"/.bashkeep.d}"/*.bash ; do
+for bashkeep in "${XDG_DATA_HOME:-"$HOME"/.local/share}"/bashkeep/*.bash ; do
[[ -e $bashkeep ]] || continue
source "$bashkeep"
done
diff --git a/bin/msc.sh b/bin/msc.sh
new file mode 100755
index 00000000..051f104a
--- /dev/null
+++ b/bin/msc.sh
@@ -0,0 +1,12 @@
+# Crudely but quickly count mail in the user's inbox, if we can find it
+username=$(id -nu)
+if [ "$#" -eq 0 ] ; then
+ set -- "$MAIL" /var/mail/"$username" /var/spool/mail/"$username"
+fi
+for path do
+ [ -e "$path" ] || continue
+ grep -ch -- '^From ' "$path"
+ exit
+done
+printf >&2 'Couldn'\''t find user mail spool; provide it as an argument...?\n'
+exit 1
diff --git a/bin/phpcsff.mi5 b/bin/phpcsff.mi5
index 49f00759..49f00759 100755..100644
--- a/bin/phpcsff.mi5
+++ b/bin/phpcsff.mi5
diff --git a/bin/qat.sh b/bin/qat.sh
new file mode 100644
index 00000000..31f5e8dd
--- /dev/null
+++ b/bin/qat.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+restore() {
+ if [ -n "$stty" ] ; then
+ stty "$stty"
+ fi
+}
+trap restore EXIT
+if [ -t 0 ] ; then
+ stty=$(stty -g)
+ stty -echo
+fi
+cat
diff --git a/bin/urlmt.sh b/bin/urlmt.sh
index cd71b0fd..69bef5f7 100644
--- a/bin/urlmt.sh
+++ b/bin/urlmt.sh
@@ -1,8 +1,10 @@
# Get the MIME type for a given URL
-urlh "$1" Content-Type |
-
-# Use last line only, remove any charset suffix
-sed '
-$!d
-s/;.*//
-'
+self=urlmt
+if [ "$#" -ne 1 ] || [ -z "$1" ] ; then
+ printf >&2 '%s: Need a single URL\n' \
+ "$self"
+ exit 2
+fi
+url=$1
+curl --head --output /dev/null --write-out '%{content_type}\n' "$url" |
+ awk -F\; '{print $1}'
diff --git a/check/sh.sh b/check/sh.sh
index 4e816337..c3ff856a 100644
--- a/check/sh.sh
+++ b/check/sh.sh
@@ -1,9 +1,9 @@
set \
sh/profile \
- sh/profile.d/*.sh \
sh/shinit \
sh/shrc \
- sh/shrc.d/*.sh
+ */profile.d/*.sh \
+ */shrc.d/*.sh
for sh do
sh -n -- "$sh" || exit
done
diff --git a/finger/pgpkey b/finger/pgpkey
index 1f62c961..613c2623 100644
--- a/finger/pgpkey
+++ b/finger/pgpkey
@@ -1,4 +1,4 @@
-pub rsa4096 2013-03-12 [SC] [expires: 2020-05-16]
+pub rsa4096 2013-03-12 [SC] [expires: 2020-07-31]
FA09 C06E 1B67 0CD0 B2F5 DE60 C142 86EA 77BB 8872
uid [ultimate] Thomas Ryder (tyrmored, tejr) <tom@sanctum.geek.nz>
uid [ultimate] Thomas Ryder <tejr@echo-n.nz>
@@ -6,9 +6,6 @@ uid [ultimate] Thomas Ryder <secretary@plug.org.nz>
uid [ultimate] Thomas Ryder (TEJR) <tejr@cpan.org>
uid [ultimate] Thomas Ryder <tyrmored@inspire.net.nz>
uid [ultimate] Thomas Ryder <tej.ryder@gmail.com>
-sub rsa4096 2013-03-12 [E] [expires: 2020-05-16]
- 9DF1 A89F F8D9 70AF 3265 C882 96C2 CD91 E67A C61D
-sub rsa4096 2013-03-12 [S] [expires: 2020-05-16]
- 3179 90A1 4597 A1FC F82D 953A B5AF 5F89 2592 6609
-sub rsa4096 2019-08-06 [A] [expires: 2020-05-16]
- 42AE 569D 6162 7C52 03B0 74ED D58F F1F0 7E90 9B49
+sub rsa4096 2013-03-12 [E] [expires: 2020-07-31]
+sub rsa4096 2013-03-12 [S] [expires: 2020-07-31]
+sub rsa4096 2019-08-06 [A] [expires: 2020-07-31]
diff --git a/finger/plan b/finger/plan
index e882c433..b4562cd8 100644
--- a/finger/plan
+++ b/finger/plan
@@ -1,3 +1,3 @@
-"I am his Highness' dog at Kew.
- Pray tell me, Sir: whose dog are you?"
- -- Pope
+> I am his Highness' dog at Kew.
+> Pray tell me, Sir: whose dog are you?
+ -- Pope
diff --git a/games/xyzzy.sh b/games/xyzzy.sh
index 5cc03278..ebf3959a 100644
--- a/games/xyzzy.sh
+++ b/games/xyzzy.sh
@@ -1,6 +1,11 @@
# ADVENTURE
-if [ -e "$HOME"/.xyzzy ] ; then
- printf >&2 '%s\n' 'Nothing happens.'
- exit 1
+dir=${XDG_CONFIG_HOME:-$HOME/.config}/xyzzy
+if ! [ -d "$dir" ] ; then
+ mkdir -- "$dir" || exit
fi
-printf '%s\n' 'I see no cave here.' > "$HOME"/.xyzzy
+if [ -e "$dir"/dest ] ; then
+ printf >&2 'Nothing happens.\n'
+else
+ printf 'I see no cave here.\n' > "$dir"/dest
+fi
+exit 1
diff --git a/git/gitconfig.mi5 b/git/config.mi5
index 11b815d1..304be811 100644
--- a/git/gitconfig.mi5
+++ b/git/config.mi5
@@ -8,7 +8,7 @@
output = compact
[init]
- templateDir = ~/.git-template
+ templateDir = <% XDG_CONFIG_HOME %>/git/template
[log]
date = local
@@ -26,7 +26,6 @@
[sendemail]
confirm = compose
- smtpServer = <% SENDMAIL %>
[status]
short = true
@@ -34,4 +33,4 @@
[user]
name = <% NAME %>
email = <% EMAIL %>
- signingKey = <% KEY %>
+ signingKey = <% GPG_KEYID %>
diff --git a/gnupg/gpg.conf b/gnupg/gpg.conf
deleted file mode 100644
index 97c1ca77..00000000
--- a/gnupg/gpg.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# Assume I mean to encrypt to myself if no recipient is specified
-default-recipient-self
-
-# Don't use key IDs in listings, just show full fingerprints
-keyid-format none
-
-# Suppress the copyright message
-no-greeting
-
-# Don't sign pictures or other binary UID data
-only-sign-text-ids
-
-# Show fingerprints where they might not otherwise appear
-with-fingerprint
diff --git a/gnupg/profile.d/gnupg.sh.mi5 b/gnupg/profile.d/gnupg.sh.mi5
new file mode 100644
index 00000000..33a57dd0
--- /dev/null
+++ b/gnupg/profile.d/gnupg.sh.mi5
@@ -0,0 +1,3 @@
+# GPG key details
+GPG_KEYID=<% GPG_KEYID %>
+export GPG_KEYID
diff --git a/i3/config b/i3/config
index be00e590..0840f1c8 100644
--- a/i3/config
+++ b/i3/config
@@ -74,27 +74,27 @@ bindsym $mod+Shift+9 move container to workspace 9
# Mod+r resizes a container
bindsym $mod+r mode "resize"
mode "resize" {
- bindsym h resize shrink width 10 px or 10 ppt
- bindsym j resize grow height 10 px or 10 ppt
- bindsym k resize shrink height 10 px or 10 ppt
- bindsym l resize grow width 10 px or 10 ppt
- bindsym Return mode "default"
- bindsym Escape mode "default"
+ bindsym h resize shrink width 10 px or 10 ppt
+ bindsym j resize grow height 10 px or 10 ppt
+ bindsym k resize shrink height 10 px or 10 ppt
+ bindsym l resize grow width 10 px or 10 ppt
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
}
# i3bar at bottom of screen
bar {
- position bottom
- status_command i3status --config ~/.i3/status
- workspace_buttons yes
-
- colors {
- background #111111
- statusline #eeeeee
-
- focused_workspace #ffffff #285577
- active_workspace #ffffff #333333
- inactive_workspace #888888 #222222
- urgent_workspace #ffffff #900000
- }
+ position bottom
+ status_command i3status --config ~/.config/i3/status
+ workspace_buttons yes
+
+ colors {
+ background #111111
+ statusline #eeeeee
+
+ focused_workspace #ffffff #285577
+ active_workspace #ffffff #333333
+ inactive_workspace #888888 #222222
+ urgent_workspace #ffffff #900000
+ }
}
diff --git a/i3/status b/i3/status
index 87cf9df8..9c9b60d6 100644
--- a/i3/status
+++ b/i3/status
@@ -5,13 +5,13 @@ order += "tztime local"
order += "battery 0"
load {
- format = "%1min/%5min/%15min"
+ format = "%1min/%5min/%15min"
}
tztime local {
- format = "%Y-%m-%d %H:%M:%S"
+ format = "%Y-%m-%d %H:%M:%S"
}
battery 0 {
- format = "%status %percentage %remaining %emptytime"
- path = "/sys/class/power_supply/BAT%d/uevent"
- low_threshold = 15
+ format = "%status %percentage %remaining %emptytime"
+ path = "/sys/class/power_supply/BAT%d/uevent"
+ low_threshold = 15
}
diff --git a/install/conf.sh b/install/conf.sh
index f50cde73..1634f0cb 100644
--- a/install/conf.sh
+++ b/install/conf.sh
@@ -1,10 +1,11 @@
-# Read extra targets from an optional ~/.dotfiles.conf file
-if [ -e "$HOME"/.dotfiles.conf ] ; then
+# Read extra targets from an optional configuration file
+conf=${XDG_CONFIG_HOME:-"$HOME"/.config}/dotfiles/config
+if [ -e "$conf" ] ; then
while read -r line ; do
case $line in
'#'*|'') ;;
*) set -- "$@" "$line" ;;
esac
- done < "$HOME"/.dotfiles.conf
+ done < $conf
fi
make install "$@"
diff --git a/install/helptags.vim b/install/helptags.vim
new file mode 100644
index 00000000..865f32db
--- /dev/null
+++ b/install/helptags.vim
@@ -0,0 +1,2 @@
+helptags $HOME/.vim/doc
+quit
diff --git a/ksh/kshrc.d/keep.ksh b/ksh/kshrc.d/keep.ksh
index c1546deb..f61a7a4d 100644
--- a/ksh/kshrc.d/keep.ksh
+++ b/ksh/kshrc.d/keep.ksh
@@ -40,7 +40,7 @@ function keep {
# Figure out the directory to which we're reading and writing these scripts
typeset kshkeep
- kshkeep=${KSHKEEP:-"$HOME"/.kshkeep.d}
+ kshkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/kshkeep
mkdir -p -- "$kshkeep" || return
# Parse options
@@ -152,7 +152,7 @@ EOF
}
# Load any existing scripts in kshkeep
-for kshkeep in "${KSHKEEP:-"$HOME"/.kshkeep.d}"/*.ksh ; do
+for kshkeep in "${XDG_DATA_HOME:-"$HOME"/.local/share}"/kshkeep/*.ksh ; do
[[ -e $kshkeep ]] || continue
source "$kshkeep"
done
diff --git a/less/profile.d/less.sh b/less/profile.d/less.sh
new file mode 100644
index 00000000..75fd1bf0
--- /dev/null
+++ b/less/profile.d/less.sh
@@ -0,0 +1,2 @@
+LESSKEY=${XDG_CONFIG_HOME:-$HOME/.config}/less/key
+export LESSKEY
diff --git a/lint/sh.sh b/lint/sh.sh
index b0d28e5d..5884a1ed 100644
--- a/lint/sh.sh
+++ b/lint/sh.sh
@@ -1,7 +1,7 @@
set \
sh/profile \
- sh/profile.d/*.sh \
sh/shinit \
sh/shrc \
- sh/shrc.d/*.sh
+ */profile.d/*.sh \
+ */shrc.d/*.sh
shellcheck -e SC1090 -s sh -- "$@" || exit
diff --git a/man/man1/msc.1df b/man/man1/msc.1df
new file mode 100644
index 00000000..b8aadb11
--- /dev/null
+++ b/man/man1/msc.1df
@@ -0,0 +1,12 @@
+.TH MSC 1df "May 2020" "Manual page for msc"
+.SH NAME
+.B msc
+\- count the messages in a user's mail spool or other mbox
+.SH SYNOPSIS
+.B msc
+.SH DESCRIPTION
+.B msc
+counts the messages in the given mailboxes, or the user mail spool if not
+provided and it can be found in the MAIL env var or at common paths.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/phpcsff.1df b/man/man1/phpcsff.1df
new file mode 100644
index 00000000..a6364367
--- /dev/null
+++ b/man/man1/phpcsff.1df
@@ -0,0 +1,21 @@
+.TH PHPCSFF 1df "April 2020" "Manual page for phpcsff"
+.SH NAME
+.B phpcsff
+\- use php-cs-fixed as a source filter
+.SH SYNOPSIS
+.B phpcsff
+source.php
+.br
+.B phpcsff
+\< source.php
+.br
+.B phpcsff
+source.php > source.fixed.php
+.br
+.SH DESCRIPTION
+.B phpcsff
+allows the use of PHP linter php-cs-fixer as a stream filter, to work around its fixed edit-in-place behaviour using temporary files. It's intended for use as an 'equalprg' in Vim, but it might be useful in other circumstances too.
+.SH SEE ALSO
+<https://github.com/FriendsOfPHP/PHP-CS-Fixer>
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man1/qat.1df b/man/man1/qat.1df
new file mode 100644
index 00000000..d7466b3a
--- /dev/null
+++ b/man/man1/qat.1df
@@ -0,0 +1,19 @@
+.TH QAT 1df "May 2020" "Manual page for qat"
+.SH NAME
+.B qat
+\- quiet cat for terminal pastes
+.SH SYNOPSIS
+.B qat
+| wc -l
+.br
+.B qat
+| grep pattern
+.SH DESCRIPTION
+.B qat
+switches the echo feature for stty(1) off for the duration of a cat(1). You
+can use this to paste stuff into a pipeline without the terminal echoing it
+back at you.
+.SH SEE ALSO
+stty(1)
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man6/xyzzy.6df b/man/man6/xyzzy.6df
index 7270b95d..0d928b45 100644
--- a/man/man6/xyzzy.6df
+++ b/man/man6/xyzzy.6df
@@ -8,7 +8,7 @@
Invoking
.B xyzzy
in a directory will tag that directory as a target for teleportation, writing
-its name to the file ~/.xyzzy. Typing it again at any given point will then
-change into that marked directory.
+its name to the file $XDG_CONFIG_HOME/xyzzy/dest. Typing it again at any given
+point will then change into that marked directory.
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df
index 3e70c142..40e4dedd 100644
--- a/man/man7/dotfiles.7df
+++ b/man/man7/dotfiles.7df
@@ -9,18 +9,19 @@ This is my personal repository of configuration files and scripts for
machines.
.PP
This repository began as a simple way to share Vim and tmux
-configuration, but over time a lot of scripts and shell configuration
-have been added, making it into a personal suite of custom Unix tools.
+configuration, but a lot of scripts and shell configuration have been
+added over time, making it into a personal suite of custom Unix tools.
.SS Installation
.IP
.nf
\f[C]
-$\ git\ clone\ https://sanctum.geek.nz/code/dotfiles.git\ ~/.dotfiles
-$\ cd\ ~/.dotfiles
+$\ mkdir\ \-p\ ~/.local/share
+$\ git\ clone\ https://sanctum.geek.nz/code/dotfiles.git\ ~/.local/share/dotfiles
+$\ cd\ ~/.local/share/dotfiles
$\ git\ submodule\ init
$\ git\ submodule\ update
$\ make
-$\ make\ \-n\ install
+$\ make\ \-n\ install\ \ #\ Check\ output\ carefully
$\ make\ install
\f[]
.fi
@@ -28,12 +29,12 @@ $\ make\ install
For the default \f[C]all\f[] target, you'll need a POSIX\-fearing
userland, including \f[C]make(1)\f[] and \f[C]m4(1)\f[].
.PP
-The installation \f[C]Makefile\f[] will overwrite things standing in the
-way of its installed files without backing them up, so read the output
-of \f[C]make\ \-n\ install\f[] before running \f[C]make\ install\f[] to
-make sure you aren't going to lose anything unexpected.
-If you're still not sure, install it in a temporary directory so you can
-explore:
+The installation \f[C]Makefile\f[] overwrites things standing in the way
+of its installed files without backing them up, so read the output of
+\f[C]make\ \-n\ install\f[] before running \f[C]make\ install\f[]
+carefully, to make sure you aren't going to lose anything unexpected.
+If you're still not sure, install it in a temporary directory first, so
+you can explore:
.IP
.nf
\f[C]
@@ -48,8 +49,6 @@ their dependencies:
.IP \[bu] 2
\f[C]install\-bin\f[]
.IP \[bu] 2
-\f[C]install\-bin\-man\f[]
-.IP \[bu] 2
\f[C]install\-curl\f[]
.IP \[bu] 2
\f[C]install\-ex\f[]
@@ -62,13 +61,15 @@ their dependencies:
.IP \[bu] 2
\f[C]install\-login\-shell\f[]
.IP \[bu] 2
+\f[C]install\-man\f[]
+.IP \[bu] 2
\f[C]install\-readline\f[]
.IP \[bu] 2
\f[C]install\-vim\f[]
.PP
-The \f[C]install\-login\-shell\f[] looks at your \f[C]SHELL\f[]
-environment variable and tries to figure out which shell's configuration
-files to install, falling back on \f[C]install\-sh\f[].
+The \f[C]install\-login\-shell\f[] target looks at your \f[C]SHELL\f[]
+environment variable, and tries to figure out which shell's
+configuration files to install, falling back on \f[C]install\-sh\f[].
.PP
The remaining files can be installed with the other \f[C]install\-*\f[]
targets.
@@ -76,20 +77,20 @@ Try \f[C]awk\ \-f\ bin/mftl.awk\ Makefile\f[] in the project's root
directory to see a list.
.SS Configuration
.PP
-To save a set of \f[C]make\f[] targets useful for a specific user or
-host, you can save them in a newline\-separated file
-\f[C]~/.dotfiles.conf\f[], and install using that with the special
-\f[C]install\-conf\f[] target.
-This can include variable settings, too:
+To keep a set of \f[C]make\f[] targets useful for a specific user or
+host, you can list them in a newline\-separated file
+\f[C]~/.config/dotfiles/config\f[], and install using that with the
+special \f[C]install\-conf\f[] target.
+This can include macro settings for the \f[C]Makefile\f[], too:
.IP
.nf
\f[C]
$\ cd
-$\ cat\ .dotfiles.conf
+$\ cat\ .config/dotfiles/config
install\-bash
install\-bin
EMAIL=you\@example.com
-$\ make\ \-C\ .dotfiles\ install\-conf
+$\ make\ \-C\ .local/share/dotfiles\ install\-conf
\f[]
.fi
.SS Tools
@@ -100,7 +101,7 @@ Bourne\-style POSIX shells, sharing a \f[C]\&.profile\f[], an
\f[C]ENV\f[] file, and some helper functions:
.RS 2
.IP \[bu] 2
-GNU Bash (https://www.gnu.org/software/bash/) (3.0 or higher)
+GNU Bash (https://www.gnu.org/software/bash/) (v3.0 or newer)
.IP \[bu] 2
Korn shell (http://www.kornshell.com/) (\f[C]ksh93\f[], \f[C]pdksh\f[],
\f[C]mksh\f[])
@@ -108,98 +109,109 @@ Korn shell (http://www.kornshell.com/) (\f[C]ksh93\f[], \f[C]pdksh\f[],
Z shell (https://www.zsh.org/)
.RE
.IP \[bu] 2
-Abook (http://abook.sourceforge.net/) \[en] curses address book program
+Abook (http://abook.sourceforge.net/)\[em]curses address book program
.IP \[bu] 2
-cURL (https://curl.haxx.se/) \[en] Command\-line tool for transferring
+cURL (https://curl.haxx.se/)\[em]Command\-line tool for transferring
data with URL syntax
.IP \[bu] 2
-Dillo (https://www.dillo.org/) \[en] A lightweight web browser
+Dillo (https://www.dillo.org/)\[em]A lightweight web browser
.IP \[bu] 2
-Dunst (https://dunst-project.org/) \[en] A lightweight X11 notification
+Dunst (https://dunst-project.org/)\[em]A lightweight X11 notification
daemon that works with \f[C]libnotify\f[]
.IP \[bu] 2
-\f[C]finger(1)\f[] \[en] User information lookup program
+\f[C]finger(1)\f[]\[em]User information lookup program
.IP \[bu] 2
-Git (https://git-scm.com/) \[en] Distributed version control system
+Git (https://git-scm.com/)\[em]Distributed version control system
.IP \[bu] 2
-GNU Emacs (https://www.gnu.org/software/emacs/) \[en] Extensible text
+GNU Emacs (https://www.gnu.org/software/emacs/)\[em]Extensible text
editor
.IP \[bu] 2
-GnuPG (https://www.gnupg.org/) \[en] GNU Privacy Guard, for private
+GnuPG (https://www.gnupg.org/)\[em]GNU Privacy Guard, for private
communication and file encryption
.IP \[bu] 2
-GTK+ (https://www.gtk.org/) \[en] GIMP Toolkit, for graphical user
+GTK+ (https://www.gtk.org/)\[em]GIMP Toolkit, for graphical user
interface elements
.IP \[bu] 2
-i3 (https://i3wm.org/) \[en] Tiling window manager
+i3 (https://i3wm.org/)\[em]Tiling window manager
.IP \[bu] 2
-less (https://www.gnu.org/software/less/) \[en] Terminal pager
+less (https://www.gnu.org/software/less/)\[em]Terminal pager
.IP \[bu] 2
-mpv (https://mpv.io/) \[en] Media player
+mpv (https://mpv.io/)\[em]Media player
.IP \[bu] 2
-Mutt (http://www.mutt.org/) \[en] Terminal mail user agent
+Mutt (http://www.mutt.org/)\[em]Terminal mail user agent
.IP \[bu] 2
-\f[C]mysql(1)\f[] (https://linux.die.net/man/1/mysql) \[en]
-Command\-line MySQL client
+\f[C]mysql(1)\f[] (https://linux.die.net/man/1/mysql)\[em]Command\-line
+MySQL client
.IP \[bu] 2
-Ncmpcpp (https://rybczak.net/ncmpcpp/) \[en] ncurses music player client
+Ncmpcpp (https://rybczak.net/ncmpcpp/)\[em]ncurses music player client
.IP \[bu] 2
-Newsboat (https://newsboat.org/) \[en] Terminal RSS/Atom feed reader
+Newsboat (https://newsboat.org/)\[em]Terminal RSS/Atom feed reader
.IP \[bu] 2
-\f[C]psql(1)\f[] (https://linux.die.net/man/1/psql) \[en] Command\-line
+\f[C]psql(1)\f[] (https://linux.die.net/man/1/psql)\[em]Command\-line
PostgreSQL client
.IP \[bu] 2
-Perl::Critic (http://perlcritic.com/) \[en] static source code analysis
+Perl::Critic (http://perlcritic.com/)\[em]static source code analysis
engine for Perl
.IP \[bu] 2
-Perl::Tidy (http://perltidy.sourceforge.net/) \[en] Perl source code
-reformatter
+Perl::Tidy (http://perltidy.sourceforge.net/)\[em]reformats Perl source
+code
.IP \[bu] 2
-Readline (https://tiswww.case.edu/php/chet/readline/rltop.html) \[en]
-GNU library for user input used by Bash, MySQL, and others
+Readline (https://tiswww.case.edu/php/chet/readline/rltop.html)\[em]GNU
+library for user input used by Bash, MySQL, and others
.IP \[bu] 2
-rxvt\-unicode (http://software.schmorp.de/pkg/rxvt-unicode.html) \[en]
-Fork of the rxvt terminal emulator with Unicode support
+rxvt\-unicode (http://software.schmorp.de/pkg/rxvt-unicode.html)\[em]Fork
+of the rxvt terminal emulator with Unicode support
.IP \[bu] 2
-Subversion (https://subversion.apache.org/) \[en] Apache Subversion, a
+Subversion (https://subversion.apache.org/)\[em]Apache Subversion, a
version control system
.IP \[bu] 2
-tidy (http://www.html-tidy.org/) \[en] HTML/XHTML linter and tidier
+tidy (http://www.html-tidy.org/)\[em]HTML/XHTML linter and tidier
.IP \[bu] 2
-tmux (https://tmux.github.io/) \[en] Terminal multiplexer similar to GNU
+tmux (https://tmux.github.io/)\[em]Terminal multiplexer similar to GNU
Screen
.IP \[bu] 2
-Vim (https://www.vim.org/) \[en] Vi IMproved, a text editor
+Vim (https://www.vim.org/)\[em]Vi IMproved, a text editor
.IP \[bu] 2
-X11 (https://www.x.org/wiki/) \[en] Windowing system with network
+X11 (https://www.x.org/wiki/)\[em]Windowing system with network
transparency for Unix
.PP
-The configurations for shells, GnuPG, Mutt, tmux, and Vim are the most
-expansive, and most likely to be of interest.
-The i3 configuration is mostly changed to make window switching behave
-like Vim windows and tmux panes do, and there's a fair few resources
-defined for rxvt\-unicode.
+There is also some slightly customized support for multi\-version
+environment management for three major scripting languages:
+.IP \[bu] 2
+plenv (https://github.com/tokuhirom/plenv)\[em]Perl
+.IP \[bu] 2
+pyenv (https://github.com/pyenv/pyenv)\[em]Python
+.IP \[bu] 2
+rbenv (https://github.com/rbenv/rbenv)\[em]Ruby
+.PP
+The configurations for shells, Mutt, tmux, and Vim are the most likely
+to be of interest.
+The i3 configuration is limited mainly to changing window switching key
+bindings to match Vim's.
+There are a fair few resources defined for rxvt\-unicode.
.SS Shell
.PP
-My \f[C]\&.profile\f[] and other files in \f[C]sh\f[] are written in
-POSIX shell script, so they should work in most \f[C]sh(1)\f[]
-implementations.
-Individual scripts called by \f[C]\&.profile\f[] are saved in
-\f[C]\&.profile.d\f[] and iterated on login for ease of management.
+On GNU/Linux, I use Bash; on *BSD, I use some variant of Korn Shell,
+preferably \f[C]ksh93\f[] if it's available.
+.SS POSIX core
+.PP
+My \f[C]~/.profile\f[] and other files in \f[C]sh\f[] are written in
+POSIX shell script, so they \f[I]should\f[] work in most
+POSIX\-conforming \f[C]sh(1)\f[] implementations.
+Please email me if you find a case where they don't!
+.PP
+Further shell snippets to run on login are sourced from
+\f[C]~/.profile.d\f[] by \f[C]~/.profile\f[].
Most of these boil down to exporting variables appropriate to the system
and the software it has available.
.PP
-Configuration that should be sourced for all POSIX\-fearing interactive
-shells is kept in \f[C]~/.shrc\f[], with subscripts read from
-\f[C]~/.shrc.d\f[].
-There's a shim in \f[C]~/.shinit\f[] to act as \f[C]ENV\f[].
-I make an effort to target POSIX for my functions and scripts where I
-can so that the same files can be loaded for all shells.
-.PP
-On GNU/Linux I use Bash, on BSD I use some variant of Korn Shell,
-preferably \f[C]ksh93\f[] if it's available.
+Configuration that should be sourced for all conforming
+\f[I]interactive\f[] shells is kept in \f[C]~/.shrc\f[], with subscripts
+read from \f[C]~/.shrc.d\f[].
+There's a \f[C]~/.shinit\f[] shim to act as \f[C]ENV\f[].
+.SS GNU Bash
.PP
-My Bash is written to work with any version 3.0 or
+My Bash scripts are written to work with GNU Bash v3.0 or
newer (https://wiki.bash-hackers.org/scripting/bashchanges).
This is why I use older syntax for certain things such as appending
items to arrays:
@@ -210,8 +222,8 @@ array[${#array[\@]}]=$item
\f[]
.fi
.PP
-Compare this to the much nicer syntax available since 3.1\-alpha1, which
-actually works for arrays with sparse indices, unlike the above syntax:
+This doesn't work for arrays with sparse indices; compare this to the
+much nicer syntax available since 3.1\-alpha1, which does:
.IP
.nf
\f[C]
@@ -219,10 +231,10 @@ array+=("$item")
\f[]
.fi
.PP
-Where I do use features that are only available in versions of Bash
-newer than 3.0, such as newer \f[C]shopt\f[] options or
-\f[C]PROMPT_DIRTRIM\f[], they are only run after testing
-\f[C]BASH_VERSINFO\f[] appropriately.
+I do use some features that are only available in versions after v3.0,
+such as newer \f[C]shopt\f[] options like \f[C]dirspell\f[], or
+variables like \f[C]PROMPT_DIRTRIM\f[].
+These are set only after testing \f[C]BASH_VERSINFO\f[] appropriately.
.SS Prompt
.PP
A terminal session with my prompt looks something like this:
@@ -230,16 +242,16 @@ A terminal session with my prompt looks something like this:
.nf
\f[C]
~$\ ssh\ remote
-remote:~$\ cd\ .dotfiles
-remote:~/.dotfiles(master+!)$\ git\ status
+remote:~$\ cd\ .local/share/dotfiles
+remote:~/.local/share/dotfiles(master+!)$\ git\ status
\ M\ README.md
M\ \ bash/bashrc.d/prompt.bash
A\ \ init
-remote:~/.dotfiles(master+!)$\ foobar
+remote:~/.local/share/dotfiles(master+!)$\ foobar
foobar:\ command\ not\ found
-remote:~/.dotfiles(master+!)<127>$\ sleep\ 5\ &
+remote:~/.local/share/dotfiles(master+!)<127>$\ sleep\ 5\ &
[1]\ 28937
-remote:~/.dotfiles(master+!){1}$
+remote:~/.local/share/dotfiles(master+!){1}$
\f[]
.fi
.PP
@@ -247,12 +259,15 @@ The hostname is elided if not connected via SSH.
The working directory with tilde abbreviation for \f[C]$HOME\f[] is
always shown.
The rest of the prompt expands based on context to include these
-elements in this order:
+elements, in this order:
+.IP \[bu] 2
+Whether in a Git repository if applicable,
.IP \[bu] 2
-Whether in a Git repository if applicable, and punctuation to show
-repository status including reference to upstreams at a glance.
-Subversion support can also be enabled (I need it at work), in which
-case a \f[C]git:\f[] or \f[C]svn:\f[] prefix is added appropriately.
+The current version control branch, tag, or commit/revision if
+applicable, and punctuation to show repository status including
+reference to upstreams at a glance.
+Subversion support can also be enabled, in which case a \f[C]git:\f[] or
+\f[C]svn:\f[] prefix is added appropriately for disambiguation.
.IP \[bu] 2
The number of running background jobs, if non\-zero.
.IP \[bu] 2
@@ -261,8 +276,8 @@ The exit status of the last command, if non\-zero.
You can set \f[C]PROMPT_COLOR\f[], \f[C]PROMPT_PREFIX\f[], and
\f[C]PROMPT_SUFFIX\f[] too, which all do about what you'd expect.
.PP
-If you start up Bash, Korn shell, or Z shell, and it detects that it's
-not your login shell, the prompt will display an appropriate prefix.
+If you start up GNU Bash, Korn shell, or Z shell, and that doesn't match
+your login shell, the prompt should display an appropriate prefix.
.PP
This is all managed within the \f[C]prompt\f[] function.
There's some mildly hacky logic on \f[C]tput\f[] codes included such
@@ -380,7 +395,7 @@ shell).
\f[C]pushd\f[] builtin (Bash).
.IP \[bu] 2
\f[C]vared()\f[] allows interactively editing a variable with Readline,
-emulating a Zsh function I like by the same name (Bash).
+emulating a Z shell function I like by the same name (Bash).
.IP \[bu] 2
\f[C]ver()\f[] prints the current shell's version information (Bash,
Korn Shell, Z shell).
@@ -393,9 +408,9 @@ The majority of the time I just want to complete paths anyway, and this
makes for a quicker startup without a lot of junk functions in my Bash
namespace.
.PP
-I do make some exceptions with completions defined in
-\f[C]\&.bash_completion.d\f[] files, for things I really do get tired of
-typing repeatedly:
+I do make some exceptions with completions defined in files in
+\f[C]~/.bash_completion.d\f[] for things I really do get tired of typing
+repeatedly:
.IP \[bu] 2
Bash builtins: commands, help topics, shell options, variables, etc.
.IP \[bu] 2
@@ -431,18 +446,11 @@ All shells in this family default to a yellow prompt if detected.
These are experimental; I do not like Z shell much at the moment.
The files started as a joke (\f[C]exec\ bash\f[]).
\f[C]zsh\f[] shells default to having a prompt colored cyan.
-.SS GnuPG
-.PP
-The configuration for GnuPG is intended to follow RiseUp's OpenPGP best
-practices (https://riseup.net/en/security/message-security/openpgp/best-practices).
-The configuration file is rebuilt using \f[C]mi5(1df)\f[] and
-\f[C]make(1)\f[] because it requires hard\-coding a path to the SKS
-keyserver certificate authority, and neither tilde nor \f[C]$HOME\f[]
-expansion works for this.
.SS Mutt
.PP
-My mail is kept in individual Maildirs under \f[C]~/Mail\f[], with
-\f[C]inbox\f[] being where most unfiltered mail is sent.
+My mail is kept in individual Maildir\-format directories under
+\f[C]~/mail\f[], with the system mail spool in e.g.
+\f[C]/var/mail/tejr\f[] being where most unfiltered new mail is spooled.
I use Getmail (http://pyropus.ca/software/getmail/),
maildrop (https://www.courier-mta.org/maildrop/), and
msmtp (https://marlam.de/msmtp/); the configurations for these are not
@@ -473,8 +481,8 @@ If you're missing functionality, try changing \f[C]perl\-ext\-common\f[]
to \f[C]default\f[].
.SS tmux
.PP
-These are just generally vi\-friendly settings, not much out of the
-ordinary.
+These are just generally vi\-friendly settings, and there isn't much out
+of the ordinary.
Note that the configuration presently uses a hard\-coded 256\-color
color scheme, and uses non\-login shells, with an attempt to control the
environment to stop shells thinking they have access to an X display.
@@ -488,9 +496,20 @@ binds the same key combination to detach.
.PP
The majority of the Vim configuration is just setting options, with a
fair few mappings and remappings, both global and buffer\-local.
-I try not to deviate too much from the Vim defaults behavior in terms of
-interactive behavior and keybindings.
It's extensively commented.
+.SS XDG Basedirs
+.PP
+The XDG Base Directory
+Specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)'s
+environment variables are checked on startup, and appropriate
+directories are added to the start and end of
+\f[C]\[aq]runtimepath\[aq]\f[].
+I use these separate directories for machine\-local configuration,
+usually in \f[C]~/.config/vim\f[], while all the files that this suite
+installs land in \f[C]~/.vim\f[].
+Backups, swap files, persistent undo data, saved views, and the
+\f[C]viminfo\f[] file all live under \f[C]XDG_CACHE_HOME\f[], normally
+\f[C]~/.cache/vim\f[].
.SS Filetypes
.PP
I define my own \f[C]filetype.vim\f[] and \f[C]scripts.vim\f[], so that
@@ -501,13 +520,14 @@ you can extend them with your favorite filetypes in custom
.SS Plugins
.PP
If the logic for doing something involves more than a few lines or any
-structures like functions, I like to implement it as a plugin in
-\f[C]~/.vim/plugin\f[] and/or \f[C]~/.vim/autoload\f[], with
-documentation for each in \f[C]~/.vim/doc\f[].
+structures like functions that can be decoupled from \f[C]$MYVIMRC\f[],
+I like to implement it as a plugin in \f[C]~/.vim/plugin\f[] and/or
+\f[C]~/.vim/autoload\f[], with documentation for each in
+\f[C]~/.vim/doc\f[].
.PP
They eventually get either discarded if I stop using them, or spun off
-into their own repositories if I don't, and added to this repository as
-submodules under \f[C]vim/bundle\f[] instead.
+into their own repositories and added to this repository as submodules
+under \f[C]vim/bundle\f[] if I don't.
Some of them I upload to
vim.org (https://www.vim.org/account/profile.php?user_id=73687).
.SS Filetype plugins
@@ -515,32 +535,33 @@ vim.org (https://www.vim.org/account/profile.php?user_id=73687).
I apply some replacement or supplementary configuration specific to file
types I often edit in \f[C]~/.vim\f[] and \f[C]~/.vim/after\f[], in the
\f[C]ftplugin\f[], \f[C]indent\f[], and \f[C]syntax\f[] subdirectories.
-Some of these filetype plugins or extensions will also eventually be
+Some of these filetype plugins or extensions may also eventually be
removed to be separately distributed, and installed via submodules
instead.
.SS Compilers
.PP
I define a few of my own \f[C]:compiler\f[] scripts for
\f[C]~/.vim/compiler\f[] to check and lint appropriate filetypes.
-I bind checking\[en]\[lq]does it run?\[rq]\[en]and linting\[en]\[lq]is
-it good?\[rq]\[en]with separate local leader maps; for example, for
+I bind checking\[em]\[lq]does it run?\[rq]\[em]and linting\[em]\[lq]is
+it good?\[rq]\[em]with separate local leader maps; for example, for
\f[C]perl\f[] filetypes, \f[C]<LocalLeader>c\f[] switches
\f[C]makeprg\f[] to \f[C]perl\ \-c\f[] for checking, and
\f[C]<LocalLeader>l\f[] to \f[C]perlcritic\f[] for linting.
.SS No Neovim support
.PP
The configuration doesn't explicitly support Neovim, although most of it
-will probably work.
+will probably work; you would probably just comment out the settings for
+a few of the removed options.
.SS Scripts
.PP
Where practical, I make short scripts into POSIX (but not Bourne)
\f[C]sh(1)\f[], \f[C]awk(1)\f[], or \f[C]sed(1)\f[] scripts in
\f[C]~/.local/bin\f[].
I try to use shell functions only when I actually need to, which tends
-to be when I need to tinker with the namespace of the user's current
-shell.
+to be when I need to change the state of the user's current shell, or to
+limit a change in behavior only to interactive shells.
.PP
-Installed by the \f[C]install\-bin\f[] target:
+These scripts are installed by the \f[C]install\-bin\f[] target:
.IP \[bu] 2
Three SSH\-related scripts:
.RS 2
@@ -847,6 +868,8 @@ into it.
.IP \[bu] 2
\f[C]motd(1df)\f[] shows the system MOTD.
.IP \[bu] 2
+\f[C]msc(1df)\f[] crudely counts messages in an mbox.
+.IP \[bu] 2
\f[C]mw(1df)\f[] prints alphabetic space\-delimited words from the input
one per line.
.IP \[bu] 2
@@ -884,6 +907,9 @@ modules in \f[C]~/.plenv/non\-cpan\-modules\f[], and updates them all.
\f[C]pwg(1df)\f[] generates just one decent password with
\f[C]pwgen(1)\f[].
.IP \[bu] 2
+\f[C]qat(1df)\f[] disables \f[C]stty\ echo\f[] for the duration of a
+paste.
+.IP \[bu] 2
\f[C]rep(1df)\f[] repeats a command a given number of times.
.IP \[bu] 2
\f[C]rgl(1df)\f[] is a very crude interactive \f[C]grep(1)\f[] loop.
@@ -980,14 +1006,14 @@ occurrence of \[lq]s\[rq] in the text on its standard input.
.SS Manuals
.PP
The \f[C]install\-bin\f[] and \f[C]install\-games\f[] targets install
-manuals for each script they install.
-If you want to use the manuals, you may need to add
+manuals for each script.
+If you want to read the manuals, you may need to add
\f[C]~/.local/share/man\f[] to your \f[C]~/.manpath\f[] or
\f[C]/etc/manpath\f[] configuration, depending on your system.
.SS Testing
.PP
You can check that both sets of shell scripts are syntactically correct
-with \f[C]make\ check\-bash\f[], \f[C]make\ check\-sh\f[], or
+with \f[C]make\ check\-bash\f[] or \f[C]make\ check\-sh\f[], or
\f[C]make\ check\f[] for everything including the scripts in
\f[C]bin\f[] and \f[C]games\f[].
There's no proper test suite for the actual functionality (yet).
diff --git a/mpd/mpdconf b/mpd/mpdconf
index e8bad4cc..8dd88810 100644
--- a/mpd/mpdconf
+++ b/mpd/mpdconf
@@ -10,6 +10,6 @@ state_file "~/.mpd/state"
sticker_file "~/.mpd/sticker.sql"
audio_output {
- type "pulse"
- name "PulseAudio"
+ type "pulse"
+ name "PulseAudio"
}
diff --git a/mutt/filters/markdown-to-html.sh b/mutt/filters/markdown-to-html.sh
new file mode 100644
index 00000000..5fe28560
--- /dev/null
+++ b/mutt/filters/markdown-to-html.sh
@@ -0,0 +1,8 @@
+printf 'text/html\n\n'
+sed 's/ $/ /;/[^ ]$/s/$/ /;s/^-- $/-- /' |
+pandoc \
+ --from markdown_strict+smart \
+ --metadata=pagetitle:HTML \
+ --standalone \
+ --to html4 |
+sed '/[—–][—–]/{s/—/---/g;s/–/--/g}'
diff --git a/mutt/mailcap b/mutt/mailcap
new file mode 100644
index 00000000..ebf86c98
--- /dev/null
+++ b/mutt/mailcap
@@ -0,0 +1,11 @@
+# Simple mailcap for a terminal-only Mutt; I generally download everything
+# anyway and deal with it on a shell, or pass it to a GUI machine.
+#
+text/html; lynx -dump -force_html %s; \
+ copiousoutput; \
+ description=HTML; \
+ nametemplate=%s.html
+application/pdf; pdftotext -layout -nopgbrk -q %s -; \
+ copiousoutput; \
+ description=PDF; \
+ nametemplate=%s.pdf
diff --git a/mutt/muttrc b/mutt/muttrc
index b61b4af6..11efc4bb 100644
--- a/mutt/muttrc
+++ b/mutt/muttrc
@@ -1,141 +1,305 @@
-# Addresses
+# If an outgoing message looks like I meant to attach something, and there
+# isn't an attachment, prompt me to make sure I haven't forgotten it.
+# I normally don't like this sort of nagging, but I'm making an exception in
+# this case, as I really do trip up on this a lot. The default pattern of just
+# 'attach' is a bit too aggressive, so I write a slightly softer one that
+# reflects the usual way I refer to attachments.
+#
+set abort_noattach = ask-no
+set abort_noattach_regexp = "attached is|(find|i've|see) attached"
+
+# Don't assume I don't want to continue editing a message if I didn't change
+# anything to it; if I want to send a message with just my signature, that's my
+# right.
+#
+unset abort_unmodified
+
+# Put the alias file in a nice XDG location, distinct from the muttrc, so that
+# we don't end up losing them each time the dotfiles are reinstalled; `man
+# 5 muttrc` points out that this file needs to be explicitly sourced, too.
+#
+set alias_file \
+ = ~/.config/mutt/aliases
+source $alias_file
+
+# Don't send terminal bells on errors, but do send them when new mail arrives,
+# because that should light up my tmux window label and/or urxvt window.
+#
+unset beep
+set beep_new
+
+# Don't prompt me for confirmation if I move messages into an existing mailbox;
+# just do it.
+#
+unset confirmappend
+
+# Switch to a subject format for forwarded messages that's more familiar to
+# most mail users.
+#
+set forward_format = 'Fw: %s'
+
+# Cache message headers for speed; this really helps.
+#
+set header_cache \
+ = ~/.cache/mutt/headers
+
+# Save command history; this saves other kinds of history as well, but all
+# I really want is to be able to run the same commands again even after I quit
+# Mutt. We can afford to keep 2^8 of these, since it's the future and all.
+#
+set history_file = \
+ ~/.cache/mutt/history
+set history = 256
+set save_history = $history
+
+# Always put a quoted copy of the whole message in a reply text for me to chop
+# up and respond to in Vim--no need to prompt me (the default does that).
+#
+set include
+
+# Tweak the index format to include spam tagging information, if any, with the
+# %H format string
+#
+set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %?H?[%H] ?%s'
+
+# Set a custom mailcap, rather than leaning on the system's
+#
+set mailcap_path = \
+ ~/.config/mutt/mailcap
+
+# When displaying messages with multiple alternatives for display, prefer any
+# plain text one, but failing that, fall back to enriched text (hey, it could
+# happen...)
+#
+alternative_order \
+ text/plain \
+ text/enriched \
+ text/html \
+ application/pdf \
+ *
+
+# Decode any text/html and application/pdf parts with .mailcap's specified
+# programs.
+#
+auto_view \
+ text/html \
+ application/pdf
+
+# Don't show any nasty little markers at the start of wrapped lines. That's
+# the sort of thing Vim cares about, if need be.
+#
+unset markers
+
+# Created mailboxes are in Maildir format everywhere I deploy this, so I may as
+# well set it in here rather than get annoyed when Mutt starts dropping files
+# in mbox format everywhere if I leave it out of muttrc.d/*.rc.
+#
+set mbox_type = Maildir
+
+# Show a few messages of the index when in pager mode to give a little context
+# around the message. I should have been doing this years ago. Oh well.
+#
+set pager_index_lines = 6
+
+# Don't move on to the next message if we're at the end of the current one just
+# because I executed <next-page>.
+#
+set pager_stop
+
+# Use the abook program for finding and completing addresses with ^T. I do use
+# the aliases system for regular correspondents, too.
+#
set query_command = 'abook --mutt-query %s'
-set reverse_name = yes
-set use_domain = yes
-set use_from = yes
-
-# Alerts
-set beep_new = yes
-
-# Attachments
-attachments +A */.*
-attachments -A text/x-vcard application/pgp.*
-attachments -A application/x-pkcs7-.*
-attachments +I text/plain
-attachments -A message/external-body
-attachments -I message/external-body
-
-# Caching
-set header_cache = '~/.cache/mutt/headers'
-
-# Colors
-color attachment brightyellow default
-color hdrdefault cyan default
-color indicator black white
-color markers brightred default
-color normal default default
-color quoted green default
-color signature cyan default
-color status default color22
-color tilde brightblack default
-color tree default default
-
-# Completion
-bind editor <Tab> complete-query
-bind editor ^T complete
-
-# Files
-set delete = ask-yes
-set move = no
-
-# Flags
-set mark_old = no
-
-# Headers
-ignore *
-unignore Date From: To Cc Subject
-hdr_order Date From: To Cc Subject
-set edit_headers = yes
-
-# Index
-set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %s'
-
-# Interaction
-set abort_unmodified = no
-set confirmappend = no
-set wait_key = no
+
+# Check with me whether I really want to quit, just in case I've hit "q" too
+# many times trying to get out of e.g. the aliases menu.
+#
set quit = ask-yes
-# Intervals
-set mail_check = 5
+# I prefer a slightly stricter pattern to match what is and isn't a quote; this
+# avoids flagging things like closing braces on new lines in code blocks as
+# quotes.
+#
+set quote_regexp = '^(>[ \t]*)+'
+
+# Don't offer to resume a postponed message when I hit <mail>; I'll use
+# <recall-message> for that.
+#
+set recall = no
+
+# Don't delay on switching or altering mailboxes so that I see the messages;
+# just do it straight away.
+#
set sleep_time = 0
-# Mailboxes
-set confirmcreate = yes
+# Only use the headers with proper references to link messages in a thread;
+# don't try to use pattern matches on subjects, which might be rubbish like
+# "hi". If I need to link a thread together because it's been broken somehow,
+# I'll do that manually.
+#
+set strict_threads
-# Menus
-set menu_context = 1
+# Use format=flowed, continuing paragraphs for lines that end with a single
+# space, and use that wrapping information to use the full width of the
+# terminal for the wrapping display.
+#
+set text_flowed
+set reflow_wrap = 0
-# MIME
-mime_lookup application/octet-stream
+# Don't wait for me to press a key after running a command if it exited
+# successfully; this still warns me if something failed, though.
+#
+unset wait_key
-# Pager
-set pager_context = 1
-set pager_format = '%4C %Z %[!%b %e at %I:%M %p] %.20n %s%* -- (%P)'
-set pager_stop = yes
+# Use the GPGME library for PGP; sign replies to messages that are themselves
+# signed (whether encrypted or not), and encrypt when we have a key for every
+# recipient (opportunistic).
+#
+set crypt_use_gpgme
+set crypt_opportunistic_encrypt
+set crypt_replysign
+set crypt_replysignencrypted
-# Presentation/formatting
-set markers = no
-set smart_wrap = yes
-set text_flowed = yes
-set tilde = yes
-alternative_order text/plain text/html *
-auto_view text/html
+# Use a default key for self-encrypting both sent and draft messages so that
+# they're protected but legible. This defaults to the $GPG_KEYID environment
+# variable, so be careful to set that lest you send useless OpenPGP headers!
+# My kingdom for muttrc(5) conditionals...
+#
+set pgp_default_key = $GPG_KEYID
+set postpone_encrypt
-# Quoting
-set quote_regexp = '^(>[ \t]*)+'
+# Always include OpenPGP header with the selected default key, regardless of
+# whether the message is protected or not:
+#
+# <https://datatracker.ietf.org/doc/draft-josefsson-openpgp-mailnews-header/>
+#
+# This RFC has expired and doesn't seem to have seen widespread adoption, but
+# it looks like Thunderbird's Enigmail extension is still sending key IDs with
+# it, and it doesn't do any harm.
+#
+my_hdr OpenPGP: id=$pgp_default_key\; \
+preference=signencrypt\; \
+url=https://keys.openpgp.org/vks/v1/by-fingerprint/$pgp_default_key
-# Responses
-set fast_reply = yes
-set forward_attachments = yes
-set forward_format = 'Fw: %s'
-set include = yes
-set use_envelope_from = yes
-
-# Searching/sorting
-set sort = 'threads'
-set sort_aux = 'last-date-received'
-set strict_threads = yes
-set thorough_search = yes
-
-# SSH
-set time_inc = 250
-
-# Encryption settings
-set crypt_protected_headers_write = yes
-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
-
-# Do decode classic PGP messages, though we'll never write them
-set pgp_auto_decode = yes
-
-# Vim-ish bindings
-bind index gg first-entry
-bind index G last-entry
-bind pager gg top
-bind pager G bottom
-bind index,pager \Cu half-up
-bind index,pager \Cd half-down
-bind generic,index,browser,pager \Cf next-page
-bind generic,index,browser,pager \Cb previous-page
-
-# Turn off annoying mailbox lock feature
-bind index '%' noop
-
-# Blindly save message to whatever box is suggested
-macro index,pager S 's<enter>' 'Save message blindly'
-
-# Run gms to retrieve all mail
-macro generic,index,browser,pager gm '!gms --quiet &<enter>' 'Run gms(1df)'
+# Because I (personally) never want to encrypt mail without signing it, add in
+# a hook for sending or changing a message that forces a signature if it's
+# encrypted but not signed. This may not suit anyone else reading.
+#
+send-hook '~G !~g' \
+ 'push <pgp-menu>s'
+send2-hook '~G !~g' \
+ 'push <pgp-menu>s'
+
+# Because of the order in which opportunistic encryption is applied, we queue
+# up a no-op change by opening the PGP menu and then doing nothing (pressing
+# Enter), to trigger send2-hooks to run and turn signatures on if opportunistic
+# encryption happens to have decided to switch encryption on.
+#
+send-hook '!~G !~g' \
+ 'push <pgp-menu><enter>'
+
+# Failing all of the above, maybe autocrypt will passively give us a key to
+# use, but don't store its keys in our primary keyring.
+#
+set autocrypt
+set autocrypt_dir \
+ = ~/.local/share/mutt/autocrypt
+
+# Set custom filter to generate an HTML part for plain-text messages in
+# Markdown style; defaults to off, per God's will and common decency.
+#
+set send_multipart_alternative_filter \
+ = ~/.local/libexec/mutt/filters/markdown-to-html
+
+# Toggle multipart sending option manually and display the new setting
+macro generic,index,browser,pager \\h '\
+<enter-command>toggle send_multipart_alternative<enter>\
+<enter-command>set ?send_multipart_alternative<enter>' \
+ 'Toggle multipart/alternative sending'
+
+# Shortcuts to jump to mailboxes
+macro generic,index,browser,pager \\b \
+ '<change-folder>-<enter>' \
+ 'Change to previous'
+macro generic,index,browser,pager \\i \
+ '<change-folder>!<enter>' \
+ 'Change to inbox'
+macro generic,index,browser,pager \\r \
+ '<change-folder><<enter>' \
+ 'Change to sent'
+
+# Shortcuts to save to mailboxes
+macro generic,index,browser,pager \\\Cb \
+ '<save-message>-<enter>' \
+ 'Move message to previous'
+macro generic,index,browser,pager \\\Ci \
+ '<save-message>!<enter>' \
+ 'Move message to inbox'
+macro generic,index,browser,pager \\\Cr \
+ '<save-message><<enter>' \
+ 'Move message to sent'
# Shortcut to add addresses to abook
-macro index,pager A \
- '<pipe-message>abook --add-email-quiet<enter>' \
- 'Add sender address to abook'
+macro index,pager \\a \
+ '<pipe-message>abook --add-email-quiet<enter>' \
+ 'Add sender address to abook'
+
+# Janky notmuch-mutt search macro, cleaned up a little
+macro index \\l '\
+<enter-command>set \
+ my_pipe_decode=$pipe_decode \
+ my_wait_key=$wait_key \
+ nopipe_decode \
+ nowait_key<enter>\
+<shell-escape>notmuch-mutt --prompt search --remove-dups<enter>\
+<change-folder-readonly>~/.cache/notmuch/mutt/results<enter>\
+<enter-command>set \
+ pipe_decode=$my_pipe_decode \
+ wait_key=$my_wait_key<enter>' \
+ 'notmuch: search mail'
+
+# Shortcut to reload configuration
+set my_muttrc \
+ = ~/.config/mutt/muttrc
+macro generic,index,browser,pager \\R '\
+<enter-command>unhook *<enter>\
+<enter-command>source $my_muttrc<enter>\
+<enter-command>echo "Reloaded $my_muttrc"<enter>' \
+ "Clear hooks and reload"
+
+# I often want thread display when having to keep track of multiple
+# conversations at once with multiple people replying to one another, as is
+# regularly the case when reading mailing lists, but for my personal mail it's
+# generally nicer to sort the messages simply by date. This macro uses
+# user-defined variables to toggle $sort between "threads" (default) and
+# "date".
+#
+set sort = threads
+set my_sort_alt = date
+macro index \\t '\
+<enter-command>set my_sort_tmp = $sort<enter>\
+<enter-command>set sort = $my_sort_alt<enter>\
+<enter-command>set my_sort_alt = $my_sort_tmp<enter>\
+<enter-command>unset my_sort_tmp<enter>\
+<enter-command>set ?sort<enter>' \
+ "Toggle thread display"
+
+# Set a few simple colors just for a quick visual cue of which tool I'm looking
+# at and for some visual distinction between text, signature, and quote. The
+# navigation bar is a nice dark green.
+#
+color attachment \
+ brightyellow default
+color hdrdefault \
+ brightcyan default
+color quoted \
+ brightgreen default
+color signature \
+ cyan default
+color status \
+ default color22
-# Machine or account specific settings
-source ~/.muttrc.d/src|
+# Load machine-specific or account-specific settings from the helper script in
+# muttrc.d, and we're done.
+#
+source ~/.config/mutt/muttrc.d/src|
diff --git a/mutt/muttrc.d/src b/mutt/muttrc.d/src
index cc2eb4ef..47cb2df1 100755
--- a/mutt/muttrc.d/src
+++ b/mutt/muttrc.d/src
@@ -1,6 +1,19 @@
#!/bin/sh
-# Helper script to emit the source all muttrc subfiles, in LC_COLLATE order
-for rc in "$HOME"/.muttrc.d/*.rc ; do
+
+# Build groups from address lists
+for rc in "$HOME"/.config/mutt/muttrc.d/groups/*.list ; do
+ [ -e "$rc" ] || continue
+ group=$rc
+ group=${group##*/}
+ group=${group%.list}
+ while read -r member ; do
+ printf 'group -group %s -addr %s\n' \
+ "$group" "$member"
+ done < "$rc"
+done
+
+# Emit the source all muttrc subfiles, in LC_COLLATE order
+for rc in "$HOME"/.config/mutt/muttrc.d/*.rc ; do
[ -e "$rc" ] || continue
cat -- "$rc"
done
@@ -9,5 +22,5 @@ done
# because at the moment I haven't worked out how to make this work sanely with
# messages-are-flowing in message-mode.
case $VISUAL in
- emacs|emacsclient) printf 'set edit_headers = no\n' ;;
+ emacs|emacsclient) printf 'unset edit_headers\n' ;;
esac
diff --git a/newsboat/config b/newsboat/config
index d7caf12d..78577adf 100644
--- a/newsboat/config
+++ b/newsboat/config
@@ -1,14 +1,23 @@
-auto-reload yes
confirm-exit yes
-keep-articles-days 180
-reload-threads 5
-reload-time 30
+
+auto-reload yes
+reload-time 10
+
+use-proxy yes
+proxy-type socks5h
+proxy localhost:9050
+
+download-retries 4
+download-timeout 60
bind-key j next
bind-key k prev
bind-key J next-feed
bind-key K prev-feed
+articlelist-format "%4i %f %D %?T?|%-17T| ?%t"
+datetime-format "%F %T"
+
color article default default
color background default default
color info white color52
diff --git a/newsboat/systemd/user/reload-newsboat.service b/newsboat/systemd/user/reload-newsboat.service
new file mode 100644
index 00000000..981ef7bc
--- /dev/null
+++ b/newsboat/systemd/user/reload-newsboat.service
@@ -0,0 +1,30 @@
+[Unit]
+Description=fetch new Newsboat articles
+OnFailure=notify-email@%n
+ConditionPathExists=!%h/.local/share/newsboat/cache.db.lock
+
+[Service]
+Type=oneshot
+LogsDirectory=newsboat
+LogsDirectoryMode=0700
+ExecStart=newsboat --execute=reload --log-file=%L/newsboat/%p.log --log-level=5
+# Hardening
+IPAddressDeny=any
+IPAddressAllow=localhost
+KeyringMode=private
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+RestrictAddressFamilies=AF_UNIX
+RestrictAddressFamilies=~AF_UNIX
+RestrictNamespaces=true
+RestrictRealtime=true
+SystemCallArchitectures=native
+SystemCallErrorNumber=EPERM
+SystemCallFilter=@system-service
+SystemCallFilter=~@privileged @resources
+UMask=0077
+# Slowing
+Nice=10
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7
diff --git a/newsboat/systemd/user/reload-newsboat.timer b/newsboat/systemd/user/reload-newsboat.timer
new file mode 100644
index 00000000..6e59d66e
--- /dev/null
+++ b/newsboat/systemd/user/reload-newsboat.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=fetch new Newsboat articles
+
+[Timer]
+OnBootSec=10m
+OnUnitActiveSec=10m
+
+[Install]
+WantedBy=timers.target
diff --git a/perlcritic/profile.d/perlcritic.sh b/perlcritic/profile.d/perlcritic.sh
new file mode 100644
index 00000000..bb404c45
--- /dev/null
+++ b/perlcritic/profile.d/perlcritic.sh
@@ -0,0 +1,2 @@
+PERLCRITIC=${XDG_CONFIG_HOME:-$HOME/.config}/perlcritic/perlcriticrc
+export PERLCRITIC
diff --git a/perltidy/profile.d/perltidy.sh b/perltidy/profile.d/perltidy.sh
new file mode 100644
index 00000000..03ed0754
--- /dev/null
+++ b/perltidy/profile.d/perltidy.sh
@@ -0,0 +1,2 @@
+PERLTIDY=${XDG_CONFIG_HOME:-$HOME/.config}/perltidy/perltidyrc
+export PERLTIDY
diff --git a/plenv/shrc.d/plenv.sh b/plenv/shrc.d/plenv.sh
index 6e03618e..bb52ffe2 100644
--- a/plenv/shrc.d/plenv.sh
+++ b/plenv/shrc.d/plenv.sh
@@ -6,12 +6,16 @@ plenv() {
shift
eval "$(plenv sh-rehash "$@")"
;;
+ sh-rehash)
+ command plenv "$@"
+ ;;
shell)
shift
eval "$(plenv sh-shell "$@")"
;;
*)
command plenv "$@"
+ plenv rehash
;;
esac
}
diff --git a/pyenv/profile.d/pyenv.sh b/pyenv/profile.d/pyenv.sh
new file mode 100644
index 00000000..296df3ac
--- /dev/null
+++ b/pyenv/profile.d/pyenv.sh
@@ -0,0 +1,5 @@
+# Define env vars for pyenv if it appears to be in use
+[ -d "$HOME"/.pyenv ] || return
+PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
+MANPATH=$HOME/.pyenv/versions/$(python -V|cut -d' ' -f2)/share/man:$MANPATH
+export MANPATH
diff --git a/pyenv/shrc.d/pyenv.sh b/pyenv/shrc.d/pyenv.sh
new file mode 100644
index 00000000..0a946164
--- /dev/null
+++ b/pyenv/shrc.d/pyenv.sh
@@ -0,0 +1,21 @@
+# POSIX-compatible version of the pyenv Bash shell wrapper
+[ -d "$HOME"/.pyenv ] || return
+pyenv() {
+ case $1 in
+ rehash)
+ shift
+ eval "$(pyenv sh-rehash "$@")"
+ ;;
+ sh-rehash)
+ command pyenv "$@"
+ ;;
+ shell)
+ shift
+ eval "$(pyenv sh-shell "$@")"
+ ;;
+ *)
+ command pyenv "$@"
+ pyenv rehash
+ ;;
+ esac
+}
diff --git a/rbenv/profile.d/rbenv.sh b/rbenv/profile.d/rbenv.sh
new file mode 100644
index 00000000..52787b4d
--- /dev/null
+++ b/rbenv/profile.d/rbenv.sh
@@ -0,0 +1,5 @@
+# Add rbenv to PATH and MANPATH if it appears to be in use
+[ -d "$HOME"/.rbenv ] || return
+PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH
+MANPATH=$HOME/.rbenv/versions/$(ruby -e 'print "#{ RUBY_VERSION }"')/man:$MANPATH
+export MANPATH
diff --git a/rbenv/shrc.d/rbenv.sh b/rbenv/shrc.d/rbenv.sh
new file mode 100644
index 00000000..ed9ddd03
--- /dev/null
+++ b/rbenv/shrc.d/rbenv.sh
@@ -0,0 +1,21 @@
+# POSIX-compatible version of the rbenv Bash shell wrapper
+[ -d "$HOME"/.rbenv ] || return
+rbenv() {
+ case $1 in
+ rehash)
+ shift
+ eval "$(rbenv sh-rehash "$@")"
+ ;;
+ sh-rehash)
+ command rbenv "$@"
+ ;;
+ shell)
+ shift
+ eval "$(rbenv sh-shell "$@")"
+ ;;
+ *)
+ command rbenv "$@"
+ rbenv rehash
+ ;;
+ esac
+}
diff --git a/readline/inputrc b/readline/inputrc
index 87abcd49..0da55708 100644
--- a/readline/inputrc
+++ b/readline/inputrc
@@ -8,6 +8,9 @@ set bell-style none
# Let readline do stuff like word killing, not stty(1)
set bind-tty-special-chars off
+# Color files by type in the same way as `ls`
+set colored-stats on
+
# Ignore case when matching and completing paths
set completion-ignore-case on
@@ -17,9 +20,16 @@ set completion-map-case on
# Show me up to 5,000 completion items, don't be shy
set completion-query-items 5000
+# When completing, put the matched completion prefix in a different color
+set colored-completion-prefix on
+set menu-complete-display-prefix on
+
# Don't display control characters like ^C if I input them
set echo-control-characters off
+# Detect terminal pastes and don't treat the characters like keyboard input
+set enable-bracketed-paste on
+
# Expand tilde to full path on completion
set expand-tilde on
@@ -48,56 +58,59 @@ set show-all-if-ambiguous on
# Don't re-complete already completed text in the middle of a word
set skip-completed-text on
+# Append characters to indicate completion filetype
+set visible-stats on
+
# Bash macros
$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.
- Space: magic-space
-
- # Tab does traditional blocking completion
- Tab: complete
- # Alt+A cycles through completion options
- "\ea": menu-complete
-
- # Special completion keys for git(1)
- ## Branches
- "\C-xb": complete
- ## Tags
- "\C-xt": complete
-
- # Ctrl-Alt-L to clear screen; more ksh-like
- "\e\C-l": clear-screen
-
- # Alt-E (for exec) to prepend "exec " to a command and return to the end of
- # the line
- "\ee": "\C-aexec \C-e"
- # Alt-P (for procedure) to wrap current command in () { ... ; } and go to
- # the start of the line
- "\ep": "\C-a() { \C-e ; }\C-a"
- # Alt-S (for set) to wrap current command in (set -x ; ...)
- "\es": "\C-a(set -x ; \C-e)\C-b"
-
- # Alt-M (for muxer) to run tm(1df)
- "\em": "\C-utm\C-j\C-y"
-
- # Alt-' for escaped single-quote: 'don'\''t fear the reaper'
- "\e'": "'\\''"
-
- # Ctrl-Alt-B to move backward a shell-quoted word
- "\e\C-b": shell-backward-word
- # Ctrl-Alt-F to move forward a shell-quoted word
- "\e\C-f": shell-forward-word
- # Ctrl-Alt-W to delete a previous shell-quoted word
- "\e\C-w": shell-backward-kill-word
+ # 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.
+ Space: magic-space
+
+ # Tab does traditional blocking completion
+ Tab: complete
+ # Alt+A cycles through completion options
+ "\ea": menu-complete
+
+ # Special completion keys for git(1)
+ ## Branches
+ "\C-xb": complete
+ ## Tags
+ "\C-xt": complete
+
+ # Ctrl-Alt-L to clear screen; more ksh-like
+ "\e\C-l": clear-screen
+
+ # Alt-E (for exec) to prepend "exec " to a command and return to the end of
+ # the line
+ "\ee": "\C-aexec \C-e"
+ # Alt-P (for procedure) to wrap current command in () { ... ; } and go to
+ # the start of the line
+ "\ep": "\C-a() { \C-e ; }\C-a"
+ # Alt-S (for set) to wrap current command in (set -x ; ...)
+ "\es": "\C-a(set -x ; \C-e)\C-b"
+
+ # Alt-M (for muxer) to run tm(1df)
+ "\em": "\C-utm\C-j\C-y"
+
+ # Alt-' for escaped single-quote: 'don'\''t fear the reaper'
+ "\e'": "'\\''"
+
+ # Ctrl-Alt-B to move backward a shell-quoted word
+ "\e\C-b": shell-backward-word
+ # Ctrl-Alt-F to move forward a shell-quoted word
+ "\e\C-f": shell-forward-word
+ # Ctrl-Alt-W to delete a previous shell-quoted word
+ "\e\C-w": shell-backward-kill-word
$endif
# bc macros
$if bc
- # Don't let bc complete filenames (!?)
- Tab:
+ # Don't let bc complete filenames (!?)
+ Tab:
$endif
diff --git a/sh/profile.d/options.sh b/sh/profile.d/options.sh
index ad9d43ab..f9dc3c79 100644
--- a/sh/profile.d/options.sh
+++ b/sh/profile.d/options.sh
@@ -52,5 +52,6 @@ options ls \
block-size \
color \
human-readable \
+ quoting-style \
time-style
)
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh
index 50b8b423..eb3c1143 100644
--- a/sh/profile.d/visual.sh
+++ b/sh/profile.d/visual.sh
@@ -1,3 +1,14 @@
-# For a visual editor, use whichever kind of vi we get when we invoke 'vi'
-VISUAL='vi'
+# For a visual editor, use Vim explicitly if we've got it, but otherwise any vi
+# implementation will be fine
+if command -v vim >/dev/null 2>&1 ; then
+ VISUAL='vim'
+else
+ VISUAL='vi'
+fi
export VISUAL
+
+# If systemctl is installed, use $VISUAL as its editor, not $EDITOR
+if command -v systemctl >/dev/null 2>&1 ; then
+ SYSTEMD_EDITOR=$VISUAL
+ export SYSTEMD_EDITOR
+fi
diff --git a/sh/profile.d/welcome.sh b/sh/profile.d/welcome.sh
index 22cdde93..19231c2e 100644
--- a/sh/profile.d/welcome.sh
+++ b/sh/profile.d/welcome.sh
@@ -7,22 +7,24 @@ esac
# Only if not in a tmux window
[ -z "$TMUX" ] || return
-# Not if ~/.hushlogin exists
-[ -e "$HOME"/.hushlogin ] && return
+# Only if ~/.hushlogin doesn't exist
+! [ -e "$HOME"/.hushlogin ] || return
# Run all of this in a subshell to clear it away afterwards
(
# Temporary helper function
welcome() {
- [ -e "$HOME"/.welcome/"$1" ] || return
- command -v "$1" >/dev/null 2>&1 || return
+ test -e "${XDG_CONFIG_HOME:-"$HOME"/.config}"/welcome/"$1"
}
# Show a fortune
if welcome fortune ; then
- if [ -z "$FORTUNE_PATH" ] &&
- [ -d "$HOME"/.local/share/games/fortunes ] ; then
- FORTUNE_PATH=$HOME/.local/share/games/fortunes
+ if [ -z "$FORTUNE_PATH" ] ; then
+ FORTUNE_PATH=${XDG_DATA_HOME:-$HOME}/.local/share/fortune
+ set -- "$FORTUNE_PATH"/*.dat
+ if ! [ -e "$1" ] ; then
+ FORTUNE_PATH=
+ fi
fi
fortune -s "$FORTUNE_PATH"
printf '\n'
@@ -36,14 +38,16 @@ esac
# Run verse(1) if we haven't seen it already today
if welcome verse ; then
- if [ -f "$HOME"/.verse ] ; then
- read -r last <"$HOME"/.verse
+ cache=${XDG_CACHE_HOME:-$HOME/.cache}/welcome
+ mkdir -p -- "$cache" || return
+ if [ -f "$cache"/verse ] ; then
+ read -r last <"$cache"/verse
fi
now=$(date +%Y%m%d)
if [ "$now" -gt "${last:-0}" ] ; then
verse
printf '\n'
- printf '%s\n' "$now" >"$HOME"/.verse
+ printf '%s\n' "$now" >"$cache"/verse
fi
fi
)
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index 203a734f..c6558fc3 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -31,6 +31,10 @@ ls() {
[ "$(exec 2>/dev/null;tput colors||tput Co||echo 0)" -ge 8 ] ; then
set -- --color=auto "$@"
fi
+ ## Force the new entry quoting off
+ if [ -e "$HOME"/.cache/sh/opt/ls/quoting-style ] ; then
+ set -- --quoting-style=literal "$@"
+ fi
## Add --time-style='+%Y-%m-%d %H:%M:%S' to show the date in my preferred
## (fixed) format
if [ -e "$HOME"/.cache/sh/opt/ls/time-style ] ; then
diff --git a/systemd/parcimonie.service b/systemd/parcimonie.service
deleted file mode 100644
index a823b216..00000000
--- a/systemd/parcimonie.service
+++ /dev/null
@@ -1,8 +0,0 @@
-[Service]
-ExecStart=/home/tom/.local/bin/parcimonie
-Restart=always
-PrivateTmp=true
-NoNewPrivileges=true
-
-[Install]
-WantedBy=default.target
diff --git a/systemd/user/notify-email@.service b/systemd/user/notify-email@.service
new file mode 100644
index 00000000..bddee12a
--- /dev/null
+++ b/systemd/user/notify-email@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=unit status mailer service for %i
+
+[Service]
+Type=oneshot
+ExecStart=sh -c 'systemctl --user status %i | mail --append="From: systemd" --append="X-systemd: %H %m %b" --subject="[systemd] %i failure" %u'
+# Hardening
+DevicePolicy=closed
+IPAddressDeny=any
+PrivateMounts=true
+PrivateTmp=true
+ProtectControlGroups=true
+ProtectHome=true
+ProtectSystem=full
+RemoveIPC=true
+SystemCallErrorNumber=EPERM
+UMask=027
diff --git a/terminfo/putty-256color.ti b/terminfo/putty-256color.ti
index 81d2b3f1..09d022b8 100644
--- a/terminfo/putty-256color.ti
+++ b/terminfo/putty-256color.ti
@@ -1,7 +1,7 @@
putty-256color| PuTTY with 256 colors,
- use=putty,
- colors#256,
- initc@,
- pairs#32767,
- setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
- setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
+ use=putty,
+ colors#256,
+ initc@,
+ pairs#32767,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
diff --git a/terminfo/putty.ti b/terminfo/putty.ti
index 6c3bd69e..068dbbd5 100644
--- a/terminfo/putty.ti
+++ b/terminfo/putty.ti
@@ -1,128 +1,128 @@
putty| PuTTY,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- am,
- bce,
- bel=^G,
- blink=\E[5m,
- bold=\E[1m,
- bw,
- cbt=\E[Z,
- ccc,
- civis=\E[?25l,
- clear=\E[H\E[J,
- cnorm=\E[?25h,
- colors#8,
- cr=^M,
- csr=\E[%i%p1%d;%p2%dr,
- cub1=^H,
- cub=\E[%p1%dD,
- cud1=\ED,
- cud=\E[%p1%dB,
- cuf1=\E[C,
- cuf=\E[%p1%dC,
- cup=\E[%i%p1%d;%p2%dH,
- cuu1=\EM,
- cuu=\E[%p1%dA,
- dch1=\E[P,
- dch=\E[%p1%dP,
- dispc=%?%p1%{8}%=%t\E%%G\342\227\230\E%%@%e%p1%{10}%=%t\E%%G\342\227\231\E%%@%e%p1%{12}%=%t\E%%G\342\231\0\E%%@%e%p1%{13}%=%t\E%%G\342\231\252\E%%@%e%p1%{14}%=%t\E%%G\342\231\253\E%%@%e%p1%{15}%=%t\E%%G\342\230\274\E%%@%e%p1%{27}%=%t\E%%G\342\206\220\E%%@%e%p1%{155}%=%t\E%%G\340\202\242\E%%@%e%p1%c%;,
- dl1=\E[M,
- dl=\E[%p1%dM,
- dsl=\E]0;\007,
- ech=\E[%p1%dX,
- ed=\E[J,
- el1=\E[1K,
- el=\E[K,
- enacs=\E(B\E)0,
- flash=\E[?5h\E[?5l,
- fsl=^G,
- home=\E[H,
- hpa=\E[%i%p1%dG,
- hs,
- ht=^I,
- hts=\EH,
- il1=\E[L,
- il=\E[%p1%dL,
- ind=^J,
- indn=\E[%p1%dS,
- initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
- is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R,
- it#8,
- kb2=\E[G,
- kbs=\177,
- kcbt=\E[Z,
- kcub1=\E[D,
- kcud1=\E[B,
- kcuf1=\E[C,
- kcuu1=\E[A,
- kdch1=\E[3~,
- kend=\E[4~,
- kf10=\E[21~,
- kf11=\E[23~,
- kf12=\E[24~,
- kf13=\E[25~,
- kf14=\E[26~,
- kf15=\E[28~,
- kf16=\E[29~,
- kf17=\E[31~,
- kf18=\E[32~,
- kf19=\E[33~,
- kf1=\E[11~,
- kf20=\E[34~,
- kf2=\E[12~,
- kf3=\E[13~,
- kf4=\E[14~,
- kf5=\E[15~,
- kf6=\E[17~,
- kf7=\E[18~,
- kf8=\E[19~,
- kf9=\E[20~,
- khome=\E[1~,
- kich1=\E[2~,
- kmous=\E[M,
- knp=\E[6~,
- kpp=\E[5~,
- kspd=^Z,
- mir,
- msgr,
- ncv#22,
- nel=^M^J,
- oc=\E]R,
- op=\E[39;49m,
- pairs#64,
- rc=\E8,
- rev=\E[7m,
- ri=\EM,
- rin=\E[%p1%dT,
- rmacs=^O,
- rmam=\E[?7l,
- rmcup=\E[2J\E[?47l,
- rmir=\E[4l,
- rmpch=\E[10m,
- rmso=\E[27m,
- rmul=\E[24m,
- rs2=\E<\E["p\E[50;6"p\Ec\E[?3l\E]R\E[?1000l,
- s0ds=\E[10m,
- s1ds=\E[11m,
- s2ds=\E[12m,
- sc=\E7,
- setab=\E[4%p1%dm,
- setaf=\E[3%p1%dm,
- sgr0=\E[m\017,
- sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
- smacs=^N,
- smam=\E[?7h,
- smcup=\E[?47h,
- smir=\E[4h,
- smpch=\E[11m,
- smso=\E[7m,
- smul=\E[4m,
- tbc=\E[3g,
- tsl=\E]0;,
- u6=\E[%i%d;%dR,
- u7=\E[6n,
- u8=\E[?6c,
- u9=\E[c,
- vpa=\E[%i%p1%dd,
- xenl,
- xon,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ am,
+ bce,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ bw,
+ cbt=\E[Z,
+ ccc,
+ civis=\E[?25l,
+ clear=\E[H\E[J,
+ cnorm=\E[?25h,
+ colors#8,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub1=^H,
+ cub=\E[%p1%dD,
+ cud1=\ED,
+ cud=\E[%p1%dB,
+ cuf1=\E[C,
+ cuf=\E[%p1%dC,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu1=\EM,
+ cuu=\E[%p1%dA,
+ dch1=\E[P,
+ dch=\E[%p1%dP,
+ dispc=%?%p1%{8}%=%t\E%%G\342\227\230\E%%@%e%p1%{10}%=%t\E%%G\342\227\231\E%%@%e%p1%{12}%=%t\E%%G\342\231\0\E%%@%e%p1%{13}%=%t\E%%G\342\231\252\E%%@%e%p1%{14}%=%t\E%%G\342\231\253\E%%@%e%p1%{15}%=%t\E%%G\342\230\274\E%%@%e%p1%{27}%=%t\E%%G\342\206\220\E%%@%e%p1%{155}%=%t\E%%G\340\202\242\E%%@%e%p1%c%;,
+ dl1=\E[M,
+ dl=\E[%p1%dM,
+ dsl=\E]0;\007,
+ ech=\E[%p1%dX,
+ ed=\E[J,
+ el1=\E[1K,
+ el=\E[K,
+ enacs=\E(B\E)0,
+ flash=\E[?5h\E[?5l,
+ fsl=^G,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ hs,
+ ht=^I,
+ hts=\EH,
+ il1=\E[L,
+ il=\E[%p1%dL,
+ ind=^J,
+ indn=\E[%p1%dS,
+ initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
+ is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R,
+ it#8,
+ kb2=\E[G,
+ kbs=\177,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kend=\E[4~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf1=\E[11~,
+ kf20=\E[34~,
+ kf2=\E[12~,
+ kf3=\E[13~,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ khome=\E[1~,
+ kich1=\E[2~,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kspd=^Z,
+ mir,
+ msgr,
+ ncv#22,
+ nel=^M^J,
+ oc=\E]R,
+ op=\E[39;49m,
+ pairs#64,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rin=\E[%p1%dT,
+ rmacs=^O,
+ rmam=\E[?7l,
+ rmcup=\E[2J\E[?47l,
+ rmir=\E[4l,
+ rmpch=\E[10m,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs2=\E<\E["p\E[50;6"p\Ec\E[?3l\E]R\E[?1000l,
+ s0ds=\E[10m,
+ s1ds=\E[11m,
+ s2ds=\E[12m,
+ sc=\E7,
+ setab=\E[4%p1%dm,
+ setaf=\E[3%p1%dm,
+ sgr0=\E[m\017,
+ sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+ smacs=^N,
+ smam=\E[?7h,
+ smcup=\E[?47h,
+ smir=\E[4h,
+ smpch=\E[11m,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ tsl=\E]0;,
+ u6=\E[%i%d;%dR,
+ u7=\E[6n,
+ u8=\E[?6c,
+ u9=\E[c,
+ vpa=\E[%i%p1%dd,
+ xenl,
+ xon,
diff --git a/terminfo/rxvt-256color.ti b/terminfo/rxvt-256color.ti
index 19057b84..22c35ec2 100644
--- a/terminfo/rxvt-256color.ti
+++ b/terminfo/rxvt-256color.ti
@@ -1,8 +1,8 @@
rxvt-256color| rxvt with 256 colors,
- use=rxvt,
- ccc,
- colors#256,
- initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
- pairs#32767,
- setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
- setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
+ use=rxvt,
+ ccc,
+ colors#256,
+ initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
+ pairs#32767,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
diff --git a/terminfo/rxvt-unicode-256color.ti b/terminfo/rxvt-unicode-256color.ti
index 62e6c021..1a34a46f 100644
--- a/terminfo/rxvt-unicode-256color.ti
+++ b/terminfo/rxvt-unicode-256color.ti
@@ -1,4 +1,4 @@
rxvt-unicode-256color| rxvt-unicode with 256 colors,
- use=rxvt-unicode,
- colors#256,
- pairs#32767,
+ use=rxvt-unicode,
+ colors#256,
+ pairs#32767,
diff --git a/terminfo/rxvt-unicode.ti b/terminfo/rxvt-unicode.ti
index 3c4e0479..05bef84a 100644
--- a/terminfo/rxvt-unicode.ti
+++ b/terminfo/rxvt-unicode.ti
@@ -1,160 +1,160 @@
rxvt-unicode| rxvt-unicode,
- acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- am,
- bce,
- bel=^G,
- blink=\E[5m,
- bold=\E[1m,
- btns#5,
- bw,
- ccc,
- civis=\E[?25l,
- clear=\E[H\E[2J,
- cnorm=\E[?25h,
- colors#88,
- cols#80,
- cr=^M,
- csr=\E[%i%p1%d;%p2%dr,
- cub1=^H,
- cub=\E[%p1%dD,
- cud1=^J,
- cud=\E[%p1%dB,
- cuf1=\E[C,
- cuf=\E[%p1%dC,
- cup=\E[%i%p1%d;%p2%dH,
- cuu1=\E[A,
- cuu=\E[%p1%dA,
- cvvis=\E[?25h,
- dch1=\E[P,
- dch=\E[%p1%dP,
- dl1=\E[M,
- dl=\E[%p1%dM,
- dsl=\E]2;\007,
- ech=\E[%p1%dX,
- ed=\E[J,
- el1=\E[1K,
- el=\E[K,
- enacs=,
- eo,
- flash=\E[?5h$<20/>\E[?5l,
- fsl=^G,
- home=\E[H,
- hpa=\E[%i%p1%dG,
- hs,
- ht=^I,
- hts=\EH,
- ich1=\E[@,
- ich=\E[%p1%d@,
- il1=\E[L,
- il=\E[%p1%dL,
- ind=^J,
- indn=\E[%p1%dS,
- initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
- is1=\E[!p,
- is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
- it#8,
- kDC=\E[3$,
- kEND=\E[8$,
- kHOM=\E[7$,
- kIC=\E[2$,
- kLFT=\E[d,
- kNXT=\E[6$,
- kPRV=\E[5$,
- kRIT=\E[c,
- ka1=\EOw,
- ka3=\EOy,
- kb2=\EOu,
- kbs=\177,
- kc1=\EOq,
- kc3=\EOs,
- kcbt=\E[Z,
- kcub1=\E[D,
- kcud1=\E[B,
- kcuf1=\E[C,
- kcuu1=\E[A,
- kdch1=\E[3~,
- kel=\E[8\^,
- kend=\E[8~,
- kent=\EOM,
- kf10=\E[21~,
- kf11=\E[23~,
- kf12=\E[24~,
- kf13=\E[25~,
- kf14=\E[26~,
- kf15=\E[28~,
- kf16=\E[29~,
- kf17=\E[31~,
- kf18=\E[32~,
- kf19=\E[33~,
- kf1=\E[11~,
- kf20=\E[34~,
- kf2=\E[12~,
- kf3=\E[13~,
- kf4=\E[14~,
- kf5=\E[15~,
- kf6=\E[17~,
- kf7=\E[18~,
- kf8=\E[19~,
- kf9=\E[20~,
- kfnd=\E[1~,
- khome=\E[7~,
- kich1=\E[2~,
- km,
- kmous=\E[M,
- knp=\E[6~,
- kpp=\E[5~,
- kslt=\E[4~,
- lines#24,
- lm#0,
- mc0=\E[i,
- mc4=\E[4i,
- mc5=\E[5i,
- mc5i,
- mir,
- msgr,
- ncv#0,
- npc,
- op=\E[39;49m,
- pairs#7744,
- rc=\E8,
- rev=\E[7m,
- ri=\EM,
- rin=\E[%p1%dT,
- ritm=\E[23m,
- rmacs=\E(B,
- rmam=\E[?7l,
- rmcup=\E[r\E[?1049l,
- rmir=\E[4l,
- rmkx=\E>,
- rmso=\E[27m,
- rmul=\E[24m,
- rs1=\Ec,
- rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
- s0ds=\E(B,
- s1ds=\E(0,
- s2ds=\E*B,
- s3ds=\E+B,
- sc=\E7,
- setab=\E[48;5;%p1%dm,
- setaf=\E[38;5;%p1%dm,
- setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
- setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
- sgr0=\E[m\E(B,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
- sitm=\E[3m,
- smacs=\E(0,
- smam=\E[?7h,
- smcup=\E[?1049h,
- smir=\E[4h,
- smkx=\E=,
- smso=\E[7m,
- smul=\E[4m,
- tbc=\E[3g,
- tsl=\E]2;,
- u6=\E[%i%d;%dR,
- u7=\E[6n,
- u8=\E[?1;2c,
- u9=\E[c,
- vpa=\E[%i%p1%dd,
- xenl,
- xon,
+ acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ am,
+ bce,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ btns#5,
+ bw,
+ ccc,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ colors#88,
+ cols#80,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub1=^H,
+ cub=\E[%p1%dD,
+ cud1=^J,
+ cud=\E[%p1%dB,
+ cuf1=\E[C,
+ cuf=\E[%p1%dC,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu1=\E[A,
+ cuu=\E[%p1%dA,
+ cvvis=\E[?25h,
+ dch1=\E[P,
+ dch=\E[%p1%dP,
+ dl1=\E[M,
+ dl=\E[%p1%dM,
+ dsl=\E]2;\007,
+ ech=\E[%p1%dX,
+ ed=\E[J,
+ el1=\E[1K,
+ el=\E[K,
+ enacs=,
+ eo,
+ flash=\E[?5h$<20/>\E[?5l,
+ fsl=^G,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ hs,
+ ht=^I,
+ hts=\EH,
+ ich1=\E[@,
+ ich=\E[%p1%d@,
+ il1=\E[L,
+ il=\E[%p1%dL,
+ ind=^J,
+ indn=\E[%p1%dS,
+ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
+ is1=\E[!p,
+ is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ it#8,
+ kDC=\E[3$,
+ kEND=\E[8$,
+ kHOM=\E[7$,
+ kIC=\E[2$,
+ kLFT=\E[d,
+ kNXT=\E[6$,
+ kPRV=\E[5$,
+ kRIT=\E[c,
+ ka1=\EOw,
+ ka3=\EOy,
+ kb2=\EOu,
+ kbs=\177,
+ kc1=\EOq,
+ kc3=\EOs,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kel=\E[8\^,
+ kend=\E[8~,
+ kent=\EOM,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf1=\E[11~,
+ kf20=\E[34~,
+ kf2=\E[12~,
+ kf3=\E[13~,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kfnd=\E[1~,
+ khome=\E[7~,
+ kich1=\E[2~,
+ km,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kslt=\E[4~,
+ lines#24,
+ lm#0,
+ mc0=\E[i,
+ mc4=\E[4i,
+ mc5=\E[5i,
+ mc5i,
+ mir,
+ msgr,
+ ncv#0,
+ npc,
+ op=\E[39;49m,
+ pairs#7744,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rin=\E[%p1%dT,
+ ritm=\E[23m,
+ rmacs=\E(B,
+ rmam=\E[?7l,
+ rmcup=\E[r\E[?1049l,
+ rmir=\E[4l,
+ rmkx=\E>,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs1=\Ec,
+ rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ s0ds=\E(B,
+ s1ds=\E(0,
+ s2ds=\E*B,
+ s3ds=\E+B,
+ sc=\E7,
+ setab=\E[48;5;%p1%dm,
+ setaf=\E[38;5;%p1%dm,
+ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ sgr0=\E[m\E(B,
+ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
+ sitm=\E[3m,
+ smacs=\E(0,
+ smam=\E[?7h,
+ smcup=\E[?1049h,
+ smir=\E[4h,
+ smkx=\E=,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ tsl=\E]2;,
+ u6=\E[%i%d;%dR,
+ u7=\E[6n,
+ u8=\E[?1;2c,
+ u9=\E[c,
+ vpa=\E[%i%p1%dd,
+ xenl,
+ xon,
diff --git a/terminfo/rxvt.ti b/terminfo/rxvt.ti
index 41cafa39..62808d3c 100644
--- a/terminfo/rxvt.ti
+++ b/terminfo/rxvt.ti
@@ -1,151 +1,151 @@
rxvt| rxvt,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- am,
- bce,
- bel=^G,
- blink=\E[5m,
- bold=\E[1m,
- civis=\E[?25l,
- clear=\E[H\E[2J,
- cnorm=\E[?25h,
- colors#8,
- cols#80,
- cr=^M,
- csr=\E[%i%p1%d;%p2%dr,
- cub1=^H,
- cub=\E[%p1%dD,
- cud1=^J,
- cud=\E[%p1%dB,
- cuf1=\E[C,
- cuf=\E[%p1%dC,
- cup=\E[%i%p1%d;%p2%dH,
- cuu1=\E[A,
- cuu=\E[%p1%dA,
- dl1=\E[M,
- dl=\E[%p1%dM,
- ed=\E[J,
- el1=\E[1K,
- el=\E[K,
- enacs=\E(B\E)0,
- eo,
- flash=\E[?5h\E[?5l,
- home=\E[H,
- hpa=\E[%i%p1%dG,
- ht=^I,
- hts=\EH,
- ich1=\E[@,
- ich=\E[%p1%d@,
- il1=\E[L,
- il=\E[%p1%dL,
- ind=^J,
- is1=\E[?47l\E=\E[?1l,
- is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
- it#8,
- kDC=\E[3$,
- kEND=\E[8$,
- kHOM=\E[7$,
- kLFT=\E[d,
- kNXT=\E[6$,
- kPRV=\E[5$,
- kRIT=\E[c,
- ka1=\EOw,
- ka3=\EOy,
- kb2=\EOu,
- kbs=\177,
- kc1=\EOq,
- kc3=\EOs,
- kcbt=\E[Z,
- kcub1=\E[D,
- kcud1=\E[B,
- kcuf1=\E[C,
- kcuu1=\E[A,
- kdch1=\E[3~,
- kel=\E[8\^,
- kend=\E[8~,
- kent=\EOM,
- kf10=\E[21~,
- kf11=\E[23~,
- kf12=\E[24~,
- kf13=\E[25~,
- kf14=\E[26~,
- kf15=\E[28~,
- kf16=\E[29~,
- kf17=\E[31~,
- kf18=\E[32~,
- kf19=\E[33~,
- kf1=\E[11~,
- kf20=\E[34~,
- kf21=\E[23$,
- kf22=\E[24$,
- kf23=\E[11\^,
- kf24=\E[12\^,
- kf25=\E[13\^,
- kf26=\E[14\^,
- kf27=\E[15\^,
- kf28=\E[17\^,
- kf29=\E[18\^,
- kf2=\E[12~,
- kf30=\E[19\^,
- kf31=\E[20\^,
- kf32=\E[21\^,
- kf33=\E[23\^,
- kf34=\E[24\^,
- kf35=\E[25\^,
- kf36=\E[26\^,
- kf37=\E[28\^,
- kf38=\E[29\^,
- kf39=\E[31\^,
- kf3=\E[13~,
- kf40=\E[32\^,
- kf41=\E[33\^,
- kf42=\E[34\^,
- kf43=\E[23@,
- kf44=\E[24@,
- kf4=\E[14~,
- kf5=\E[15~,
- kf6=\E[17~,
- kf7=\E[18~,
- kf8=\E[19~,
- kf9=\E[20~,
- kfnd=\E[1~,
- khome=\E[7~,
- kich1=\E[2~,
- km,
- kmous=\E[M,
- knp=\E[6~,
- kpp=\E[5~,
- kslt=\E[4~,
- lines#24,
- mir,
- msgr,
- ncv@,
- op=\E[39;49m,
- pairs#64,
- rc=\E8,
- rev=\E[7m,
- ri=\EM,
- rmacs=^O,
- rmcup=\E[2J\E[?47l\E8,
- rmir=\E[4l,
- rmkx=\E>,
- rmso=\E[27m,
- rmul=\E[24m,
- rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
- rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E=\E[?1000l\E[?25h,
- s0ds=\E(B,
- s1ds=\E(0,
- sc=\E7,
- setab=\E[4%p1%dm,
- setaf=\E[3%p1%dm,
- sgr0=\E[m\017,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
- smacs=^N,
- smcup=\E7\E[?47h,
- smir=\E[4h,
- smkx=\E=,
- smso=\E[7m,
- smul=\E[4m,
- tbc=\E[3g,
- vpa=\E[%i%p1%dd,
- xenl,
- xon,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ am,
+ bce,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ colors#8,
+ cols#80,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub1=^H,
+ cub=\E[%p1%dD,
+ cud1=^J,
+ cud=\E[%p1%dB,
+ cuf1=\E[C,
+ cuf=\E[%p1%dC,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu1=\E[A,
+ cuu=\E[%p1%dA,
+ dl1=\E[M,
+ dl=\E[%p1%dM,
+ ed=\E[J,
+ el1=\E[1K,
+ el=\E[K,
+ enacs=\E(B\E)0,
+ eo,
+ flash=\E[?5h\E[?5l,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ ht=^I,
+ hts=\EH,
+ ich1=\E[@,
+ ich=\E[%p1%d@,
+ il1=\E[L,
+ il=\E[%p1%dL,
+ ind=^J,
+ is1=\E[?47l\E=\E[?1l,
+ is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+ it#8,
+ kDC=\E[3$,
+ kEND=\E[8$,
+ kHOM=\E[7$,
+ kLFT=\E[d,
+ kNXT=\E[6$,
+ kPRV=\E[5$,
+ kRIT=\E[c,
+ ka1=\EOw,
+ ka3=\EOy,
+ kb2=\EOu,
+ kbs=\177,
+ kc1=\EOq,
+ kc3=\EOs,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kel=\E[8\^,
+ kend=\E[8~,
+ kent=\EOM,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf1=\E[11~,
+ kf20=\E[34~,
+ kf21=\E[23$,
+ kf22=\E[24$,
+ kf23=\E[11\^,
+ kf24=\E[12\^,
+ kf25=\E[13\^,
+ kf26=\E[14\^,
+ kf27=\E[15\^,
+ kf28=\E[17\^,
+ kf29=\E[18\^,
+ kf2=\E[12~,
+ kf30=\E[19\^,
+ kf31=\E[20\^,
+ kf32=\E[21\^,
+ kf33=\E[23\^,
+ kf34=\E[24\^,
+ kf35=\E[25\^,
+ kf36=\E[26\^,
+ kf37=\E[28\^,
+ kf38=\E[29\^,
+ kf39=\E[31\^,
+ kf3=\E[13~,
+ kf40=\E[32\^,
+ kf41=\E[33\^,
+ kf42=\E[34\^,
+ kf43=\E[23@,
+ kf44=\E[24@,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kfnd=\E[1~,
+ khome=\E[7~,
+ kich1=\E[2~,
+ km,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kslt=\E[4~,
+ lines#24,
+ mir,
+ msgr,
+ ncv@,
+ op=\E[39;49m,
+ pairs#64,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rmacs=^O,
+ rmcup=\E[2J\E[?47l\E8,
+ rmir=\E[4l,
+ rmkx=\E>,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
+ rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E=\E[?1000l\E[?25h,
+ s0ds=\E(B,
+ s1ds=\E(0,
+ sc=\E7,
+ setab=\E[4%p1%dm,
+ setaf=\E[3%p1%dm,
+ sgr0=\E[m\017,
+ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+ smacs=^N,
+ smcup=\E7\E[?47h,
+ smir=\E[4h,
+ smkx=\E=,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ vpa=\E[%i%p1%dd,
+ xenl,
+ xon,
diff --git a/terminfo/screen-256color.ti b/terminfo/screen-256color.ti
index 1cfabaf9..cc7faffe 100644
--- a/terminfo/screen-256color.ti
+++ b/terminfo/screen-256color.ti
@@ -1,7 +1,7 @@
screen-256color| GNU Screen or tmux with 256 colors,
- use=screen,
- colors#256,
- initc@,
- pairs#32767,
- setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
- setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
+ use=screen,
+ colors#256,
+ initc@,
+ pairs#32767,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
diff --git a/terminfo/screen.ti b/terminfo/screen.ti
index 3f51e9fd..4658f424 100644
--- a/terminfo/screen.ti
+++ b/terminfo/screen.ti
@@ -1,100 +1,100 @@
screen| GNU Screen or tmux,
- acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- am,
- bel=^G,
- blink=\E[5m,
- bold=\E[1m,
- cbt=\E[Z,
- civis=\E[?25l,
- clear=\E[H\E[J,
- cnorm=\E[34h\E[?25h,
- colors#8,
- cols#80,
- cr=^M,
- csr=\E[%i%p1%d;%p2%dr,
- cub1=^H,
- cub=\E[%p1%dD,
- cud1=^J,
- cud=\E[%p1%dB,
- cuf1=\E[C,
- cuf=\E[%p1%dC,
- cup=\E[%i%p1%d;%p2%dH,
- cuu1=\EM,
- cuu=\E[%p1%dA,
- cvvis=\E[34l,
- dch1=\E[P,
- dch=\E[%p1%dP,
- dl1=\E[M,
- dl=\E[%p1%dM,
- ed=\E[J,
- el1=\E[1K,
- el=\E[K,
- enacs=\E(B\E)0,
- flash=\Eg,
- home=\E[H,
- ht=^I,
- hts=\EH,
- ich=\E[%p1%d@,
- il1=\E[L,
- il=\E[%p1%dL,
- ind=^J,
- is2=\E)0,
- it#8,
- kbs=\177,
- kcbt=\E[Z,
- kcub1=\EOD,
- kcud1=\EOB,
- kcuf1=\EOC,
- kcuu1=\EOA,
- kdch1=\E[3~,
- kend=\E[4~,
- kf10=\E[21~,
- kf11=\E[23~,
- kf12=\E[24~,
- kf1=\EOP,
- kf2=\EOQ,
- kf3=\EOR,
- kf4=\EOS,
- kf5=\E[15~,
- kf6=\E[17~,
- kf7=\E[18~,
- kf8=\E[19~,
- kf9=\E[20~,
- khome=\E[1~,
- kich1=\E[2~,
- km,
- kmous=\E[M,
- knp=\E[6~,
- kpp=\E[5~,
- lines#24,
- mir,
- msgr,
- ncv@,
- nel=\EE,
- op=\E[39;49m,
- pairs#64,
- rc=\E8,
- rev=\E[7m,
- ri=\EM,
- ritm=\E[23m,
- rmacs=^O,
- rmcup=\E[?1049l,
- rmir=\E[4l,
- rmkx=\E[?1l\E>,
- rmso=\E[27m,
- rmul=\E[24m,
- rs2=\Ec\E[?1000l\E[?25h,
- sc=\E7,
- setab=\E[4%p1%dm,
- setaf=\E[3%p1%dm,
- sgr0=\E[m\017,
- sgr=\E[0%?%p6%t;1%;%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
- sitm=\E[3m,
- smacs=^N,
- smcup=\E[?1049h,
- smir=\E[4h,
- smkx=\E[?1h\E=,
- smso=\E[7m,
- smul=\E[4m,
- tbc=\E[3g,
- xenl,
+ acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ am,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ cbt=\E[Z,
+ civis=\E[?25l,
+ clear=\E[H\E[J,
+ cnorm=\E[34h\E[?25h,
+ colors#8,
+ cols#80,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub1=^H,
+ cub=\E[%p1%dD,
+ cud1=^J,
+ cud=\E[%p1%dB,
+ cuf1=\E[C,
+ cuf=\E[%p1%dC,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu1=\EM,
+ cuu=\E[%p1%dA,
+ cvvis=\E[34l,
+ dch1=\E[P,
+ dch=\E[%p1%dP,
+ dl1=\E[M,
+ dl=\E[%p1%dM,
+ ed=\E[J,
+ el1=\E[1K,
+ el=\E[K,
+ enacs=\E(B\E)0,
+ flash=\Eg,
+ home=\E[H,
+ ht=^I,
+ hts=\EH,
+ ich=\E[%p1%d@,
+ il1=\E[L,
+ il=\E[%p1%dL,
+ ind=^J,
+ is2=\E)0,
+ it#8,
+ kbs=\177,
+ kcbt=\E[Z,
+ kcub1=\EOD,
+ kcud1=\EOB,
+ kcuf1=\EOC,
+ kcuu1=\EOA,
+ kdch1=\E[3~,
+ kend=\E[4~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf1=\EOP,
+ kf2=\EOQ,
+ kf3=\EOR,
+ kf4=\EOS,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ khome=\E[1~,
+ kich1=\E[2~,
+ km,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ lines#24,
+ mir,
+ msgr,
+ ncv@,
+ nel=\EE,
+ op=\E[39;49m,
+ pairs#64,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ ritm=\E[23m,
+ rmacs=^O,
+ rmcup=\E[?1049l,
+ rmir=\E[4l,
+ rmkx=\E[?1l\E>,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs2=\Ec\E[?1000l\E[?25h,
+ sc=\E7,
+ setab=\E[4%p1%dm,
+ setaf=\E[3%p1%dm,
+ sgr0=\E[m\017,
+ sgr=\E[0%?%p6%t;1%;%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+ sitm=\E[3m,
+ smacs=^N,
+ smcup=\E[?1049h,
+ smir=\E[4h,
+ smkx=\E[?1h\E=,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ xenl,
diff --git a/terminfo/tmux-256color.ti b/terminfo/tmux-256color.ti
deleted file mode 100644
index a242b7c1..00000000
--- a/terminfo/tmux-256color.ti
+++ /dev/null
@@ -1,6 +0,0 @@
-tmux-256color| tmux with 256 colors,
- use=tmux,
- colors#256,
- pairs#32767,
- setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
- setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
diff --git a/terminfo/tmux.ti b/terminfo/tmux.ti
deleted file mode 100644
index fc86d773..00000000
--- a/terminfo/tmux.ti
+++ /dev/null
@@ -1,104 +0,0 @@
-tmux| tmux terminal multiplexer,
- acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- am,
- bel=^G,
- blink=\E[5m,
- bold=\E[1m,
- cbt=\E[Z,
- civis=\E[?25l,
- clear=\E[H\E[J,
- cnorm=\E[34h\E[?25h,
- colors#8,
- cols#80,
- cr=^M,
- csr=\E[%i%p1%d;%p2%dr,
- cub1=^H,
- cub=\E[%p1%dD,
- cud1=^J,
- cud=\E[%p1%dB,
- cuf1=\E[C,
- cuf=\E[%p1%dC,
- cup=\E[%i%p1%d;%p2%dH,
- cuu1=\EM,
- cuu=\E[%p1%dA,
- cvvis=\E[34l,
- dch1=\E[P,
- dch=\E[%p1%dP,
- dim=\E[2m,
- dl1=\E[M,
- dl=\E[%p1%dM,
- dsl=\E]0;\007,
- ed=\E[J,
- el1=\E[1K,
- el=\E[K,
- enacs=\E(B\E)0,
- flash=\Eg,
- fsl=^G,
- home=\E[H,
- hs,
- ht=^I,
- hts=\EH,
- ich=\E[%p1%d@,
- il1=\E[L,
- il=\E[%p1%dL,
- ind=^J,
- is2=\E)0,
- it#8,
- kbs=\177,
- kcbt=\E[Z,
- kcub1=\EOD,
- kcud1=\EOB,
- kcuf1=\EOC,
- kcuu1=\EOA,
- kdch1=\E[3~,
- kend=\E[4~,
- kf10=\E[21~,
- kf11=\E[23~,
- kf12=\E[24~,
- kf1=\EOP,
- kf2=\EOQ,
- kf3=\EOR,
- kf4=\EOS,
- kf5=\E[15~,
- kf6=\E[17~,
- kf7=\E[18~,
- kf8=\E[19~,
- kf9=\E[20~,
- khome=\E[1~,
- kich1=\E[2~,
- km,
- kmous=\E[M,
- knp=\E[6~,
- kpp=\E[5~,
- lines#24,
- mir,
- msgr,
- nel=\EE,
- op=\E[39;49m,
- pairs#64,
- rc=\E8,
- rev=\E[7m,
- ri=\EM,
- ritm=\E[23m,
- rmacs=^O,
- rmcup=\E[?1049l,
- rmir=\E[4l,
- rmkx=\E[?1l\E>,
- rmso=\E[27m,
- rmul=\E[24m,
- rs2=\Ec\E[?1000l\E[?25h,
- sc=\E7,
- setab=\E[4%p1%dm,
- setaf=\E[3%p1%dm,
- sgr0=\E[m\017,
- sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;m%?%p9%t\016%e\017%;,
- sitm=\E[3m,
- smacs=^N,
- smcup=\E[?1049h,
- smir=\E[4h,
- smkx=\E[?1h\E=,
- smso=\E[7m,
- smul=\E[4m,
- tbc=\E[3g,
- tsl=\E]0;,
- xenl,
diff --git a/tidy/profile.d/tidy.sh b/tidy/profile.d/tidy.sh
index 177a8124..664a6536 100644
--- a/tidy/profile.d/tidy.sh
+++ b/tidy/profile.d/tidy.sh
@@ -1,3 +1,3 @@
# Set a configuration file path for tidy(1)
-HTML_TIDY=$HOME/.tidyrc
+HTML_TIDY=${XDG_CONFIG_HOME:-$HOME/.config}/tidy/tidyrc
export HTML_TIDY
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
index 257cee5f..05e21f81 100644
--- a/tmux/tmux.conf
+++ b/tmux/tmux.conf
@@ -14,7 +14,7 @@ set-option -g update-environment 'COLORFGBG COLORTERM'
set-option -g default-command "$SHELL"
# Expect a 256-color terminal
-set-option -g default-terminal 'tmux-256color'
+set-option -g default-terminal 'screen-256color'
# Change the prefix to ^A rather than the default of ^B, because I'm a godless
# GNU Screen refugee, and also I like using ^B in my shell and in Vim more
@@ -69,7 +69,7 @@ bind-key s choose-session
set-option -g status-left '[#S] '
# Username, hostname, and the current date on the right side of the status bar
-set-option -g status-right ' [#H] %F %T'
+set-option -g status-right ' (mail:#(msc)) [#h] %F %T'
# Update the status bar every second
set-option -g status-interval 1
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 4a1c3814..093dc5f5 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -4,13 +4,15 @@ setlocal formatoptions+=coqr
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
" Choose the color column depending on non-comment line count
-augroup gitcommit_cursorcolumn
- autocmd CursorMoved,CursorMovedI <buffer>
- \ let &l:colorcolumn = gitcommit#CursorColumn()
-augroup END
-let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
- \ . '|augroup! gitcommit_cursorcolumn'
- \ . '|setlocal colorcolumn<'
+if exists('&colorcolumn')
+ augroup gitcommit_cursorcolumn
+ autocmd CursorMoved,CursorMovedI <buffer>
+ \ let &l:colorcolumn = gitcommit#CursorColumn()
+ augroup END
+ let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
+ \ . '|augroup! gitcommit_cursorcolumn'
+ \ . '|setlocal colorcolumn<'
+endif
" Stop here if the user doesn't want ftplugin mappings
if exists('no_plugin_maps') || exists('no_gitcommit_maps')
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
index 7e2ba439..21a84a42 100644
--- a/vim/after/ftplugin/html.vim
+++ b/vim/after/ftplugin/html.vim
@@ -4,7 +4,7 @@ if &filetype !=# 'html'
finish
endif
-" Spellcheck documents we're actually editing (not just viewing)
+" Check the spelling of documents we're actually editing (not just viewing)
if &modifiable && !&readonly
setlocal spell
let b:undo_ftplugin .= '|setlocal spell<'
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 738f17ec..4c07bac3 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,3 +1,13 @@
+" Restore global value for no_mail_maps that we set in
+" ~/.vim/ftplugin/mail.vim to work around the bad maps set in
+" $VIMRUNTIME/ftplugin/mail.vim
+"
+if exists('b:no_mail_maps')
+ let no_mail_maps = b:no_mail_maps
+elseif exists('no_mail_maps')
+ unlet no_mail_maps
+endif
+
" Don't append spaces after quote chars, for strict compliance with
" format=flowed
let b:quote_space = 0
@@ -8,7 +18,7 @@ command -bar -buffer SuggestStart
let b:undo_ftplugin .= '|delcommand SuggestStart'
SuggestStart
-" Normalise quoting
+" Normalize quoting
command -bar -buffer -range=% StrictQuote
\ call mail#StrictQuote(<q-line1>, <q-line2>)
let b:undo_ftplugin .= '|delcommand StrictQuote'
@@ -66,9 +76,9 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
\ . '|xunmap <buffer> <LocalLeader>Q'
" Mappings for enforcing strict quoting
-nnoremap <LocalLeader>s
+nnoremap <buffer> <LocalLeader>s
\ :StrictQuote<CR>
-xnoremap <LocalLeader>s
+xnoremap <buffer> <LocalLeader>s
\ :StrictQuote<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>s'
\ . '|xunmap <buffer> <LocalLeader>s'
diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim
index 01f971b9..112523da 100644
--- a/vim/after/ftplugin/vim.vim
+++ b/vim/after/ftplugin/vim.vim
@@ -26,9 +26,9 @@ let &l:include = '\<source\>\|\<runtime!\=\>'
" Search runtime paths for included scripts
let &l:path = &runtimepath . ',' . &path
-" Adjust the match words for the matchit plugin; the default filetype plugin
-" matches e.g. an opening "function" with the first "return" within, which I
-" don't like
+" Adjust the match words for the matchit.vim plugin; the default filetype
+" plugin matches e.g. an opening "function" with the first "return" within,
+" which I don't like
if exists('loaded_matchit')
let b:match_words = '\<fu\%[nction]\>:\<endf\%[unction]\>,'
\ . '\<\(wh\%[ile]\|for\)\>:\<end\(w\%[hile]\|fo\%[r]\)\>,'
diff --git a/vim/after/plugin/2html.vim b/vim/after/plugin/2html.vim
new file mode 100644
index 00000000..dd65486d
--- /dev/null
+++ b/vim/after/plugin/2html.vim
@@ -0,0 +1,11 @@
+" Don't make these settings if the base plugin didn't load
+if !exists('g:loaded_2html_plugin')
+ finish
+endif
+
+" Set preferred fonts for the HTML rendering
+let g:html_font = [
+ \ 'DejaVu Sans Mono',
+ \ 'Ubuntu Mono',
+ \ 'Consolas',
+ \]
diff --git a/vim/after/plugin/spellfile_local.vim b/vim/after/plugin/spellfile_local.vim
new file mode 100644
index 00000000..7d805660
--- /dev/null
+++ b/vim/after/plugin/spellfile_local.vim
@@ -0,0 +1,13 @@
+" Don't make these settings if the base plugin didn't load
+if !exists('g:loaded_spellfile_local')
+ finish
+endif
+
+" Use XDG dirs for 'spellfile' if XDG_DATA_HOME is useable
+if xdg#DataHome() !=# ''
+ let g:spellfile_local_dirs = [ xdg#DataHome() ]
+ call extend(
+ \ g:spellfile_local_dirs,
+ \ xdg#DataDirs(),
+ \)
+endif
diff --git a/vim/after/syntax/bindzone.vim b/vim/after/syntax/bindzone.vim
index 29d5f4b8..f95aff8f 100644
--- a/vim/after/syntax/bindzone.vim
+++ b/vim/after/syntax/bindzone.vim
@@ -1,5 +1,5 @@
-" Highlight TLSA and SSHFP records correctly
+" Highlight some newer/weirder records correctly
" <https://github.com/vim/vim/issues/220>
syn keyword zoneRRType
- \ contained TLSA SSHFP
+ \ contained CAA SSHFP TLSA
\ nextgroup=zoneRData skipwhite
diff --git a/vim/after/syntax/mail.vim b/vim/after/syntax/mail.vim
new file mode 100644
index 00000000..77c76f00
--- /dev/null
+++ b/vim/after/syntax/mail.vim
@@ -0,0 +1,3 @@
+" Don't spellcheck code in mail messages
+syntax region mailCode start='`' end='`' keepend contains=@NoSpell
+syntax region mailCodeBlock start=' \{4\}' end='$' contains=@NoSpell
diff --git a/vim/after/syntax/resolv.vim b/vim/after/syntax/resolv.vim
new file mode 100644
index 00000000..4c8ec165
--- /dev/null
+++ b/vim/after/syntax/resolv.vim
@@ -0,0 +1,6 @@
+" Over-simple but good-enough `nameserver` rule fix including IPv6
+" Version 1.4 of the syntax file has a more accurate fix
+if !has('patch-8.2.0380')
+ syntax clear resolvIPNameserver
+ syntax match resolvIPNameserver contained /[0-9.a-fA-F:]\+/
+endif
diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim
index af7670d5..d7cf040d 100644
--- a/vim/after/syntax/sh.vim
+++ b/vim/after/syntax/sh.vim
@@ -16,11 +16,11 @@ elseif exists('b:is_posix')
endif
" The syntax highlighter seems to flag '/baz' in '"${foo:-"$bar"/baz}"' as an
-" error, which it isn't, at least in POSIX sh, Bash, and Ksh.
+" error, which it isn't, at least in POSIX sh, Bash, and Korn shell.
syntax clear shDerefWordError
-" The syntax highlighter doesn't match parens for subshells for 'if' tests
-" correctly if they're on separate lines. This happens enough that it's
+" The syntax highlighter doesn't match parentheses for subshells for 'if'
+" tests correctly if they're on separate lines. This happens enough that it's
" probably not worth keeping the error.
syntax clear shParenError
@@ -33,7 +33,7 @@ syntax clear shTestError
if exists('b:is_posix')
" Highlight some commands that are both defined by POSIX and builtin
- " commands in dash, as a rough but useable proxy for 'shell builtins'. This
+ " commands in dash, as a rough but usable proxy for 'shell builtins'. This
" list was mostly wrested from `man 1 dash`. Also include control structure
" keywords like `break`, `continue`, and `return`.
syntax clear shStatement
@@ -76,8 +76,8 @@ if exists('b:is_posix')
" Core syntax/sh.vim puts IFS and other variables that affect shell function
" in another color, but a subset of them actually apply to POSIX shell too
- " (and plain Bourne). These are selected by searching the POSIX manpages. I
- " added NLSPATH too, which wasn't in the original.
+ " (and plain Bourne). These are selected by searching the POSIX man pages.
+ " I added NLSPATH too, which wasn't in the original.
syntax clear shShellVariables
syntax cluster shCommandSubList add=shShellVariables
syntax keyword shShellVariables
diff --git a/vim/after/syntax/vim.vim b/vim/after/syntax/vim.vim
index 438ce596..bd7d8274 100644
--- a/vim/after/syntax/vim.vim
+++ b/vim/after/syntax/vim.vim
@@ -4,7 +4,7 @@ syntax clear vimCommentString
syntax clear vimCommentTitle
" Highlight :CompilerSet commands like :set/:setlocal, but only in compiler
-" scripts in recognisable paths
+" scripts in recognizable paths
if expand('%:p:h:t') ==# 'compiler'
\ && expand('%:e') ==# 'vim'
syntax keyword vimCommand contained
diff --git a/vim/autoload/argument.vim b/vim/autoload/argument.vim
deleted file mode 100644
index 85d75eb1..00000000
--- a/vim/autoload/argument.vim
+++ /dev/null
@@ -1,8 +0,0 @@
-" Escape a single argument for use on an Ex command line; essentially
-" a backport of fnameescape() for versions before v7.1.299
-"
-function! argument#Escape(argument) abort
- return exists('*fnameescape')
- \ ? fnameescape(a:argument)
- \ : escape(a:argument, "\n\r\t".' *?[{`$\%#''"|!<')
-endfunction
diff --git a/vim/autoload/diff.vim b/vim/autoload/diff.vim
index 29389b95..6e87b62a 100644
--- a/vim/autoload/diff.vim
+++ b/vim/autoload/diff.vim
@@ -1,7 +1,7 @@
" Move between diff block headers
function! diff#MoveBlock(count, up, visual) abort
- " Reselect visual selection
+ " Re-select visual selection
if a:visual
normal! gv
endif
diff --git a/vim/autoload/filetype/repeat.vim b/vim/autoload/filetype/repeat.vim
index f681932b..899bbcc4 100644
--- a/vim/autoload/filetype/repeat.vim
+++ b/vim/autoload/filetype/repeat.vim
@@ -53,7 +53,7 @@ function! filetype#repeat#Sudo() abort
elseif fn =~# '/[^/]\+\.\w\{8}$'
let fn = expand('<afile>:r')
- " Unrecognised pattern; return, don't repeat
+ " Unrecognized pattern; return, don't repeat
else
return
endif
diff --git a/vim/autoload/fortune.vim b/vim/autoload/fortune.vim
deleted file mode 100644
index da6e2fa3..00000000
--- a/vim/autoload/fortune.vim
+++ /dev/null
@@ -1,59 +0,0 @@
-" Declare paths to check for fortune files
-let s:paths = [
- \ $HOME.'/.fortunes',
- \ $HOME.'/.local/share/games/fortunes',
- \]
-
-" List of executables for which we need to check
-let s:executables = [
- \ 'fortune',
- \ 'timeout',
- \]
-
-" Entry point for plugin
-function! fortune#() abort
-
- " Check we have all of the executables we need
- for executable in s:executables
- if !executable(executable)
- echoerr 'Missing executable "'.executable.'"'
- endif
- endfor
-
- " Maximum length of fortunes is the width of the screen minus 1; characters
- " wider than one column will break this
- "
- let limit = &columns - 1
-
- " Some implementations of fortune(6) thrash the disk if they can't meet the
- " length limit, so we need to rap this invocation in a timeout(1) call
- let command = [
- \ 'timeout',
- \ '0.3s',
- \ 'fortune',
- \ '-s',
- \ '-n',
- \ limit,
- \]
-
- " Find a path for custom fortunes and add it on to the command if found
- for path in s:paths
- if isdirectory(path)
- call add(command, path)
- break
- endif
- endfor
-
- " Run the command and condense any control or space character groups into
- " just one space
- let fortune = substitute(
- \ system(join(command)),
- \ '[[:cntrl:][:space:]]\+',
- \ ' ',
- \ 'g',
- \)
-
- " Show the fortune message!
- echomsg fortune
-
-endfunction
diff --git a/vim/autoload/getenv.vim b/vim/autoload/getenv.vim
new file mode 100644
index 00000000..3b5f4c1b
--- /dev/null
+++ b/vim/autoload/getenv.vim
@@ -0,0 +1,17 @@
+" Backport getenv() from v8.1.1305, except return an empty string rather than
+" v:null
+"
+" <https://github.com/vim/vim/releases/tag/v8.1.1305>
+"
+function! getenv#(name) abort
+
+ if a:name !~# '^[A-Z][A-Z0-9_]*$'
+ throw 'Illegal env var name'
+ endif
+ let value = ''
+ if exists('$'.a:name)
+ execute 'let value = $'.a:name
+ endif
+ return value
+
+endfunction
diff --git a/vim/autoload/html/timestamp.vim b/vim/autoload/html/timestamp.vim
index 9de19aa0..6d525afb 100644
--- a/vim/autoload/html/timestamp.vim
+++ b/vim/autoload/html/timestamp.vim
@@ -69,6 +69,6 @@ function! html#timestamp#Update() abort
" Apply the updated timestamp
let line = getline(lnum)
let line = substitute(line, s:pattern, update, '')
- call setline(lnum, line)
+ keepjumps call setline(lnum, line)
endfunction
diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim
index cd585af4..6d4874ca 100644
--- a/vim/autoload/mail.vim
+++ b/vim/autoload/mail.vim
@@ -1,7 +1,7 @@
" Move through quoted paragraphs like normal-mode `{` and `}`
function! mail#NewBlank(count, up, visual) abort
- " Reselect visual selection
+ " Re-select visual selection
if a:visual
normal! gv
endif
@@ -61,7 +61,7 @@ function! mail#StrictQuote(start, end) abort
continue
endif
- " Normalise the quote with no spaces
+ " Normalize the quote with no spaces
let quote = substitute(quote, '[^>]', '', 'g')
" Re-set the line
diff --git a/vim/autoload/mail/header/field.vim b/vim/autoload/mail/header/field.vim
index e27d13c0..db38c09f 100644
--- a/vim/autoload/mail/header/field.vim
+++ b/vim/autoload/mail/header/field.vim
@@ -9,7 +9,7 @@ function! mail#header#field#Add(header, name, body) abort
endfunction
" Set a field in a header, replacing the first one with the same name (if
-" any), and and removing any others
+" any), and removing any others
"
function! mail#header#field#Set(header, name, body) abort
let fields = []
diff --git a/vim/autoload/option.vim b/vim/autoload/option.vim
index 5ff44ced..49fbf1a4 100644
--- a/vim/autoload/option.vim
+++ b/vim/autoload/option.vim
@@ -7,5 +7,11 @@ function! option#Split(expr, ...) abort
endif
let keepempty = a:0 ? a:1 : 0
let parts = split(a:expr, '\\\@<!,[, ]*', keepempty)
- return map(parts, 'substitute(v:val, ''\\,'', '','', ''g'')')
+ return map(copy(parts), 'substitute(v:val, ''\\,'', '','', ''g'')')
+endfunction
+
+" Escape the right-hand side of a :set option value
+"
+function! option#Escape(expr) abort
+ return escape(a:expr, ' |"\')
endfunction
diff --git a/vim/autoload/path.vim b/vim/autoload/path.vim
deleted file mode 100644
index e230cab2..00000000
--- a/vim/autoload/path.vim
+++ /dev/null
@@ -1,14 +0,0 @@
-" Create all the directories needed for a path, with optional flag for
-" owner-only permissions
-function! path#Create(name, ...) abort
- if a:0 > 2
- echoerr 'Too many arguments'
- endif
- if isdirectory(a:name)
- return 1
- endif
- let name = a:name
- let path = 'p'
- let prot = a:0 == 1 && a:1 ? 0700 : 0755
- return mkdir(name, path, prot)
-endfunction
diff --git a/vim/autoload/put_date.vim b/vim/autoload/put_date.vim
deleted file mode 100644
index b0b0b548..00000000
--- a/vim/autoload/put_date.vim
+++ /dev/null
@@ -1,24 +0,0 @@
-" RFC2822 format string for strftime()
-let s:rfc_2822 = '%a, %d %b %Y %T %z'
-
-" Write a date to the buffer, UTC or local, in the specified format,
-" defaulting to RFC2822; formats are provided without the leading % signs
-" before each letter, like PHP date()
-"
-function! put_date#(line, utc, format) abort
- let line = a:line
- let utc = a:utc
- let format = strlen(a:format)
- \ ? substitute(a:format, '\a', '%&', 'g')
- \ : s:rfc_2822
- if utc
- if exists('$TZ')
- let tz = $TZ
- endif
- let $TZ = 'UTC'
- endif
- execute line.'put =strftime(format)'
- if exists('tz')
- let $TZ = tz
- endif
-endfunction
diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim
index 690ba2db..7574ed71 100644
--- a/vim/autoload/quote.vim
+++ b/vim/autoload/quote.vim
@@ -24,8 +24,8 @@ function! quote#QuoteOpfunc(type) abort
continue
endif
- " If configured to do so, add a a space after the quote character, but
- " only if this line isn't already quoted
+ " If configured to do so, add a space after the quote character, but only
+ " if this line isn't already quoted
let new = char
if space && cur[0] != char
let new .= ' '
diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim
new file mode 100644
index 00000000..c5737506
--- /dev/null
+++ b/vim/autoload/xdg.vim
@@ -0,0 +1,61 @@
+" <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables>
+let s:defaults = {
+ \ 'XDG_CACHE_HOME': $HOME.'/.cache',
+ \ 'XDG_CONFIG_HOME': $HOME.'/.config',
+ \ 'XDG_CONFIG_DIRS': '/etc/xdg',
+ \ 'XDG_DATA_HOME': $HOME.'/.local/share',
+ \ 'XDG_DATA_DIRS': '/usr/local/share:/usr/share',
+ \}
+
+function! s:Get(name) abort
+ let name = a:name
+ if !has_key(s:defaults, name)
+ throw 'Illegal XDG basedirs env var name'
+ endif
+ let value = getenv#(name)
+ return value !=# ''
+ \ ? value
+ \ : s:defaults[name]
+endfunction
+
+function! s:Absolute(path) abort
+ return a:path =~# '^/'
+ \ || a:path =~# '^\~/'
+ \ || a:path ==# '~'
+endfunction
+
+function! s:Home(name) abort
+ let home = s:Get(a:name)
+ if !s:Absolute(home)
+ return ''
+ endif
+ return home.'/vim'
+endfunction
+
+function! s:Dirs(name) abort
+ let dirs = split(s:Get(a:name), ':')
+ return map(
+ \ filter(copy(dirs), 's:Absolute(v:val)')
+ \,'v:val.''/vim'''
+ \)
+endfunction
+
+function! xdg#CacheHome() abort
+ return s:Home('XDG_CACHE_HOME')
+endfunction
+
+function! xdg#ConfigHome() abort
+ return s:Home('XDG_CONFIG_HOME')
+endfunction
+
+function! xdg#DataHome() abort
+ return s:Home('XDG_DATA_HOME')
+endfunction
+
+function! xdg#ConfigDirs() abort
+ return s:Dirs('XDG_CONFIG_DIRS')
+endfunction
+
+function! xdg#DataDirs() abort
+ return s:Dirs('XDG_DATA_DIRS')
+endfunction
diff --git a/vim/bundle/cursorline_current b/vim/bundle/cursorline_current
-Subproject 4ab61f5dfa9a2868c529c75a50219dac6619080
+Subproject d1b8db2fe6b06bd556c777c7bd9d4632f12a3a1
diff --git a/vim/bundle/detect_indent b/vim/bundle/detect_indent
new file mode 160000
+Subproject b41d085cdcaf1f957b2c219630f332023baba72
diff --git a/vim/bundle/paste_insert b/vim/bundle/paste_insert
-Subproject 0365dd11c050f885050cd6dd22405c81aba5f46
+Subproject 1ffcb96611315dd068b734d5aae7ff07fa2b3a2
diff --git a/vim/bundle/put_date b/vim/bundle/put_date
new file mode 160000
+Subproject 598090797c2cb3a4fe945d2eacd3eca42a0cfe5
diff --git a/vim/bundle/spellfile_local b/vim/bundle/spellfile_local
-Subproject 16dbdc90b39c1ebf43ca1881a493edc816d2d9f
+Subproject 8772445433cffa3722c441569ae82f5ade4938c
diff --git a/vim/bundle/squeeze_repeat_blanks b/vim/bundle/squeeze_repeat_blanks
-Subproject 8c849183f8723086e6b61a0644292bdb1ad99c1
+Subproject 27dd1b5858b4839b34249c106d2b3963a3da416
diff --git a/vim/bundle/undofileskip b/vim/bundle/undofileskip
new file mode 160000
+Subproject 1d0a5cf3aa1bf1f360862819d229d756958df32
diff --git a/vim/filetype.vim b/vim/filetype.vim
index 137d1cf5..4ecc7aab 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -107,6 +107,7 @@ augroup filetypedetect
\,.gitconfig
\,.gitmodules
\,gitconfig
+ \,~/.config/git/config
\ setfiletype gitconfig
" Git rebase manifests
autocmd BufNewFile,BufRead
@@ -170,6 +171,11 @@ augroup filetypedetect
\ ?*.l
\,?*.lex
\ setfiletype lex
+ " limits.conf(5) files
+ autocmd BufNewFile,BufRead
+ \ limits.conf
+ \,*/limits.d/*.conf
+ \ setfiletype limits
" Lisp
autocmd BufNewFile,BufRead
\ ?*.lisp
@@ -190,10 +196,15 @@ augroup filetypedetect
\ ?*.msg
\,mutt-*-[0-9]\+-[0-9]\+-[0-9]\+
\ setfiletype mail
- " Mail messages
+ " Mail aliases
autocmd BufNewFile,BufRead
\ aliases
\ setfiletype mailaliases
+ " Mailcap (MIME app reference) files
+ autocmd BufNewFile,BufRead
+ \ mailcap
+ \,.mailcap
+ \ setfiletype mailcap
" Makefiles
autocmd BufNewFile,BufRead
\ Makefile
@@ -208,7 +219,8 @@ augroup filetypedetect
" Mutt configuration files
autocmd BufNewFile,BufRead
\ Muttrc
- \,*/.muttrc.d/*.rc
+ \,*/.muttrc.d/?*.rc
+ \,*/muttrc.d/?*.rc
\,.muttrc
\,muttrc
\,/etc/Muttrc.d/*
@@ -244,6 +256,10 @@ augroup filetypedetect
\,/etc/shadow-
\,/etc/shadow.edit
\ setfiletype passwd
+ " Packet capture files
+ autocmd BufNewFile,BufRead
+ \ ?*.pcap
+ \ setfiletype pcap
" Perl 5 files
autocmd BufNewFile,BufRead
\ ?*.pl
@@ -270,6 +286,15 @@ augroup filetypedetect
autocmd BufNewFile,BufRead
\ ?*.pod6
\ setfiletype pod6
+ " protocols(5) files
+ autocmd BufNewFile,BufRead
+ \ protocols
+ \ setfiletype protocols
+ " printcap(5) files
+ autocmd BufNewFile,BufRead
+ \ printcap
+ \ let b:ptcap_type = 'print'
+ \|setfiletype ptcap
" Python files
autocmd BufNewFile,BufRead
\ ?*.py
@@ -297,6 +322,10 @@ augroup filetypedetect
autocmd BufNewFile,BufRead
\ ?*.rb
\ setfiletype ruby
+ " Samba config
+ autocmd BufNewFile,BufRead
+ \ smb.conf
+ \ setfiletype samba
" sed files
autocmd BufNewFile,BufRead
\ ?*.sed
@@ -365,6 +394,11 @@ augroup filetypedetect
autocmd BufNewFile,BufRead
\ svn-commit*.tmp
\ setfiletype svn
+ " sysctl configuration files
+ autocmd BufNewFile,BufRead
+ \ /etc/sysctl.conf
+ \,/etc/sysctl.d/*.conf
+ \ setfiletype sysctl
" Systemd unit files
autocmd BufNewFile,BufRead
\ */systemd/*.*
@@ -395,7 +429,7 @@ augroup filetypedetect
autocmd BufNewFile,BufRead
\ ?*.tsv
\ setfiletype tsv
- " VimL files
+ " Vim script files
autocmd BufNewFile,BufRead
\ ?*.vim
\,.exrc
@@ -416,7 +450,7 @@ augroup filetypedetect
\ .wgetrc
\,wgetrc
\ setfiletype wget
- " Add automatic commands to find Xresources subfiles
+ " Add automatic commands to find .Xresources subfiles
autocmd BufNewFile,BufRead
\ .Xresources
\,*/.Xresources.d/*
@@ -455,8 +489,8 @@ augroup filetypedetect
\,zshrc
\ setfiletype zsh
- " If it's a new file in a bin, libexec, or scripts subdir that has a
- " Makefile.PL sibling, and I'm editing it, it's almost definitely Perl.
+ " If it's a new file in a bin, libexec, or scripts subdirectory that has
+ " a Makefile.PL sibling, and I'm editing it, it's almost definitely Perl.
autocmd BufNewFile
\ ?*/bin/?*
\,?*/libexec/?*
diff --git a/vim/ftplugin/csv.vim b/vim/ftplugin/csv.vim
index 9bd3e86e..68378d62 100644
--- a/vim/ftplugin/csv.vim
+++ b/vim/ftplugin/csv.vim
@@ -4,6 +4,6 @@ if exists('b:did_ftplugin')
endif
let b:did_ftplugin = 1
-" No autoformatting
+" No automatic formatting
setlocal formatoptions=
let b:undo_ftplugin = 'formatoptions<'
diff --git a/vim/ftplugin/mail.vim b/vim/ftplugin/mail.vim
new file mode 100644
index 00000000..bc10a2ec
--- /dev/null
+++ b/vim/ftplugin/mail.vim
@@ -0,0 +1,15 @@
+" Only do this when not yet done for this buffer--but don't set the flag
+" ourselves, either; this is intended to be a prelude to
+" $VIMRUNTIME/ftplugin/mail.vim
+"
+if exists('b:did_ftplugin')
+ finish
+endif
+
+" Force no_mail_maps value on to work around loading bad maps in
+" $VIMRUNTIME/ftplugin/mail.vim
+"
+if exists('no_mail_maps')
+ let b:no_mail_maps = no_mail_maps
+endif
+let no_mail_maps = 1
diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim
index 3f41cf8d..ddd88e2c 100644
--- a/vim/ftplugin/markdown.vim
+++ b/vim/ftplugin/markdown.vim
@@ -56,7 +56,7 @@ xnoremap <buffer> <expr> <LocalLeader>Q
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
\ . '|xunmap <buffer> <LocalLeader>Q'
-" Autoformat headings
+" Automatically format headings
command -buffer -nargs=1 MarkdownHeading
\ call markdown#Heading(<f-args>)
nnoremap <buffer> <LocalLeader>=
diff --git a/vim/plugin/2html.vim b/vim/plugin/2html.vim
deleted file mode 100644
index 95dcbb6c..00000000
--- a/vim/plugin/2html.vim
+++ /dev/null
@@ -1 +0,0 @@
-let g:html_font = ['DejaVu Sans Mono', 'Ubuntu Mono', 'Consolas']
diff --git a/vim/plugin/fortune.vim b/vim/plugin/fortune.vim
deleted file mode 100644
index efc03467..00000000
--- a/vim/plugin/fortune.vim
+++ /dev/null
@@ -1,4 +0,0 @@
-command! -bar Fortune
- \ call fortune#()
-nnoremap <silent> <Plug>(Fortune)
- \ :<C-U>Fortune<CR>
diff --git a/vim/plugin/put_date.vim b/vim/plugin/put_date.vim
deleted file mode 100644
index 7848e95f..00000000
--- a/vim/plugin/put_date.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-if exists('loaded_put_date') || &compatible || !exists('*strftime')
- finish
-endif
-let loaded_put_date = 1
-command! -bang -bar -nargs=* -range PutDate
- \ call put_date#(<q-line1>, <q-bang> ==# '!', <q-args>)
diff --git a/vim/vimrc b/vim/vimrc
index 2328bb11..f276cb92 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -2,7 +2,7 @@
" Tom Ryder (tejr)’s Literate Vimrc
" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"
-" Last updated: Thu, 19 Dec 2019 17:07:46 +1300
+" Last updated: Wed, 10 Jun 2020 22:41:57 UTC
"
" │ And I was lifted up in heart, and thought
" │ Of all my late-shown prowess in the lists,
@@ -11,130 +11,186 @@
" │ Had heaven appeared so blue, nor earth so green,
" │ For all my blood danced in me, and I knew
" │ That I should light upon the Holy Grail.
-" │
-" │ —Tennyson
"
+" —Tennyson
+"
+" │ your vimrc is better than the bible
+"
+" —@polanco@mastodon.sdf.org
+" <https://mastodon.sdf.org/@polanco/104069285780040986>
+"
+
" This file is an attempt at something like a “literate vimrc”, in the
" tradition of Donald Knuth’s “literate programming”:
" <http://www.literateprogramming.com/>
"
-" The dotfiles project that comprises it is maintained here:
+" The dotfiles project as part of which it is maintained is here:
" <https://sanctum.geek.nz/cgit/dotfiles.git>
"
-" This is a long file, and comments abound within. Should this be bothersome,
-" one could execute this command in Vim itself to strip out all lines either
-" blank or comprising solely comments:
+" This is a long file, and comments abound. Should this be bothersome, one
+" could execute this command in Vim itself, to strip out comment blocks and
+" blank lines:
"
" :g/\m^$\|^\s*"/d
"
-" This file should be saved as ‘vimrc’—no leading period—in the user runtime
-" directory. On Unix-like operating systems, hereinafter referred to as
-" “*nix”, that directory is ‘~/.vim’; on Windows, it’s ‘~/vimfiles’.
-" Fortunately, those are the only two kinds of operating systems that exist,
-" anywhere in the world.
-"
-" It requires Vim v7.0.0 or newer, with the +eval feature, and the
-" 'compatible' option turned off, chiefly to allow line continuations. The
-" vimrc stub at ~/.vimrc (Unix) or ~/_vimrc (Windows) should check that these
-" conditions are met before loading this file with ‘:runtime vimrc’.
-"
-" All of this should survive a pass of the Vim script linter Vint with no
-" errors, warnings, or style problems: <https://github.com/Kuniwak/vint>
-"
-
-" We’ll begin by making sure that we and Vim are speaking the same language.
-" Since it’s been the future for a few years now, this file has characters
-" outside the ASCII character set, which prompts Vint to suggest declaring the
-" file encoding with a :scriptencoding command. The :help for that command
-" specifies that this should be done after 'encoding' is set, so we’ll do that
-" here, too.
-"
-" On *nix, I define the primary locale environment variable $LANG, almost
-" always specifying a multibyte locale. This informs Vim’s choice of internal
-" character encoding, but the default for the 'encoding' option in the absence
-" of a valid $LANG is ‘latin1’. Since this is almost never what I want, we’ll
-" manually choose the UTF-8 encoding for Unicode in the absence of any other
-" explicit specification.
-"
-if &encoding ==# 'latin1' && !exists('$LANG')
- set encoding=utf-8
+" This file should be saved as ‘vimrc’—note no leading period—in the user
+" runtime directory. On GNU/Linux, Mac OS X, and BSD, that directory is
+" ‘~/.vim’. On Windows, it’s ‘~/vimfiles’. It requires Vim v7.0.0 or newer,
+" including the +eval feature, and with the 'compatible' option turned off.
+" That's to allow line continuations. The vimrc stub at ~/.vimrc (Unix) or
+" ~/_vimrc (Windows) checks that these conditions are met before loading this
+" file.
+"
+" The Vim script linter Vint should raise no errors, warnings, or style
+" problems with this file. <https://github.com/Kuniwak/vint>
+"
+
+" We’ll begin by making sure that this file and Vim are speaking the same
+" language. Since it’s been the future for a few years now, this file
+" indulges in characters outside the ASCII character set. The presence of
+" such characters prompts Vint to suggest declaring the file encoding with
+" a :scriptencoding command:
+"
+" │ vim/vimrc:1:1: Use scriptencoding when multibyte char exists (see :help
+" │ :scriptencoding)
+"
+" Furthermore, the :help for :scriptencoding specifies that :scriptencoding
+" should be set *after* 'encoding'.
+"
+" Which encoding to use? The answer is the UTF-8 encoding for Unicode,
+" wherever possible. On POSIX-fearing operating systems, I define the primary
+" locale environment variable $LANG to ‘en_NZ.UTF-8’. This informs Vim’s
+" choice of internal character encoding. In the absence of such a setting,
+" 'encoding' defaults to ‘latin1’ (ISO-8859-1) in most circumstances. Since
+" this is almost never what I want, even if I haven't said so explicitly by
+" exporting $LANG, we’ll fall back to UTF-8 instead.
+"
+" However, we need to test that the +multi_byte feature is available before
+" doing any of this, because it was a compile-time feature that wasn't even
+" enabled by default in Vim v7.0. Its status as an optional feature wasn't
+" removed until v8.1.0733.
+"
+" <https://github.com/vim/vim/releases/tag/v8.1.0733>
+"
+if has#('multi_byte')
+ if &encoding ==# 'latin1' && !exists('$LANG')
+ set encoding=utf-8
+ endif
+ scriptencoding utf-8
endif
-scriptencoding utf-8
" With encoding handled, we’ll turn our attention to the value of the
" 'runtimepath' option, since any scripts loaded from the paths specified
-" therein control so much of the behavior of Vim. I’d like to do this as
-" accurately as possible, even with Vim’s unusual behavior around escaping of
-" these variables. One of the first things we’ll need to be able to do is
-" split the value of 'runtimepath' into its constituent path parts.
-"
-" Splitting the values of comma-separated options correctly is surprisingly
-" complicated. The list separator for such options is more accurately defined
-" as follows:
-"
-" │ A comma not preceded by a backslash, and possibly followed by an arbitrary
-" │ number of spaces and commas.
-"
-" The pattern required for the split breaks down like this:
-"
-" \\ ← Literal backslash
-" \@<! ← Negative lookbehind assertion; means that whatever occurred
-" before this pattern, here a backslash, cannot precede what
-" follows, but anything that does precede it is not removed from
-" the data as part of the split delimiter
-" , ← Literal comma
+" therein control so much of the behavior of Vim. We build this path up as
+" accurately as possible, accounting for Vim’s unusual escaping behavior for
+" these list options.
+"
+" One of the first things we’ll need to be able to do is split the value of
+" 'runtimepath' into its constituent paths. Correctly splitting the values of
+" comma-separated Vim options is surprisingly complicated. It's not as simple
+" as just splitting on commas, or even unescaped commas; a more accurate
+" definition of the delimiter is:
+"
+" │ Any comma not preceded by a backslash, followed by any number of spaces
+" │ and commas.
+"
+" The pattern we use for the call to split() therefore breaks down like this:
+"
+" \\ ← A literal backslash
+" \@<! ← A negative lookbehind assertion; this means that whatever
+" occurred before this pattern—in this case, a backslash—cannot
+" precede what follows, but anything that *does* precede it is
+" considered part of the datum, and not the delimiter.
+" , ← A literal comma
" [, ]* ← Any number of commas and spaces
"
" We don’t, however, have to deal with backslashes before other backslashes,
-" nor before any other character. You can read the source code for the ad-hoc
-" tokenizer in copy_option_part() in src/misc2.c in Vim’s source code, and
-" test it with some values of your own, if you want to understand why. Vim,
-" I love you, but you are really weird sometimes.
-"
-" We do all this with an autoloaded function option#Split().
-"
-" If an environment variable MYVIM exists, and it isn’t blank, apply its value
-" as the first value of 'runtimepath', after escaping it appropriately.
-" Otherwise, do it the other way around: the first path in the 'runtimepath'
-" list becomes MYVIM.
-"
-if exists('$MYVIM') && $MYVIM !=# ''
- execute 'set runtimepath^='.argument#Escape(option#item#Escape($MYVIM, 1))
-elseif &runtimepath !=# ''
- let $MYVIM = option#Split(&runtimepath)[0]
-endif
-
-" We need a command to reliably establish a full path, whether or not the
-" directories already exist. We create a wrapper for the autoloaded function
-" path#Create() with similar calling conventions to mkdir(), but with the ‘p’
-" value for the second parameter {prot} forced on. Calling it with a bang
-" like :CreatePath! creates a private directory (permissions 0700).
+" nor before any other character. If this seems wrong to you, I encourage you
+" to read the source code for the ad-hoc tokenizer in copy_option_part() in
+" src/misc2.c in Vim’s source code.
"
-command! -bang -bar -complete=dir -nargs=1 CreatePath
- \ call path#Create(expand(<q-args>), <q-bang> ==# '!')
-
-" Now that we have a way to create directories if they don’t already exist,
-" let’s apply it for the first time to the user runtime directory. Note that
-" we aren’t checking whether this actually succeeded. We do want errors
-" raised if there were problems with the creation, but we’ll barrel on ahead
-" regardless after warning the user about our failure.
+" Vim, I do love you, but sometimes you're really weird.
+"
+" We fold all that mess away into an autoloaded function option#Split(); see
+" vim/autoload/option.vim. Provided a 'runtimepath' is actually set, using
+" the list returned from that function, we define an environment variable
+" MYVIM—to complement MYVIMRC—for ~/.vim or ~/vimfiles, by retrieving the
+" first value from the 'runtimepath'. We'll use this later on in the file to
+" comprehensively match expected paths for vimrc files.
"
+if &runtimepath ==# ''
+ throw 'Empty ''runtimepath'''
+endif
+let $MYVIM = option#Split(&runtimepath)[0]
+
+" The next components of the runtime directory that we'll set up here will
+" make use of the user’s configured XDG base directories:
+"
+" <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables>
+"
+" Note that this isn't an attempt to shoehorn all of Vim into the XDG mold;
+" all of this distribution's files are still expected to be installed into
+" $MYVIM, per the above. We're just leaning on XDG’s conventions to provide
+" separate locations for cache files and other configuration.
+"
+" We'll start by retrieving the list of valid paths for configuration from
+" both the XDG_CONFIG_HOME and XDG_CONFIG_DIRS variables, or from their
+" defaults, using autoloaded xdg# functions.
+"
+let s:xdgcachehome = xdg#CacheHome()
+let s:xdgconfigdirs = xdg#ConfigDirs()
+let s:xdgconfighome = xdg#ConfigHome()
+let s:xdgdatadirs = xdg#DataDirs()
+let s:xdgdatahome = xdg#DataHome()
+
+" We put XDG_CONFIG_HOME at the front of the 'runtimepath' list with insert(),
+" provided it isn't empty, which is what the function returns when the
+" configured path isn't absolute. This is per the standard's dictum:
+"
+" │ All paths set in these environment variables must be absolute. If an
+" │ implementation encounters a relative path in any of these variables it
+" │ should consider the path invalid and ignore it.
+"
+" —XDG Base Directory Specification v0.7 (24th November 2010), "Basics",
+" <https://specifications.freedesktop.org/basedir-spec/0.7/ar01s02.html>
+"
+" Ours not to reason why…
+"
+if s:xdgconfighome !=# '' || !empty(s:xdgconfigdirs)
+ execute 'set runtimepath^='.option#Escape(join(map(
+ \ extend(
+ \ s:xdgconfighome !=# '' ? [s:xdgconfighome] : [],
+ \ s:xdgconfigdirs
+ \),
+ \ 'option#item#Escape(v:val)'
+ \), ','))
+ execute 'set runtimepath+='.option#Escape(join(map(
+ \ reverse(extend(
+ \ s:xdgconfighome !=# '' ? [s:xdgconfighome] : [],
+ \ s:xdgconfigdirs
+ \)),
+ \ 'option#item#Escape(v:val.''/after'')'
+ \), ','))
+endif
+
" Using a logical but non-default location for viminfo has the nice benefit of
" preventing command and search history from getting clobbered when something
" runs Vim without using this vimrc, because such an instance will safely
-" write its own history to the default viminfo path instead. It also
-" contributes to our aim of having everything related to the Vim runtime
-" process in one dedicated directory tree.
-"
-" The normal method of specifying the path to the viminfo file, as applied
-" here, is an addendum of the path to the 'viminfo' option with an ‘n’ prefix.
-" Vim v8.1.716 introduced a nicer way to set this with an option named
-" 'viminfofile', but that’s still too new for us to use just yet.
+" write its own history to the default viminfo path instead.
"
-" <https://github.com/vim/vim/releases/tag/v8.1.0716>
+" This is the portable way to specify the path to the viminfo file, as an
+" addendum of the path to the 'viminfo' option with an ‘n’ prefix. Vim
+" v8.1.716 introduced a way to set this with an option named 'viminfofile',
+" but I don't see a reason to use that.
"
-execute 'set viminfo+='.argument#Escape('n'.$MYVIM.'/viminfo')
-CreatePath $MYVIM
+if s:xdgcachehome !=# ''
+ if !isdirectory(s:xdgcachehome)
+ call mkdir(s:xdgcachehome, 'p', 0700)
+ endif
+ execute 'set viminfo+='.option#Escape(
+ \ 'n'.s:xdgcachehome.'/viminfo'
+ \)
+endif
" Speaking of recorded data in viminfo files, the default Vim limit of a mere
" 50 entries for command and search history is pretty stingy. Because I don’t
@@ -179,10 +235,14 @@ set history=10000
" 'backupfullname', 'swapfilefullname' would have been clearer.
"
set backup
-execute 'set backupdir^='.argument#Escape(option#item#Escape(
- \ $MYVIM.'/backup'.(has#('patch-8.1.251') ? '//' : ''),
- \))
-CreatePath! $MYVIM/backup
+if s:xdgcachehome !=# ''
+ if !isdirectory(s:xdgcachehome.'/backup')
+ call mkdir(s:xdgcachehome.'/backup', 'p', 0700)
+ endif
+ execute 'set backupdir^='.option#Escape(option#item#Escape(
+ \ s:xdgcachehome.'/backup'.(has#('patch-8.1.251') ? '//' : '')
+ \))
+endif
" Files in certain directories on Unix-compatible filesystems should not be
" backed up, for security reasons. This is particularly important if editing
@@ -215,31 +275,51 @@ endif
" default of writing them to the same directory as the buffer file. Add two
" trailing slashes to the path to prompt Vim to use the full escaped path in
" its name, in order to avoid filename collisions, since the 'directory'
-" option has supported that hint for much longer than 'backupdir' has. We
-" apply path#Create() to attempt to create the path, if needed.
+" option has supported that hint for much longer than 'backupdir' has.
"
-execute 'set directory^='
- \.argument#Escape(option#item#Escape($MYVIM.'/swap//'))
-CreatePath! $MYVIM/swap
+if s:xdgcachehome !=# ''
+ if !isdirectory(s:xdgcachehome.'/swap')
+ call mkdir(s:xdgcachehome.'/swap', 'p', 0700)
+ endif
+ execute 'set directory^='.option#Escape(option#item#Escape(
+ \ s:xdgcachehome.'/swap//'
+ \))
+endif
" Keep tracked undo history for files permanently, in a dedicated cache
" directory, so that the u/:undo and CTRL-R/:redo commands will work between
" Vim invocations.
"
" The 'undodir' option has the same structure as 'backupdir' and 'directory';
-" if we have a user runtime directory, create a sub-subdirectory within it
-" dedicated to the undo files cache. Note also the trailing double-slash as
-" a signal to Vim to use the full path of the original file in its undo file
-" cache’s name.
+" if we have a user cache directory, create a subdirectory within it dedicated
+" to the undo files cache. Note also the trailing double-slash as a signal to
+" Vim to use the full path of the original file in its undo file cache’s name.
"
" Support for these persistent undo file caches was not released until v7.3.0,
" so we need to check for the feature’s presence before we enable it.
"
-if has#('persistent_undo')
+if s:xdgcachehome !=# '' && has#('persistent_undo')
set undofile
- execute 'set undodir^='
- \.argument#Escape(option#item#Escape($MYVIM.'/undo//'))
- CreatePath! $MYVIM/undo
+ if !isdirectory(s:xdgcachehome.'/undo')
+ call mkdir(s:xdgcachehome.'/undo', 'p', 0700)
+ endif
+ execute 'set undodir^='.option#Escape(option#item#Escape(
+ \ s:xdgcachehome.'/undo//'
+ \))
+endif
+
+" Set up a directory for files generated by :mkview. To date, I think I have
+" used this twice in my life, but may as well be consistent with the other
+" directories of this type. This isn't a comma-separated list like the others
+" ('backupdir', 'directory', 'spell', 'undodir')
+"
+if s:xdgcachehome !=# '' && has#('mksession')
+ if !isdirectory(s:xdgcachehome.'/view')
+ call mkdir(s:xdgcachehome.'/view', 'p', 0700)
+ endif
+ execute 'set viewdir='.option#Escape(option#item#Escape(
+ \ s:xdgcachehome.'/view'
+ \))
endif
" Now that we have a bit more confidence in our runtime environment, set up
@@ -250,7 +330,7 @@ filetype plugin indent on
" There are a couple of contexts in which it's useful to reload filetypes for
" the current buffer, quietly doing nothing if filetypes aren't enabled.
" We'll set up a user command named :ReloadFileType to do this, with
-" a script-local function backing it.
+" an autloaded function backing it.
"
command! -bar ReloadFileType
\ call reload#FileType()
@@ -265,10 +345,6 @@ command! -bar ReloadFileType
" define the new command wrapper around an autoloaded function that itself
" issues a :ReloadFileType command after the vimrc file is sourced.
"
-" We can't put the actual :source command into the script-local function we
-" define here, because Vim would get upset that we're trying to redefine
-" a function as it executes!
-"
command! -bar ReloadVimrc
\ call reload#Vimrc()
@@ -285,8 +361,12 @@ augroup END
" saves restarting Vim or running the :source command manually, which I almost
" always want to do after changing my vimrc file anyway.
"
-autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc
+autocmd vimrc BufWritePost $MYVIMRC
\ ReloadVimrc
+if $MYVIM !=# ''
+ autocmd vimrc BufWritePost $MYVIM/vimrc
+ \ doautocmd vimrc BufWritePost $MYVIMRC
+endif
" If Vim is new enough (v7.0.187) to support the ##SourceCmd event for
" automatic command hooks, we'll also apply a hook for that event to catch
@@ -296,8 +376,12 @@ autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc
" <https://github.com/vim/vim/releases/tag/v7.0.187>
"
if exists('##SourceCmd')
- autocmd vimrc SourceCmd $MYVIMRC,$MYVIM/vimrc
+ autocmd vimrc SourceCmd $MYVIMRC
\ ReloadVimrc
+ if $MYVIM !=# ''
+ autocmd vimrc SourceCmd $MYVIM/vimrc
+ \ doautocmd vimrc SourceCmd $MYVIMRC
+ endif
endif
" For spelling, use New Zealand English by default, but later on we’ll
@@ -317,6 +401,17 @@ set spelllang=en_nz
"
set spellcapcheck=[.?!]\\%(\ \ \\\|[\\n\\r\\t]\\)
+" When spell-checking snakeCased or CamelCased words, treat every upper-case
+" character in a word text object as the beginning of a new word for separate
+" spell-checking. At the time of writing, this is still a very new option
+" (v8.2.0953, June 2020).
+"
+" <https://github.com/vim/vim/releases/tag/v8.2.0953>
+"
+if exists('+spelloptions')
+ set spelloptions+=camel
+endif
+
" For word completion in insert mode with CTRL-X CTRL-K, or if 'complete'
" includes the ‘k’ flag, the 'dictionary' option specifies the path to the
" system word list. This makes the dictionary completion work consistently,
@@ -335,33 +430,38 @@ set spellcapcheck=[.?!]\\%(\ \ \\\|[\\n\\r\\t]\\)
" In much the same way, we add an expected path to a thesaurus, for completion
" with CTRL-X CTRL-T in insert mode, or with ‘t’ added to 'completeopt'. The
" thesaurus data isn’t installed as part of the default ‘install-vim’ target
-" in tejr’s dotfiles, but it can be retrieved and installed with
-" ‘install-vim-thesaurus’.
-"
-" I got the thesaurus itself from the link in the :help for 'thesaurus' in
-" v8.1. It’s from WordNet and MyThes-1. I maintain a mirror on my own
-" website that the Makefile recipe attempts to retrieve. I had to remove the
-" first two metadata lines from thesaurus.txt, as Vim appeared to interpret
-" them as part of the body data.
-"
-" Extra checks for appending the 'dictionary' and 'thesaurus' paths in MYVIM
-" need to be made, because the P_NDNAME property is assigned to them, which
-" enforces a character blacklist in the option value. We check for the
-" expected Vim error code here, and if the MYVIM path offends, we just skip
-" the setting entirely, rather than throwing cryptic errors at the user. None
-" of the blacklisted characters are particularly wise characters to have in
-" paths, anyway, legal though they may be on Unix filesystems. We can’t work
-" around this one with 'isfname'; the blacklist is hard-coded.
+" in tejr’s dotfiles, but a decent one can be retrieved from my website at
+" <https://sanctum.geek.nz/ref/thesaurus.txt>. I got this from the link in
+" the :help for 'thesaurus' in v8.1. It’s from WordNet and MyThes-1. I had
+" to remove the first two metadata lines from thesaurus.txt, as Vim appeared
+" to interpret them as part of the body data.
+"
+" Extra checks for appending the 'dictionary' and 'thesaurus' paths need to be
+" made, because the P_NDNAME property is assigned to them, which enforces
+" a character blacklist in the option value. We check for the expected Vim
+" error code here, and if the path offends, we just skip the setting entirely,
+" rather than throwing cryptic errors at the user. None of the blacklisted
+" characters are particularly wise characters to have in paths, anyway, legal
+" though they may be on Unix filesystems. We can’t work around this one with
+" 'isfname'; the blacklist is hard-coded.
"
set dictionary^=/usr/share/dict/words
-let s:ref = $MYVIM.'/ref'
-try
- execute 'set dictionary^='
- \.argument#Escape(option#item#Escape(s:ref.'/dictionary.txt'))
- execute 'set thesaurus^='
- \.argument#Escape(option#item#Escape(s:ref.'/thesaurus.txt'))
-catch /^Vim\%((\a\+)\)\=:E474:/
-endtry
+if s:xdgdatahome !=# '' || !empty(s:xdgdatadirs)
+ execute 'set dictionary^='.option#Escape(join(map(
+ \ extend(
+ \ s:xdgdatahome !=# '' ? [s:xdgdatahome] : [],
+ \ s:xdgdatadirs
+ \),
+ \ 'option#item#Escape(v:val.''/dictionary.txt'')'
+ \), ','))
+ execute 'set thesaurus^='.option#Escape(join(map(
+ \ extend(
+ \ s:xdgdatahome !=# '' ? [s:xdgdatahome] : [],
+ \ s:xdgdatadirs
+ \),
+ \ 'option#item#Escape(v:val.''/thesaurus.txt'')'
+ \), ','))
+endif
" Next, we’ll modernize a little in adjusting some options with old
" language-specific defaults.
@@ -479,7 +579,7 @@ set foldlevel=256
" If a line is already longer than 'textwidth' would otherwise limit when
" editing of that line begins in insert mode, don’t suddenly automatically
-" wrap it; I’ll break it apart myself with a command like 'gq'. This doesn’t
+" wrap it; I’ll break it apart myself with a command like ‘gq’. This doesn’t
" seem to stop paragraph reformatting with ‘a’, if that’s set.
"
set formatoptions+=l
@@ -860,9 +960,9 @@ endif
" almost always stands out too much for my liking.
"
" You’d think the pattern here could be used to match the color scheme name,
-" and it can be...after patch v7.4.108, when Christian Brabandt fixed it.
-" Until that version, it matched against the current buffer name, so we’re
-" forced to have an explicit test in the command instead.
+" and it can be—after patch v7.4.108, when Christian Brabandt fixed it. Until
+" that version, it matched against the current buffer name, so we’re forced to
+" have an explicit test in the command instead.
"
" <https://github.com/vim/vim/releases/tag/v7.4.108>
"
@@ -873,7 +973,7 @@ autocmd vimrc ColorScheme *
" environment variable COLORFGBG or a response in v:termrbgresp that would set
" it specifically.
"
-if !exists('$COLORFGBG') && get(v:, 'termrbgresp', '') ==# ''
+if !exists('$COLORFGBG') && !get(v:, 'termrbgresp')
set background=dark
endif
@@ -906,7 +1006,7 @@ endif
" extent possible, and avoid “doing more” in insert mode besides merely
" inserting text as it’s typed.
"
-" * Avoid key chords with Ctrl in favor of leader keys.
+" * Avoid key chords with CTRL in favor of leader keys.
"
" * Never use Alt/Meta key chords; the terminal support for them is just too
" confusing and flaky.
@@ -926,7 +1026,8 @@ endif
" alternate buffer. User nickspoons of #vim was incredulous that I had never
" used CTRL-^ and indeed did not know about it. I have since repented.
"
-nnoremap <Backspace> <C-^>
+nnoremap <Backspace>
+ \ <C-^>
" I find the space bar’s default behavior in normal mode of moving right one
" character to be useless. Instead, I remap it to be a lazy way of paging
@@ -937,8 +1038,8 @@ nnoremap <Backspace> <C-^>
"
nnoremap <expr> <Space>
\ line('w$') < line('$')
- \ ? "\<PageDown>"
- \ : ":\<C-U>next\<CR>"
+ \ ? "\<PageDown>"
+ \ : ":\<C-U>next\<CR>"
" I hate CTRL-C’s default insert mode behavior. It ends the insert session
" without firing the InsertLeave event for automatic command hooks. Why would
@@ -977,7 +1078,8 @@ nnoremap <expr> <Space>
" uselessness.
"
if plugin#Ready('insert_cancel')
- imap <C-C> <Plug>(InsertCancel)
+ imap <C-C>
+ \ <Plug>(InsertCancel)
endif
" I often can’t remember (or guess) digraph codes, and want to look up how to
@@ -1011,7 +1113,8 @@ endif
" checking that the plugin’s available before we map to it; it’ll just quietly
" do nothing.
"
-imap <C-K><C-K> <Plug>(DigraphSearch)
+imap <C-K><C-K>
+ \ <Plug>(DigraphSearch)
" I end up hitting CTRL-L to clear or redraw the screen in interactive shells
" and tools like Mutt and Vim pretty often. It feels natural to me to stack
@@ -1034,14 +1137,16 @@ nnoremap <C-L>
" for this, but it didn’t work. Maybe i_CTRL-O doesn’t respect mappings.
" I couldn’t find any documentation about it.
"
-inoremap <C-L> <C-O>:execute "normal \<C-L>"<CR>
+inoremap <C-L>
+ \ <C-O>:execute "normal \<C-L>"<CR>
-" We use :vnoremap here rather than :xnoremap and thereby make the mapping
-" apply to select mode as well, because CTRL-L doesn’t reflect a printable
-" character, and so we may as well make it work, even though I don’t actually
-" use select mode directly.
+" We use :vmap here rather than :xmap to have the mapping applied for select
+" mode as well as visual mode. This is because CTRL-L doesn’t reflect
+" a printable character, and so we don't shadow anything by making it work,
+" even though I don’t actually use select mode directly very much.
"
-vmap <C-L> <Esc><C-L>gv
+vmap <C-L>
+ \ <Esc><C-L>gv
" By default, the very-useful normal mode command ‘&’ that repeats the
" previous :substitute command doesn’t preserve the flags from that
@@ -1060,7 +1165,8 @@ sunmap &
"
" <https://sanctum.geek.nz/cgit/vim-colon-operator.git/about/>
"
-nmap g: <Plug>(ColonOperator)
+nmap g:
+ \ <Plug>(ColonOperator)
" I used Tim Pope’s unimpaired.vim plugin for ages, and I liked some of these
" bracket pair mappings, so I’ve carried a few of the simpler ones over. All
@@ -1096,8 +1202,10 @@ nnoremap ]l
"
" <https://sanctum.geek.nz/cgit/vim-put-blank-lines.git/about/>
"
-nmap [<Space> <Plug>(PutBlankLinesAbove)
-nmap ]<Space> <Plug>(PutBlankLinesBelow)
+nmap [<Space>
+ \ <Plug>(PutBlankLinesAbove)
+nmap ]<Space>
+ \ <Plug>(PutBlankLinesBelow)
" We’re on to the leader maps, now. It’s difficult to know in what order to
" describe and specify these. I used to have them in alphabetical order, but
@@ -1118,7 +1226,8 @@ let maplocalleader = ','
" relying on mapping 'timeout'.
"
if maplocalleader ==# ','
- noremap ,, ,
+ noremap ,,
+ \ ,
sunmap ,,
endif
@@ -1188,7 +1297,7 @@ nnoremap <Leader>f
" I often have to switch between US English and NZ English. The latter is
" almost exactly the same as UK English in most locales, although we use
" dollars rather than pounds. This is mostly so I remember things like
-" excluding or including the ‘u’ in words like 'favourite', depending on the
+" excluding or including the ‘u’ in words like ‘favourite’, depending on the
" target audience. I generally use US English for international audiences.
"
nnoremap <Leader>z
@@ -1213,7 +1322,8 @@ nnoremap <Leader>u
"
"" Leader,b toggles settings friendly to copying and pasting
-nmap <Leader>b <Plug>(CopyLinebreakToggle)
+nmap <Leader>b
+ \ <Plug>(CopyLinebreakToggle)
" The above mappings show that mappings for toggling boolean options are
" simple, but there isn’t a way to toggle single flags within option strings
@@ -1237,7 +1347,8 @@ sunmap <Leader>L
" kept confusing me. I’m hoping this will be better.
"" Leader,p prepares the next insert for paste mode
-nmap <Leader>p <Plug>PasteInsert
+nmap <Leader>p
+ \ <Plug>PasteInsert
" These mappings are for managing filetypes. The first one uses the
" :ReloadFileType command that was defined much earlier in this file for
@@ -1264,8 +1375,7 @@ nnoremap <Leader>D
\ :PutDate!<CR>
" This group contains mappings that are to do with file and path management
-" relative to the current buffer. The Leader,P mapping that creates
-" directory hierarchies uses the :CreatePath command created earlier.
+" relative to the current buffer.
"" Leader,g shows the current file’s fully expanded path
nnoremap <Leader>g
@@ -1275,7 +1385,7 @@ nnoremap <Leader>G
\ :<C-U>cd %:h<Bar>pwd<CR>
"" Leader,P creates the path to the current file if it doesn’t exist
nnoremap <Leader>P
- \ :<C-U>CreatePath %:h<CR>
+ \ :<C-U>call mkdir(expand('%:h'), 'p')<CR>
" This group contains mappings that show information about Vim’s internals:
" marks, registers, variables, and the like.
@@ -1339,7 +1449,8 @@ nnoremap <Leader>j
" <Leader>,\ to jump back to the last remembered position in that file, since
" by definition viminfo remembers that mark, too.
"
-nmap <Leader>o <Plug>(SelectOldFiles)
+nmap <Leader>o
+ \ <Plug>(SelectOldFiles)
" This group defines mappings for filtering and batch operations to clean up
" buffer text. All of these mappings use commands from my custom plugins:
@@ -1380,7 +1491,8 @@ onoremap <Leader>_
"" Leader,% or Leader,5 uses entire buffer as an object
onoremap <Leader>%
\ :<C-U>execute 'normal! 1GVG'<CR>
-omap <Leader>5 <Leader>%
+omap <Leader>5
+ \ <Leader>%
" This group defines some useful motions, including navigating by indent
" block using a custom plugin:
@@ -1389,12 +1501,15 @@ omap <Leader>5 <Leader>%
"
"" Leader,{ and Leader,} move to top and bottom of indent region
-map <Leader>{ <Plug>(VerticalRegionUp)
+map <Leader>{
+ \ <Plug>(VerticalRegionUp)
sunmap <Leader>{
-map <Leader>} <Plug>(VerticalRegionDown)
+map <Leader>}
+ \ <Plug>(VerticalRegionDown)
sunmap <Leader>}
"" Leader,\ jumps to the last edit position mark; think “Now, where was I?”
-noremap <Leader>\ `"
+noremap <Leader>\
+ \ `"
sunmap <Leader>\
" This group does both: useful motions on defined text objects.
@@ -1428,40 +1543,45 @@ nnoremap <Leader>?
nnoremap <Leader>.
\ :<C-U>lmake!<CR>
"" Leader,q formats the current paragraph
-nnoremap <Leader>q gqap
+nnoremap <Leader>q
+ \ gqap
"" Leader,r acts as a replacement operator
-map <Leader>r <Plug>(ReplaceOperator)
+map <Leader>r
+ \ <Plug>(ReplaceOperator)
ounmap <Leader>r
sunmap <Leader>r
"" Leader,!/1 repeats the last command, adding a bang
nnoremap <Leader>!
\ :<Up><Home><S-Right>!<CR>
-nmap <Leader>1 <Leader>!
-"" Leader,#/3 switches the current buffer to the next altenate filetype
-nmap <Leader># <Plug>(AlternateFileType)
-nmap <Leader>3 <Leader>#
-"" Leader,$/4 gives me my fortune
-nmap <Leader>$ <Plug>(Fortune)
-nmap <Leader>4 <Leader>$
+nmap <Leader>1
+ \ <Leader>!
+"" Leader,#/3 switches the current buffer to the next alternate filetype
+nmap <Leader>#
+ \ <Plug>(AlternateFileType)
+nmap <Leader>3
+ \ <Leader>#
"" Leader,&/7 escapes regex metacharacters
-map <Leader>& <Plug>(RegexEscape)
+map <Leader>&
+ \ <Plug>(RegexEscape)
ounmap <Leader>&
sunmap <Leader>&
-map <Leader>7 <Leader>&
+map <Leader>7
+ \ <Leader>&
ounmap <Leader>7
sunmap <Leader>7
"" Leader,*/8 is "sticky star":
"" - Set search string to word under cursor
"" - Show search highlighting if it's enabled
"" - Don't move the cursor
-nnoremap <silent> <Leader>*
- \ :<C-U>let @/ = expand('<cword>')<CR>:let &hlsearch = &hlsearch<CR>
-nmap <Leader>8 <Leader>*
+nnoremap <Leader>*
+ \ :<C-U>let @/ = expand('<cword>') <Bar> let &hlsearch = &hlsearch<CR>
+nmap <Leader>8
+ \ <Leader>*
"" Leader,` opens a scratch buffer, horizontally split
-nnoremap <silent> <Leader>`
+nnoremap <Leader>`
\ :<C-U>ScratchBuffer<CR>
"" Leader,~ opens a scratch buffer, vertically split
-nnoremap <silent> <Leader>~
+nnoremap <Leader>~
\ :<C-U>vertical ScratchBuffer<CR>
" And last, but definitely not least, I’m required by Vim fanatic law to
@@ -1478,17 +1598,24 @@ nnoremap <Leader>R
" pretty useful. First, some 'deliberate' abbreviations for stuff I type
" a lot:
"
-inoreabbrev tr@ tom@sanctum.geek.nz
-inoreabbrev tr/ <https://sanctum.geek.nz/>
+inoreabbrev tr@
+ \ tom@sanctum.geek.nz
+inoreabbrev tr/
+ \ <https://sanctum.geek.nz/>
" And then, just automatically fix some things I almsot always spell or type
" wrnog.
"
-inoreabbrev almsot almost
-inoreabbrev wrnog wrong
-inoreabbrev Fielding Feilding
-inoreabbrev THe The
-inoreabbrev THere There
+inoreabbrev almsot
+ \ almost
+inoreabbrev wrnog
+ \ wrong
+inoreabbrev Fielding
+ \ Feilding
+inoreabbrev THe
+ \ The
+inoreabbrev THere
+ \ There
" Here endeth the literate vimrc. Let us praise God.
"
diff --git a/vim/vimrc.stub b/vim/vimrc.stub
index d50cee55..f9ad4d4f 100644
--- a/vim/vimrc.stub
+++ b/vim/vimrc.stub
@@ -1,13 +1,16 @@
" We have a big, important decision to make here.
"
" Check that we’re not running in 'compatible' mode, nor that the environment
-" calls for the same, and that we’re running Vim v7.0.0 or newer. If it’s all
-" clear, we can load the main vimrc file from ~/.vim/vimrc to use Vim in all
-" of its incompatible glory, and then stop sourcing the rest of this file.
+" calls for the same, that we’re running Vim v7.0.0 or newer, and that we
+" haven't been invoked as just plain `vi`. If it’s all clear, we can load the
+" main vimrc file from ~/.vim/vimrc to use Vim in all of its incompatible
+" glory, and then stop sourcing the rest of this file.
"
-if !&compatible && !exists('$POSIXLY_CORRECT') && v:version >= 700
- runtime vimrc
- finish
+if !&compatible && !exists('$POSIXLY_CORRECT')
+ if v:version >=700 && v:progname !=# 'vi'
+ runtime vimrc
+ finish
+ endif
endif
" If we got this far, it means we’re running a tiny, 'compatible', and/or
diff --git a/vint/vintrc.yaml b/vint/vintrc.yaml
index 1a9900df..a5ba9380 100644
--- a/vint/vintrc.yaml
+++ b/vint/vintrc.yaml
@@ -1,3 +1,3 @@
# Show me all my problems, including matters of style
cmdargs:
- severity: style_problem
+ severity: style_problem
diff --git a/wget/profile.d/wget.sh b/wget/profile.d/wget.sh
new file mode 100644
index 00000000..884f19ed
--- /dev/null
+++ b/wget/profile.d/wget.sh
@@ -0,0 +1,5 @@
+# Set path to wgetrc file in XDG dirs. There's no mention of this environment
+# variable in the man page! I had to check the source.
+#
+WGETRC=${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc
+export WGETRC
diff --git a/zsh/zshrc b/zsh/zshrc
index 0aac527e..6d3239eb 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -18,7 +18,7 @@ HISTFILE=$HOME/.zsh_history
SAVEHIST=$((1 << 12))
# Load Zsh-specific startup files
-for zsh in "$HOME"/.zshrc.d/*.zsh ; do
+for zsh in "$HOME"/.zshrc.d/*.zsh(N) ; do
[[ -e $zsh ]] || continue
source "$zsh"
done
diff --git a/zsh/zshrc.d/keep.zsh b/zsh/zshrc.d/keep.zsh
index 869d2039..8a2b9449 100644
--- a/zsh/zshrc.d/keep.zsh
+++ b/zsh/zshrc.d/keep.zsh
@@ -29,7 +29,7 @@ keep() {
# Figure out the directory to which we're reading and writing these scripts
local zshkeep
- zshkeep=${ZSHKEEP:-"$HOME"/.zshkeep.d}
+ zshkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/zshkeep
mkdir -p -- "$zshkeep" || return
# Parse options
@@ -141,7 +141,7 @@ EOF
}
# Load any existing scripts in zshkeep
-for zshkeep in "${ZSHKEEP:-"$HOME"/.zshkeep.d}"/*.zsh(N) ; do
+for zshkeep in "${XDG_DATA_HOME:-"$HOME"/.local/share}"/zshkeep/*.zsh(N) ; do
[[ -e $zshkeep ]] || continue
source "$zshkeep"
done