Skip to content

Add inline syntax highlighting for awk with zed-awk #7

@rosingrind

Description

@rosingrind

Redirected there from dangh/zed-awk#1. Suppose you have a part of this sample shell script:

$_comp_command1 2>/dev/null |
    sed -r 's/(-[[:alpha:]-]+, )+(--[[:alpha:]-]+)+/\2/' |
    sed -r 's/^[[:space:]]+([[:alpha:]-]+)+[[:space:]]+/\1|/' |
    grep -E '^(--)?[[:alnum:]-]+\|[[:alpha:]]' |
    awk -F '|' '{ $2 = toupper(substr($2,1,1)) substr($2,2); print $1, "|-- ", $2 }' |
    column -s '|' -t

I'm talking about highlighting this specific part:

{ $2 = toupper(substr($2,1,1)) substr($2,2); print $1, "|-- ", $2 }
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions