Created
February 15, 2016 18:30
-
-
Save nhooyr/600d9bb8d9310ed4b885 to your computer and use it in GitHub Desktop.
This file contains 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
function _nman | |
set page $argv[1..-2] #grab all arguments except for the last one | |
if [ -z "$page" ] | |
echo "What manual page do you want?" | |
return | |
end | |
set tmp $IFS | |
set IFS '\n' | |
set out (command man -w $page 2>&1) | |
set code $status | |
set IFS $tmp | |
if [ $code != 0 ] | |
echo "No manual entry for $page" | |
return | |
end | |
if [ -z $NVIM_LISTEN_ADDRESS ] | |
command nvim -c "$argv[-1] $page" | |
else | |
nvr --remote-send "<c-n>" -c "$argv[-1] $page" | |
end | |
end | |
function nman | |
_nman "$argv" 'Nman' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment