Skip to content

Instantly share code, notes, and snippets.

@austintraver
Last active September 29, 2020 03:36
Show Gist options
  • Save austintraver/ddc8e47a8910fd65b4577eb93b0dc4d2 to your computer and use it in GitHub Desktop.
Save austintraver/ddc8e47a8910fd65b4577eb93b0dc4d2 to your computer and use it in GitHub Desktop.
Read manpages inside vi
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