zsh:alias: Use nvim's Man function instead of pipe

Just setting neovim as the `MANPAGER` practically results in a pipe.
The problem with this is that `man` puts hard line breaks into the text
depending on the current window width. When the width changes afterwards
the input naturally doesn't change.
When using neovim's `Man` function this is resolved.
This commit is contained in:
2020-12-28 03:01:35 +01:00
parent a440e8b61e
commit 2b64781000

View File

@@ -56,6 +56,8 @@
alias bin='xxd -b -c4 | cut -d" " -f2-5' alias bin='xxd -b -c4 | cut -d" " -f2-5'
if (( $+commands[nvim] )); then if (( $+commands[nvim] )); then
alias vim='jobs | grep -q nvim && {fg;:;} || nvim' alias vim='jobs | grep -q nvim && {fg;:;} || nvim'
# $MANPAGER does the trick too but lines are hard-wrapped.
alias man='() { nvim +"Man $* | only" }'
fi fi
alias v='vim' alias v='vim'
alias vi='vim' alias vi='vim'