Skip to content

Instantly share code, notes, and snippets.

@kelvinauta
Created December 16, 2024 06:25
Show Gist options
  • Save kelvinauta/ea9181f8a7b11d19a32ab0e60df59458 to your computer and use it in GitHub Desktop.
Save kelvinauta/ea9181f8a7b11d19a32ab0e60df59458 to your computer and use it in GitHub Desktop.
# Use: `man somthing`
# Desc: This function adds the man command but opens it with nvim if it exists for your zsh or bash configuration.
function man() {
if ! command -v nvim &> /dev/null; then
echo "nvim is not installed, using normal man command"
command man "$@"
else
command man "$@" | col -bx | nvim -R - +'set ft=man'
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment