0

I get Trailing characters error with set errorformat when trying to use quickfix:

This is a sample line from a file 20240527-grep.txt that I would load into quickfix. Note, I obtained this output from a Grepper command:

pages/20230817-Beyza-GG.md|19 col 3| - TODO #p/beyza: Takip edelim

This is the command to load the above file into quickfix:

cfile ~/prj/collabryio/cldocs/cllogseq/20240527-grep.txt

This is the output in quickfix:

|| pages/20230817-Beyza-GG.md|19 col 3| - TODO #p/beyza: Takip edelim

I set errorformat with the following commands but I get Trailing characters error:

set errorformat+=%f|%l col %c|%m
# E488: Trailing characters: col %c
set errorformat^=%f|%l col %c|%m
# E488: Trailing characters: col %c

Now, I load the file into quickfix again:

cfile ~/prj/collabryio/cldocs/cllogseq/20240527-grep.txt

Now the output in quickfix becomes empty totally:


1

1 Answer 1

1

You have to escape the space and the pipe |:

set errorformat+=%f\|%l\ col\ %c\|%m

You could be interested to the alternative form:

let &errorformat .= ',%f|%l col %c|%m'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.