0

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.

torek
  • 448,244
  • 59
  • 642
  • 775
psprint
  • 349
  • 1
  • 10

1 Answers1

0

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.

johannes
  • 371
  • 1
  • 3