-
-
Save nhooyr/58a2efff34b027f75a1c 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 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