zsh: Remove nvim-man and use neovim as MANPAGER
`:Man` wraps to the window width if `$MANWIDTH` is not set, making `nvim-man` as man wrapper obsolete.
This commit is contained in:
@@ -90,6 +90,10 @@ LESS+="${LESS:+ }--RAW-CONTROL-CHARS"
|
|||||||
LESS+="${LESS:+ }--quit-if-one-screen"
|
LESS+="${LESS:+ }--quit-if-one-screen"
|
||||||
export LESS
|
export LESS
|
||||||
|
|
||||||
|
# Use neovim's man plugin as manpager
|
||||||
|
(( ! $+commands[nvim] )) || \
|
||||||
|
export MANPAGER='nvim +"Man! | set scrolloff=999 | normal M"'
|
||||||
|
|
||||||
# NOTE: This is used in keys.zsh for the ALT_C widget
|
# NOTE: This is used in keys.zsh for the ALT_C widget
|
||||||
fzf_default_no_rg="find -L . -mindepth 1 \("
|
fzf_default_no_rg="find -L . -mindepth 1 \("
|
||||||
fzf_default_no_rg+=" -name '.git' -o"
|
fzf_default_no_rg+=" -name '.git' -o"
|
||||||
|
|||||||
@@ -174,7 +174,5 @@ fi
|
|||||||
alias vi='vim'
|
alias vi='vim'
|
||||||
! is_exec vi ||
|
! is_exec vi ||
|
||||||
alias v='vi'
|
alias v='vi'
|
||||||
(( ! $+commands[man] )) ||
|
|
||||||
alias man='nvim-man'
|
|
||||||
|
|
||||||
unfunction add_flags is_exec
|
unfunction add_flags is_exec
|
||||||
|
|||||||
@@ -393,20 +393,6 @@ cd() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
nvim-man() {
|
|
||||||
# Use nvim only if it exists, there was just one argument passed, that
|
|
||||||
# argument is not an option (e.g. `--version`) and stdout is a terminal.
|
|
||||||
if (( $+commands[nvim] && $# == 1 )) && [[ $1 == ${1#-} && -t 1 ]]; then
|
|
||||||
# Check for existence of man page.
|
|
||||||
command man -w "$1" >/dev/null || return
|
|
||||||
|
|
||||||
# $MANPAGER would do the trick too but lines would be hard-wrapped.
|
|
||||||
nvim +"Man $1 | only | set scrolloff=999 | normal M"
|
|
||||||
else
|
|
||||||
command man "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# This is meant for adding a quick fix to a commit.
|
# This is meant for adding a quick fix to a commit.
|
||||||
# It automatically rebases a given commit (defaults to HEAD), applies the given
|
# It automatically rebases a given commit (defaults to HEAD), applies the given
|
||||||
# stash (defaults to last) and finishes the rebase.
|
# stash (defaults to last) and finishes the rebase.
|
||||||
|
|||||||
Reference in New Issue
Block a user