zsh: Move man wrapper into function for completion

This commit is contained in:
2021-01-04 16:34:16 +01:00
parent 4d4a5d4ef2
commit d0cd6ffef0
3 changed files with 12 additions and 3 deletions

View File

@@ -363,3 +363,12 @@ git-commit-last-msg() {
gitdir="$(git rev-parse --git-dir)" || return
git commit -eF <(sed -n '/^#/q;p' "$gitdir/COMMIT_EDITMSG")
}
nvim-man() {
if (( $+commands[nvim] )); then
# $MANPAGER does the trick too but lines are hard-wrapped.
nvim +"Man $* | only"
else
command man "$@"
fi
}