Last active
September 29, 2020 03:36
-
-
Save austintraver/ddc8e47a8910fd65b4577eb93b0dc4d2 to your computer and use it in GitHub Desktop.
Read manpages inside vi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeset -Hgx | |
# If `nvim` is installed | |
if (( ${+commands[nvim]} )) { | |
# Have `vi` refer to `nvim` | |
alias vi='nvim' | |
# open manpages using `nvim` | |
MANPAGER='nvim +Man!' | |
} else { | |
# Have `vi` refer to `vim` | |
alias vi='vim' | |
# open manpages using `less` (augmented with SGR color codes) | |
MANPAGER=${XDG_CONFIG_HOME}/man/pager | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment