From 2b647810004eb0a2c5e404eab9136a56240a5a2c Mon Sep 17 00:00:00 2001 From: druckdev Date: Mon, 28 Dec 2020 03:01:35 +0100 Subject: [PATCH] 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. --- .config/zsh/zshrc.d/30-alias.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/zsh/zshrc.d/30-alias.zsh b/.config/zsh/zshrc.d/30-alias.zsh index 5ad0a36..02f0224 100644 --- a/.config/zsh/zshrc.d/30-alias.zsh +++ b/.config/zsh/zshrc.d/30-alias.zsh @@ -56,6 +56,8 @@ alias bin='xxd -b -c4 | cut -d" " -f2-5' if (( $+commands[nvim] )); then alias vim='jobs | grep -q nvim && {fg;:;} || nvim' + # $MANPAGER does the trick too but lines are hard-wrapped. + alias man='() { nvim +"Man $* | only" }' fi alias v='vim' alias vi='vim'