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 xman | |
set lookup_name "$argv[-1]" | |
set lookup_section "$argv[1]" | |
set open_string "" | |
set grep_string "" | |
set beginning_pattern "(^|[ \t\r\n\f])" | |
if [ $lookup_name = $lookup_section ]; set open_string "x-man-page://$lookup_name"; set grep_string "$beginning_pattern$lookup_name\\("; end; | |
if [ $lookup_name != $lookup_section ]; set open_string "x-man-page://$lookup_section/$lookup_name"; set grep_string "$beginning_pattern$lookup_name\\($lookup_section\\)"; end; | |