Is it possible to search for a particular string directly from a key binding, in TIG?

131 Views Asked by At

Can you search for a specific string directly from a bound command? I have a super-useful configuration – a bind to that opens up this simple Zsh script on '%(text)' passed as 1st argument:

#!/usr/bin/env zsh

emulate zsh -o extended_glob

if [[ $1 == (#b)([^:]##):([0-9]##):* ]]; then
    [[ -z $EDITOR ]] && EDITOR=mcedit

    $EDITOR +$match[2] **/$match[1];t
fi

It allows to open the compiler error-line by pointing cursor and pressing enter. It will automatically jump to the line with the error.

So, just run make within tig by :!make and browse all errors freely :)

However, I would need also a way to jump over to the errors, hence the question: how to search for "(error:|warning:)" directly via a key binding? I would like to bind it to n key in the pager view.

1

There are 1 best solutions below

0
johannes On

You can use

bind pager N :/\b(error|warning):

Similar to the default binding of @ in diff view. Press h to find that binding in the help view.