TransWikia.com

Text to vim-quickfix with navigation

Vi and Vim Asked on December 30, 2021

LaTeX, being a markup language, is very hard to grammar-check. I found one program, that do this exactly Textidote. Problem is, this is a standalone program and, for example, this latex code:

documentclass[a4paper]{article}
begin{document}
How is you?
I is fine.
I am fine.
end{document}

shows error:

 java -jar ~/bin/textidote.jar --check en_UK --output singleline i.tex 
TeXtidote v0.8.1 - A linter for LaTeX documents and others
(C) 2018-2019 Sylvain Hallé - All rights reserved

Found 2 warning(s)
Total analysis time: 3 second(s)

i.tex(L7C5-L7C7): The pronoun is must be used with are>.. Suggestions: [are] (4) "How is you?"
i.tex(L8C3-L8C5): Did you mean am>?. Suggestions: [am] (14) "I is fine."

My question is, is there some way that I convert this output to a quickfix list (with press n to go to next error)?

One Answer

The standard way to do this is to set 'makeprg' and 'errorformat' to appropriate values, and then do :make. Output is loaded into the quickfix list, which you navigate with the usual commands.

Further, putting these settings in a compiler plugin allows faster use: if you create ~/.vim/compiler/textidote.vim with the right contents, you can do

compiler textidote
make

A solid-looking compiler script has been posted in the comments.

Answered by D. Ben Knoble on December 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP