Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Created February 15, 2016 18:27
Show Gist options
  • Save nhooyr/58a2efff34b027f75a1c to your computer and use it in GitHub Desktop.
Save nhooyr/58a2efff34b027f75a1c to your computer and use it in GitHub Desktop.
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 nvimfunction _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'
endfunction _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
endfunction _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
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'
endend
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
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'
endc "$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