diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-13 00:05:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-13 00:05:57 +1200 |
commit | c7d1287eddadbbe4279a6f184dc0971f3f302f20 (patch) | |
tree | 14cdb9bc708b62a094492cd1c56d6e05ec3ec9c0 | |
parent | Merge branch 'hotfix/v8.35.1' (diff) | |
parent | Update dotfiles(7) manual page (diff) | |
download | dotfiles-c7d1287eddadbbe4279a6f184dc0971f3f302f20.tar.gz dotfiles-c7d1287eddadbbe4279a6f184dc0971f3f302f20.zip |
Merge branch 'release/v8.36.0'v8.36.0
* release/v8.36.0: (24 commits)
Update dotfiles(7) manual page
Check shrc.d and profile.d dirs for other configs
Move systemd editor setting to after visual
Add option terminators to some mkdir calls
Remove unnecessary directory creations
Update plenv and add pyenv config
Reformat README and fix a path or two
Switch Mutt to XDG basedirs
Add groups generation to Mutt config
Use XDG basedirs for Git config
Use short hostname in tmux status
Re-use a variable for Vim install path
Use XDG for HTML tidy
Try a compatibility switch on vi/vim
Fine-tune perlcritic/perltidy installs
Apply XDG basedirs to i3
Add XDG and compile targets for `less`
Add XDG_CACHE_HOME and XDG_DATA_HOME basedirs
Use XDG_CONFIG_HOME variable in Makefile
...
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | IDEAS.md | 2 | ||||
-rw-r--r-- | Makefile | 125 | ||||
-rw-r--r-- | README.md | 29 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rwxr-xr-x | bin/qat.sh | 12 | ||||
-rw-r--r-- | check/sh.sh | 4 | ||||
-rw-r--r-- | git/config.mi5 (renamed from git/gitconfig.mi5) | 2 | ||||
-rw-r--r-- | i3/config | 2 | ||||
-rw-r--r-- | less/profile.d/less.sh | 2 | ||||
-rw-r--r-- | lint/sh.sh | 4 | ||||
-rw-r--r-- | man/man1/qat.1df | 19 | ||||
-rw-r--r-- | man/man7/dotfiles.7df | 17 | ||||
-rw-r--r-- | mutt/muttrc | 6 | ||||
-rwxr-xr-x | mutt/muttrc.d/src | 17 | ||||
-rw-r--r-- | perlcritic/profile.d/perlcritic.sh | 2 | ||||
-rw-r--r-- | perltidy/profile.d/perltidy.sh | 2 | ||||
-rw-r--r-- | plenv/shrc.d/plenv.sh | 1 | ||||
-rw-r--r-- | pyenv/profile.d/pyenv.sh | 5 | ||||
-rw-r--r-- | pyenv/shrc.d/pyenv.sh | 18 | ||||
-rw-r--r-- | sh/profile.d/systemd.sh | 4 | ||||
-rw-r--r-- | sh/profile.d/visual.sh | 15 | ||||
-rw-r--r-- | tidy/profile.d/tidy.sh | 2 | ||||
-rw-r--r-- | tmux/tmux.conf | 2 | ||||
-rw-r--r-- | vim/filetype.vim | 1 | ||||
-rw-r--r-- | vim/vimrc.stub | 15 |
26 files changed, 216 insertions, 102 deletions
@@ -98,6 +98,7 @@ /bin/pst.sh /bin/pvi /bin/pwg +/bin/qat /bin/quo /bin/rep /bin/rfcf @@ -175,10 +176,11 @@ /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 /include/mktd.m4 +/less/less /urxvt/ext/select @@ -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 @@ -34,7 +34,9 @@ install-newsboat \ install-perlcritic \ install-perltidy \ + install-plenv \ install-psql \ + install-pyenv \ install-readline \ install-sh \ install-subversion \ @@ -88,6 +90,10 @@ .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 @@ -179,6 +185,7 @@ BINS = bin/ap \ bin/pst \ bin/pvi \ bin/pwg \ + bin/qat \ bin/quo \ bin/rep \ bin/rfcf \ @@ -275,7 +282,7 @@ GIT_TEMPLATE_HOOKS = git/template/hooks/post-update \ git/template/hooks/pre-commit \ git/template/hooks/prepare-commit-msg -all: $(BINS) git/gitconfig $(GIT_TEMPLATE_HOOKS) +all: $(BINS) git/config less/less $(GIT_TEMPLATE_HOOKS) clean distclean: rm -f -- \ @@ -286,9 +293,10 @@ clean distclean: $(GIT_TEMPLATE_HOOKS) \ dillo/dillorc \ dillo/dillorc.m4 \ - git/gitconfig \ - git/gitconfig.m4 \ + git/config \ + git/config.m4 \ include/mktd.m4 \ + less/less \ urxvt/ext/select \ vim/dist/* @@ -335,13 +343,17 @@ 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 XDG_CONFIG_HOME=$(XDG_CONFIG_HOME) \ + git/config.m4 > $@ + +less/less: less/lesskey + lesskey --output $@ less/lesskey MAILDIR = $(HOME)/Mail @@ -371,8 +383,8 @@ install-bash: check-bash install-sh cp -p -- bash/bash_logout $(HOME)/.bash_logout install-bash-completion: install-bash - mkdir -p -- $(HOME)/.bash_completion.d $(HOME)/.config - cp -p -- bash/bash_completion $(HOME)/.config + mkdir -p -- $(HOME)/.bash_completion.d $(XDG_CONFIG_HOME) + cp -p -- bash/bash_completion $(XDG_CONFIG_HOME) cp -p -- bash/bash_completion.d/* $(HOME)/.bash_completion.d install-bin: $(BINS) install-bin-man @@ -381,9 +393,9 @@ install-bin: $(BINS) install-bin-man -exec cp -p -- {} $(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 +405,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 @@ -416,17 +428,18 @@ install-games: $(GAMES) install-games-man -exec cp -p -- {} $(HOME)/.local/games \; install-games-man: - mkdir -p -- $(HOME)/.local/share/man/man6 - cp -p -- man/man6/*.6df $(HOME)/.local/share/man/man6 + mkdir -p -- $(XDG_DATA_HOME)/man/man6 + cp -p -- man/man6/*.6df $(XDG_DATA_HOME)/man/man6 -install-git: git/gitconfig $(GIT_TEMPLATE_HOOKS) - cp -p -- git/gitconfig $(HOME)/.gitconfig +install-git: git/config $(GIT_TEMPLATE_HOOKS) + mkdir -p -- $(XDG_CONFIG_HOME)/git + cp -p -- git/config $(XDG_CONFIG_HOME)/git/config find git/template \ -type d -exec sh -c 'mkdir -p -- \ - $(HOME)/.git-template"$${1#git/template}"' \ + $(XDG_CONFIG_HOME)/git/template"$${1#git/template}"' \ _ {} \; \ -o ! -name '*.*' -exec sh -c 'cp -p -- "$$1" \ - $(HOME)/.git-template"$${1#git/template}"' \ + $(XDG_CONFIG_HOME)/git/template"$${1#git/template}"' \ _ {} \; install-gnupg: @@ -434,28 +447,30 @@ install-gnupg: cp -p -- gnupg/*.conf $(HOME)/.gnupg 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 -install-less: - cp -p -- less/lesskey $(HOME)/.lesskey - lesskey +install-less: less/less + mkdir -p -- $(HOME)/.profile.d + cp -- less/profile.d/* $(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 @@ -463,21 +478,23 @@ install-mpd: install-sh 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 + mkdir -p -- $(XDG_CONFIG_HOME)/mutt \ + $(XDG_CONFIG_HOME)/mutt/muttrc.d \ + $(XDG_CACHE_HOME)/mutt + cp -p -- mutt/muttrc $(XDG_CACHE_HOME)/mutt + cp -p -- mutt/muttrc.d/src $(XDG_CONFIG_HOME)/mutt/muttrc.d 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 + mkdir -p -- $(XDG_CONFIG_HOME)/newsboat $(XDG_DATA_HOME)/newsboat + cp -p -- newsboat/config $(XDG_CONFIG_HOME)/newsboat install-mysql: cp -p -- mysql/my.cnf $(HOME)/.my.cnf @@ -491,11 +508,15 @@ install-ksh: check-ksh install-sh 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/* $(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/* $(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 @@ -504,6 +525,10 @@ install-plenv: install-sh install-psql: cp -p -- psql/psqlrc $(HOME)/.psqlrc +install-pyenv: install-sh + cp -p -- pyenv/profile.d/* $(HOME)/.profile.d + cp -p -- pyenv/shrc.d/* $(HOME)/.shrc.d + install-readline: cp -p -- readline/inputrc $(HOME)/.inputrc @@ -525,7 +550,8 @@ install-terminfo: install-tidy: install-sh cp -p -- tidy/profile.d/* $(HOME)/.profile.d - cp -p -- tidy/tidyrc $(HOME)/.tidyrc + 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 @@ -537,7 +563,7 @@ install-urxvt: urxvt/ext/select VIM = vim VIMDIR = $(HOME)/.vim -VIMRC = $(HOME)/.vim/vimrc +VIMRC = $(VIMDIR)/vimrc install-vim: install-vim-after \ install-vim-autoload \ @@ -556,23 +582,23 @@ install-vim-after: install-vim-after-ftplugin \ install-vim-after-syntax install-vim-after-ftplugin: install-vim-compiler - mkdir -p $(VIMDIR)/after/ftplugin + 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 + 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 + mkdir -p -- $(VIMDIR)/after/plugin cp -p -- vim/after/plugin/*.vim $(VIMDIR)/after/plugin install-vim-after-syntax: - mkdir -p $(VIMDIR)/after/syntax + mkdir -p -- $(VIMDIR)/after/syntax cp -p -- vim/after/syntax/*.vim $(VIMDIR)/after/syntax install-vim-autoload: - mkdir -p $(VIMDIR)/autoload + mkdir -p -- $(VIMDIR)/autoload cd vim && find autoload \ -type d -exec sh -c \ 'mkdir -p -- $(VIMDIR)/"$$1"' _ {} \; \ @@ -632,19 +658,18 @@ install-wget: 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/Xresources $(HOME)/.Xresources cp -p -- X/Xresources.d/* $(HOME)/.Xresources.d install-zsh: check-zsh install-sh - mkdir -p -- $(HOME)/.profile.d $(HOME)/.zshrc.d + mkdir -p -- $(HOME)/.zshrc.d cp -p -- zsh/profile.d/* $(HOME)/.profile.d cp -p -- zsh/zprofile $(HOME)/.zprofile cp -p -- zsh/zshrc $(HOME)/.zshrc @@ -25,9 +25,9 @@ For the default `all` target, you'll need a POSIX-fearing userland, including 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` 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: +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" @@ -47,9 +47,9 @@ dependencies: * `install-readline` * `install-vim` -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 `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. @@ -57,12 +57,12 @@ The remaining files can be installed with the other `install-*` targets. Try ### Configuration To keep a set of `make` targets useful for a specific user or host, you can -list them in a newline-separated file `~/.local/share/dotfiles.conf`, and -install using that with the special `install-conf` target. This can include -variable settings, too: +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 .local/share/dotfiles.conf + $ cat .config/dotfiles/config install-bash install-bin EMAIL=you@example.com @@ -264,8 +264,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 @@ -299,8 +299,8 @@ colored cyan. ### Mutt 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 mail -is sent. I use [Getmail](http://pyropus.ca/software/getmail/), +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 @@ -573,6 +573,7 @@ These scripts are 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. @@ -1,2 +1,2 @@ -tejr dotfiles v8.35.1 -Tue, 12 May 2020 03:02:38 +0000 +tejr dotfiles v8.36.0 +Tue, 12 May 2020 12:05:52 +0000 diff --git a/bin/qat.sh b/bin/qat.sh new file mode 100755 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/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/git/gitconfig.mi5 b/git/config.mi5 index 11b815d1..fba79411 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 @@ -85,7 +85,7 @@ mode "resize" { # i3bar at bottom of screen bar { position bottom - status_command i3status --config ~/.i3/status + status_command i3status --config ~/.config/i3/status workspace_buttons yes colors { 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 @@ -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/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/man7/dotfiles.7df b/man/man7/dotfiles.7df index 29ae08b7..8de509f5 100644 --- a/man/man7/dotfiles.7df +++ b/man/man7/dotfiles.7df @@ -79,14 +79,14 @@ directory to see a list. .PP 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]~/.local/share/dotfiles.conf\f[], and install using that with the +\f[C]~/.config/dotfiles/config\f[], and install using that with the special \f[C]install\-conf\f[] target. -This can include variable settings, too: +This can include macro settings for the \f[C]Makefile\f[], too: .IP .nf \f[C] $\ cd -$\ cat\ .local/share/dotfiles.conf +$\ cat\ .config/dotfiles/config install\-bash install\-bin EMAIL=you\@example.com @@ -399,9 +399,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 @@ -441,7 +441,7 @@ The files started as a joke (\f[C]exec\ bash\f[]). .PP 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 mail is sent. +\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 @@ -898,6 +898,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. diff --git a/mutt/muttrc b/mutt/muttrc index bf3a34d7..3af07a55 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -136,8 +136,8 @@ macro index,pager A \ # Shortcut to reload configuration macro generic,index,browser,pager \\R \ - ':source ~/.muttrc<enter>:echo "Config reloaded!"<enter>' \ - 'Reload ~/.muttrc' + ':source ~/.config/mutt/muttrc<enter>:echo "Config reloaded!"<enter>' \ + 'Reload muttrc' # Machine or account specific settings -source ~/.muttrc.d/src| +source ~/.config/mutt/muttrc.d/src| diff --git a/mutt/muttrc.d/src b/mutt/muttrc.d/src index cc2eb4ef..8b2aad6b 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/*.rc ; do + [ -e "$rc" ] || continue + group=$rc + group=${group##*/} + group=${group%.rc} + 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 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..5848fd5b 100644 --- a/plenv/shrc.d/plenv.sh +++ b/plenv/shrc.d/plenv.sh @@ -15,3 +15,4 @@ plenv() { ;; esac } +plenv rehash 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..1c90f8f2 --- /dev/null +++ b/pyenv/shrc.d/pyenv.sh @@ -0,0 +1,18 @@ +# POSIX-compatible version of the pyenv Bash shell wrapper +[ -d "$HOME"/.pyenv ] || return +pyenv() { + case $1 in + rehash) + shift + eval "$(pyenv sh-rehash "$@")" + ;; + shell) + shift + eval "$(pyenv sh-shell "$@")" + ;; + *) + command pyenv "$@" + ;; + esac +} +pyenv rehash diff --git a/sh/profile.d/systemd.sh b/sh/profile.d/systemd.sh deleted file mode 100644 index a6e1b707..00000000 --- a/sh/profile.d/systemd.sh +++ /dev/null @@ -1,4 +0,0 @@ -# If systemctl is installed, use $VISUAL as its editor, not $EDITOR -command -v systemctl >/dev/null 2>&1 || return -SYSTEMD_EDITOR=$VISUAL -export SYSTEMD_EDITOR 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/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 96d052a3..05e21f81 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -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 ' (mail:#(msc)) [#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/filetype.vim b/vim/filetype.vim index e1bdf728..1e34f42c 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 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 |