2012-09-09 17:14:08 +02:00
|
|
|
def -shell-params \
|
|
|
|
-shell-completion %{ global -c $1 } \
|
2012-08-02 06:41:08 +02:00
|
|
|
tag %{ %sh{
|
2012-09-09 17:14:08 +02:00
|
|
|
if [[ $1 != "" ]]; then
|
|
|
|
tagname=$1
|
2012-05-18 07:23:02 +02:00
|
|
|
else
|
|
|
|
tagname=${kak_selection}
|
|
|
|
fi
|
2012-07-31 14:22:57 +02:00
|
|
|
params=$(global --result grep ${tagname} | sed "s/\([^:]*\):\([0-9]*\):\(.*\)/'\1:\2 \3' 'edit \1 \2; try %{ exec \"20k41Xs\\\\Q\3<ret>\" } catch %{ echo \"could not find [\3] near \1:\2\"; exec \2g }'/")
|
2012-05-18 07:23:02 +02:00
|
|
|
if [[ ${params} != "" ]]; then
|
2012-07-31 14:22:57 +02:00
|
|
|
echo "menu -auto-single ${params//$'\n'/ }"
|
2012-05-18 07:23:02 +02:00
|
|
|
else
|
|
|
|
echo echo tag ${tagname} not found
|
2012-07-31 14:22:57 +02:00
|
|
|
fi
|
|
|
|
}}
|