zsh:funcs:nvim-man: Move page existence check call
Check for the existence of the page only if `nvim` would be executed.
This commit is contained in:
@@ -397,11 +397,10 @@ git-commit-last-msg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nvim-man() {
|
nvim-man() {
|
||||||
# Check for existence of man page. Assume that the page was specified as the
|
if (( $+commands[nvim] && $# == 1 )); then
|
||||||
# last argument.
|
# Check for existence of man page.
|
||||||
command man -w "${@[$#]}" >/dev/null || return
|
command man -w "$1" >/dev/null || return
|
||||||
|
|
||||||
if (( $+commands[nvim] )) && [[ $# -eq 1 ]]; then
|
|
||||||
# $MANPAGER does the trick too but lines are hard-wrapped.
|
# $MANPAGER does the trick too but lines are hard-wrapped.
|
||||||
nvim -u NORC +"runtime! plugin/man.vim | Man $1 | only | set scrolloff=999 | normal M"
|
nvim -u NORC +"runtime! plugin/man.vim | Man $1 | only | set scrolloff=999 | normal M"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user